Public report of spacering-net/codeg, published 17 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, 17 November 2026, 18:42 UTC · Survey ID cd_7657c468f989461da897852de4f01f09
spacering-net/codeg
Measured 17 November 2026, 18:40 UTC, at code version 4991406
First survey, so nothing to compare with yet
CAI scoreAt risk
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: 919,401 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 8.8 person-years · Weakest lens: Code Health, 45.5
Findings by how serious they are
162 critical4032 serious272 minor
7 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
17 November 2026, 18:40 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 ▸
90of 90 dimensions measured by tools.
4424of 4466 findings point to an exact file and line, so you can open each one in the code. The other 42 concern the repository as a whole, such as missing documentation.
90dimensions across 10 lenses, read from 919,401 lines of product code in 2 projects.
spacering-net/codeg is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 52.4 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Code Health, at 45.5, is the weakest lens and counts most in the score. The best first step is writing log messages as searchable templates, worth about 3.6 points. Splitting the oversized files comes next, worth about 3.4 points. Raising Code Health to 67 would lift the score to about 57.5.
Thirty-three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nineteen secrets can leak from the build pipeline, and eleven known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version, limiting each secret to its own step and updating the vulnerable packages would close these risks. Fixing the weaknesses the scanner points to would fix the ten security weaknesses in the code, and the five unsafe settings in infrastructure or container files need changing to safe values. The 11 labels or groups of fields with no name need connecting to their fields or naming.
The product code is 919,401 lines, about €1,300,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 Code Health rose from 45.5 to 67, the lowest score rated Strong, the score would rise from 52.4 to about 57.5.
Code composition: what the lines of code are
Product code 80%Tests 20%
Rebuild cost: about €1,300,000 · Estimate
Cost to rebuild
€420,000 to €2,100,000, for 7,077 to 22,451 hours of work, about 8.8 person-years for 5 to 17 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 52. 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: 919,401 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.
Raises the score by about 3.6 points · Medium effort · Structured logging
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 3.4 points · Medium effort · Large Files
3
Bring the 38 bodies over 120 down to 120 or less in Cognitive Complexity — start with acp-agent-settings.AcpAgentSettings (cognitive 971), CodexParser::parse_conversation_detail (cognitive 873), acp-connections-context.AcpConnectionsProvider (cognitive 610).
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,300,000 to build again, about 8.8 person-years of work. Its weakest lens is Code Health, at 45.5 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Interpolated log message defeats structured logging. Of all the actions in this report, it raises the score most for the work it takes: about 3.6 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 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 908,759 lines over the last 90 days, which is about 3,685,523 lines a year. At that pace, the extra work comes to an estimated 499.3 to 2996 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
1293 modules, with 1764 dependencies between them. 16 loops run through 44 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1253 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.
codeg.acp.types uses codeg.models.agent, so a change to codeg.models.agent can break codeg.acp.types, while a change to codeg.acp.types can't break codeg.models.agent.
Position
Below the diagonal: codeg.acp.types uses a module listed above it, which is the healthy direction.
codeg.cli.connect uses codeg.cli.args, so a change to codeg.cli.args can break codeg.cli.connect, while a change to codeg.cli.connect can't break codeg.cli.args.
Position
Below the diagonal: codeg.cli.connect uses a module listed above it, which is the healthy direction.
codeg.cli.connect uses codeg.cli_run.wire, so a change to codeg.cli_run.wire can break codeg.cli.connect, while a change to codeg.cli.connect can't break codeg.cli_run.wire.
Position
Below the diagonal: codeg.cli.connect uses a module listed above it, which is the healthy direction.
codeg.computer.protocol uses codeg.computer.types, so a change to codeg.computer.types can break codeg.computer.protocol, while a change to codeg.computer.protocol can't break codeg.computer.types.
Position
Below the diagonal: codeg.computer.protocol uses a module listed above it, which is the healthy direction.
codeg.models.conversation uses codeg.models.agent, so a change to codeg.models.agent can break codeg.models.conversation, while a change to codeg.models.conversation can't break codeg.models.agent.
Position
Below the diagonal: codeg.models.conversation uses a module listed above it, which is the healthy direction.
codeg.models.conversation uses codeg.models.message, so a change to codeg.models.message can break codeg.models.conversation, while a change to codeg.models.conversation can't break codeg.models.message.
Position
Below the diagonal: codeg.models.conversation uses a module listed above it, which is the healthy direction.
codeg.parsers.agent_env uses codeg.models.agent, so a change to codeg.models.agent can break codeg.parsers.agent_env, while a change to codeg.parsers.agent_env can't break codeg.models.agent.
Position
Below the diagonal: codeg.parsers.agent_env uses a module listed above it, which is the healthy direction.
src.components.chat uses src.lib.types, so a change to src.lib.types can break src.components.chat, while a change to src.components.chat can't break src.lib.types.
Position
Below the diagonal: src.components.chat uses a module listed above it, which is the healthy direction.
src.components.chat.composer uses src.lib.types, so a change to src.lib.types can break src.components.chat.composer, while a change to src.components.chat.composer can't break src.lib.types.
Position
Below the diagonal: src.components.chat.composer uses a module listed above it, which is the healthy direction.
src.components.conversations uses src.lib.types, so a change to src.lib.types can break src.components.conversations, while a change to src.components.conversations can't break src.lib.types.
Position
Below the diagonal: src.components.conversations uses a module listed above it, which is the healthy direction.
src.components.layout uses src.lib.types, so a change to src.lib.types can break src.components.layout, while a change to src.components.layout can't break src.lib.types.
Position
Below the diagonal: src.components.layout uses a module listed above it, which is the healthy direction.
src.components.message uses src.lib.types, so a change to src.lib.types can break src.components.message, while a change to src.components.message can't break src.lib.types.
Position
Below the diagonal: src.components.message uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in src.components.settings uses a type in src.lib.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
src.components.settings uses src.lib.types, so a change to src.lib.types can break src.components.settings, while a change to src.components.settings can't break src.lib.types.
Position
Below the diagonal: src.components.settings uses a module listed above it, which is the healthy direction.
src.components.tasks uses src.lib.types, so a change to src.lib.types can break src.components.tasks, while a change to src.components.tasks can't break src.lib.types.
Position
Below the diagonal: src.components.tasks uses a module listed above it, which is the healthy direction.
234 pairs of types, where a type in src.lib uses a type in src.lib.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
codeg.acp.session_state uses codeg.models.agent, so a change to codeg.models.agent can break codeg.acp.session_state, while a change to codeg.acp.session_state can't break codeg.models.agent.
Position
Below the diagonal: codeg.acp.session_state uses a module listed above it, which is the healthy direction.
codeg.acp.session_state uses codeg.models.message, so a change to codeg.models.message can break codeg.acp.session_state, while a change to codeg.acp.session_state can't break codeg.models.message.
Position
Below the diagonal: codeg.acp.session_state uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in codeg.acp.session_state uses a type in codeg.acp.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
codeg.acp.session_state uses codeg.acp.types, so a change to codeg.acp.types can break codeg.acp.session_state, while a change to codeg.acp.session_state can't break codeg.acp.types.
Position
Below the diagonal: codeg.acp.session_state uses a module listed above it, which is the healthy direction.
29→33 codeg.acp.session_state uses codeg.acp.connectionpart of a loop✕
Connections
1 pair of types, where a type in codeg.acp.session_state uses a type in codeg.acp.connection.
codeg.acp.session_state uses codeg.acp.connection, so a change to codeg.acp.connection can break codeg.acp.session_state, while a change to codeg.acp.session_state can't break codeg.acp.connection.
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.
codeg.commands.browser uses codeg.browser.types, so a change to codeg.browser.types can break codeg.commands.browser, while a change to codeg.commands.browser can't break codeg.browser.types.
Position
Below the diagonal: codeg.commands.browser uses a module listed above it, which is the healthy direction.
codeg.commands.browser uses codeg.app_error, so a change to codeg.app_error can break codeg.commands.browser, while a change to codeg.commands.browser can't break codeg.app_error.
Position
Below the diagonal: codeg.commands.browser uses a module listed above it, which is the healthy direction.
codeg.parsers uses codeg.models.agent, so a change to codeg.models.agent can break codeg.parsers, while a change to codeg.parsers can't break codeg.models.agent.
Position
Below the diagonal: codeg.parsers uses a module listed above it, which is the healthy direction.
codeg.parsers uses codeg.models.message, so a change to codeg.models.message can break codeg.parsers, while a change to codeg.parsers can't break codeg.models.message.
Position
Below the diagonal: codeg.parsers uses a module listed above it, which is the healthy direction.
codeg.parsers uses codeg.acp.types, so a change to codeg.acp.types can break codeg.parsers, while a change to codeg.parsers can't break codeg.acp.types.
Position
Below the diagonal: codeg.parsers uses a module listed above it, which is the healthy direction.
codeg.parsers uses codeg.models.conversation, so a change to codeg.models.conversation can break codeg.parsers, while a change to codeg.parsers can't break codeg.models.conversation.
Position
Below the diagonal: codeg.parsers uses a module listed above it, which is the healthy direction.
codeg.parsers uses codeg.parsers.agent_env, so a change to codeg.parsers.agent_env can break codeg.parsers, while a change to codeg.parsers can't break codeg.parsers.agent_env.
Position
Below the diagonal: codeg.parsers uses a module listed above it, which is the healthy direction.
codeg.web.event_bridge uses codeg.models.agent, so a change to codeg.models.agent can break codeg.web.event_bridge, while a change to codeg.web.event_bridge can't break codeg.models.agent.
Position
Below the diagonal: codeg.web.event_bridge uses a module listed above it, which is the healthy direction.
codeg.web.event_bridge uses codeg.acp.types, so a change to codeg.acp.types can break codeg.web.event_bridge, while a change to codeg.web.event_bridge can't break codeg.acp.types.
Position
Below the diagonal: codeg.web.event_bridge uses a module listed above it, which is the healthy direction.
codeg.web.event_bridge uses codeg.acp.session_state, so a change to codeg.acp.session_state can break codeg.web.event_bridge, while a change to codeg.web.event_bridge can't break codeg.acp.session_state.
Position
Below the diagonal: codeg.web.event_bridge uses a module listed above it, which is the healthy direction.
codeg.acp.connection uses codeg.acp.delegation.listener, so a change to codeg.acp.delegation.listener can break codeg.acp.connection, while a change to codeg.acp.connection can't break codeg.acp.delegation.listener.
Position
Below the diagonal: codeg.acp.connection uses a module listed above it, which is the healthy direction.
codeg.acp.connection uses codeg.db, so a change to codeg.db can break codeg.acp.connection, while a change to codeg.acp.connection can't break codeg.db.
Position
Below the diagonal: codeg.acp.connection uses a module listed above it, which is the healthy direction.
codeg.acp.connection uses codeg.models.agent, so a change to codeg.models.agent can break codeg.acp.connection, while a change to codeg.acp.connection can't break codeg.models.agent.
Position
Below the diagonal: codeg.acp.connection uses a module listed above it, which is the healthy direction.
codeg.acp.connection uses codeg.models.message, so a change to codeg.models.message can break codeg.acp.connection, while a change to codeg.acp.connection can't break codeg.models.message.
Position
Below the diagonal: codeg.acp.connection uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in codeg.acp.connection uses a type in codeg.acp.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
codeg.acp.connection uses codeg.acp.types, so a change to codeg.acp.types can break codeg.acp.connection, while a change to codeg.acp.connection can't break codeg.acp.types.
Position
Below the diagonal: codeg.acp.connection uses a module listed above it, which is the healthy direction.
codeg.acp.connection uses codeg.acp.session_state, so a change to codeg.acp.session_state can break codeg.acp.connection, while a change to codeg.acp.connection can't break codeg.acp.session_state.
Position
Below the diagonal: codeg.acp.connection uses a module listed above it, which is the healthy direction.
codeg.acp.connection uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.acp.connection, while a change to codeg.acp.connection can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.acp.connection uses a module listed above it, which is the healthy direction.
codeg.chat_channel.manager uses codeg.chat_channel.types, so a change to codeg.chat_channel.types can break codeg.chat_channel.manager, while a change to codeg.chat_channel.manager can't break codeg.chat_channel.types.
Position
Below the diagonal: codeg.chat_channel.manager uses a module listed above it, which is the healthy direction.
codeg.chat_channel.manager uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.chat_channel.manager, while a change to codeg.chat_channel.manager can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.chat_channel.manager uses a module listed above it, which is the healthy direction.
34→35 codeg.chat_channel.manager uses codeg.acp.managerpart of a loop✕
Connections
1 pair of types, where a type in codeg.chat_channel.manager uses a type in codeg.acp.manager.
codeg.chat_channel.manager uses codeg.acp.manager, so a change to codeg.acp.manager can break codeg.chat_channel.manager, while a change to codeg.chat_channel.manager can't break codeg.acp.manager.
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.
codeg.acp.manager uses codeg.acp.delegation.listener, so a change to codeg.acp.delegation.listener can break codeg.acp.manager, while a change to codeg.acp.manager can't break codeg.acp.delegation.listener.
Position
Below the diagonal: codeg.acp.manager uses a module listed above it, which is the healthy direction.
codeg.acp.manager uses codeg.models.agent, so a change to codeg.models.agent can break codeg.acp.manager, while a change to codeg.acp.manager can't break codeg.models.agent.
Position
Below the diagonal: codeg.acp.manager uses a module listed above it, which is the healthy direction.
codeg.acp.manager uses codeg.acp.types, so a change to codeg.acp.types can break codeg.acp.manager, while a change to codeg.acp.manager can't break codeg.acp.types.
Position
Below the diagonal: codeg.acp.manager uses a module listed above it, which is the healthy direction.
codeg.acp.manager uses codeg.acp.session_state, so a change to codeg.acp.session_state can break codeg.acp.manager, while a change to codeg.acp.manager can't break codeg.acp.session_state.
Position
Below the diagonal: codeg.acp.manager uses a module listed above it, which is the healthy direction.
codeg.acp.manager uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.acp.manager, while a change to codeg.acp.manager can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.acp.manager uses a module listed above it, which is the healthy direction.
codeg.acp.manager uses codeg.acp.connection, so a change to codeg.acp.connection can break codeg.acp.manager, while a change to codeg.acp.manager can't break codeg.acp.connection.
Position
Below the diagonal: codeg.acp.manager uses a module listed above it, which is the healthy direction.
codeg.acp.manager uses codeg.chat_channel.manager, so a change to codeg.chat_channel.manager can break codeg.acp.manager, while a change to codeg.acp.manager can't break codeg.chat_channel.manager.
Position
Below the diagonal: codeg.acp.manager uses a module listed above it, which is the healthy direction.
codeg.commands.computer uses codeg.computer.types, so a change to codeg.computer.types can break codeg.commands.computer, while a change to codeg.commands.computer can't break codeg.computer.types.
Position
Below the diagonal: codeg.commands.computer uses a module listed above it, which is the healthy direction.
codeg.commands.computer uses codeg.app_error, so a change to codeg.app_error can break codeg.commands.computer, while a change to codeg.commands.computer can't break codeg.app_error.
Position
Below the diagonal: codeg.commands.computer uses a module listed above it, which is the healthy direction.
codeg.commands.computer uses codeg.computer.protocol, so a change to codeg.computer.protocol can break codeg.commands.computer, while a change to codeg.commands.computer can't break codeg.computer.protocol.
Position
Below the diagonal: codeg.commands.computer uses a module listed above it, which is the healthy direction.
codeg.commands.computer uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.commands.computer, while a change to codeg.commands.computer can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.commands.computer uses a module listed above it, which is the healthy direction.
codeg.commands.computer uses codeg.acp.connection, so a change to codeg.acp.connection can break codeg.commands.computer, while a change to codeg.commands.computer can't break codeg.acp.connection.
Position
Below the diagonal: codeg.commands.computer uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.cli_run.wire, so a change to codeg.cli_run.wire can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.cli_run.wire.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.db, so a change to codeg.db can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.db.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.models.agent, so a change to codeg.models.agent can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.models.agent.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.acp.types, so a change to codeg.acp.types can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.acp.types.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.acp.session_state, so a change to codeg.acp.session_state can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.acp.session_state.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.acp.connection, so a change to codeg.acp.connection can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.acp.connection.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.cli_run.service uses codeg.acp.manager, so a change to codeg.acp.manager can break codeg.cli_run.service, while a change to codeg.cli_run.service can't break codeg.acp.manager.
Position
Below the diagonal: codeg.cli_run.service uses a module listed above it, which is the healthy direction.
codeg.commands.acp uses codeg.db.entities.agent_setting, so a change to codeg.db.entities.agent_setting can break codeg.commands.acp, while a change to codeg.commands.acp can't break codeg.db.entities.agent_setting.
Position
Below the diagonal: codeg.commands.acp uses a module listed above it, which is the healthy direction.
codeg.commands.acp uses codeg.models.agent, so a change to codeg.models.agent can break codeg.commands.acp, while a change to codeg.commands.acp can't break codeg.models.agent.
Position
Below the diagonal: codeg.commands.acp uses a module listed above it, which is the healthy direction.
codeg.commands.acp uses codeg.acp.types, so a change to codeg.acp.types can break codeg.commands.acp, while a change to codeg.commands.acp can't break codeg.acp.types.
Position
Below the diagonal: codeg.commands.acp uses a module listed above it, which is the healthy direction.
codeg.commands.acp uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.commands.acp, while a change to codeg.commands.acp can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.commands.acp uses a module listed above it, which is the healthy direction.
codeg.commands.acp uses codeg.acp.connection, so a change to codeg.acp.connection can break codeg.commands.acp, while a change to codeg.commands.acp can't break codeg.acp.connection.
Position
Below the diagonal: codeg.commands.acp uses a module listed above it, which is the healthy direction.
codeg.commands.acp uses codeg.acp.manager, so a change to codeg.acp.manager can break codeg.commands.acp, while a change to codeg.commands.acp can't break codeg.acp.manager.
Position
Below the diagonal: codeg.commands.acp uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.cli.args, so a change to codeg.cli.args can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.cli.args.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.db, so a change to codeg.db can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.db.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.db.entities.agent_setting, so a change to codeg.db.entities.agent_setting can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.db.entities.agent_setting.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.forge, so a change to codeg.forge can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.forge.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.models.agent, so a change to codeg.models.agent can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.models.agent.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.acp.types, so a change to codeg.acp.types can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.acp.types.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.work_task.engine uses codeg.acp.manager, so a change to codeg.acp.manager can break codeg.work_task.engine, while a change to codeg.work_task.engine can't break codeg.acp.manager.
Position
Below the diagonal: codeg.work_task.engine uses a module listed above it, which is the healthy direction.
codeg.app_state uses codeg.acp.delegation.listener, so a change to codeg.acp.delegation.listener can break codeg.app_state, while a change to codeg.app_state can't break codeg.acp.delegation.listener.
Position
Below the diagonal: codeg.app_state uses a module listed above it, which is the healthy direction.
codeg.app_state uses codeg.web.event_bridge, so a change to codeg.web.event_bridge can break codeg.app_state, while a change to codeg.app_state can't break codeg.web.event_bridge.
Position
Below the diagonal: codeg.app_state uses a module listed above it, which is the healthy direction.
codeg.app_state uses codeg.chat_channel.manager, so a change to codeg.chat_channel.manager can break codeg.app_state, while a change to codeg.app_state can't break codeg.chat_channel.manager.
Position
Below the diagonal: codeg.app_state uses a module listed above it, which is the healthy direction.
codeg.app_state uses codeg.acp.manager, so a change to codeg.acp.manager can break codeg.app_state, while a change to codeg.app_state can't break codeg.acp.manager.
Position
Below the diagonal: codeg.app_state uses a module listed above it, which is the healthy direction.
codeg.app_state uses codeg.cli_run.service, so a change to codeg.cli_run.service can break codeg.app_state, while a change to codeg.app_state can't break codeg.cli_run.service.
Position
Below the diagonal: codeg.app_state uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 45.5 · Weak · gated by D1, D2, R3, X4 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
86
High / Critical
A03:2025 — Software Supply Chain Failures
64
High / Critical
A02:2025 — Security Misconfiguration
11
High / Critical
Roadmap
Top priorities: Interpolated log message defeats structured logging; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Bring the 38 bodies over 120 down to 120 or less in Cognitive Complexity — start with acp-agent-settings.AcpAgentSettings (cognitive 971), CodexParser::parse_conversation_detail (cognitive 873), acp-connections-context.AcpConnectionsProvider (cognitive 610).
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Bring the 38 bodies over 120 down to 120 or less in Cognitive Complexity — start with acp-agent-settings.AcpAgentSettings (cognitive 971), CodexParser::parse_conversation_detail (cognitive 873), acp-connections-context.AcpConnectionsProvider (cognitive 610).
Bring the 7 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with acp-connections-context.AcpConnectionsProvider (cyclomatic 489), workspace-context.WorkspaceProvider (cyclomatic 454), tab-store.useTabStore (cyclomatic 289).
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
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 — 162
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 — 4032
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 — 272
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 7
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 90 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 — 90 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, 4424 of 4466 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 the repository root could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.9.0.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#…), 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 10,727 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 28 test source file(s) (.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 the repository root could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.9.0.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#…), 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 vitest suite in the repository root was NOT MEASURED: the dependency install for the repository root could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.9.0.tgz; for troubleshooting help, see https://github.com/nodejs/corepack#…), 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.
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 package.json, 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.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (71 contributor(s) across 4090 commit(s) sampled, automation and bot accounts excluded). One of them holds 93% of the history; the other 70 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
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 per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): 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.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `src/components/ai-elements/message.tsx`, `src/components/automations/cron-builder-dialog.tsx`, `src/components/browser/browser-agent-access.tsx`, `src/components/browser/browser-device-menu.tsx`, `src/components/browser/browser-status-layer.tsx`, … (+36 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AC2 Forms & labels — 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. 246 further occurrence(s) are not listed individually; the score already reflects all 286.
AC6 Visual & motion safety — 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. 19 further occurrence(s) are not listed individually; the score already reflects all 59.
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.
C2 Access Controls — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
ED1 Handler temporal coupling — 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. 698 further occurrence(s) are not listed individually; the score already reflects all 738.
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. 680 further occurrence(s) are not listed individually; the score already reflects all 720.
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. 674 further occurrence(s) are not listed individually; the score already reflects all 714.
R3 Large Files — 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. 158 further occurrence(s) are not listed individually; the score already reflects all 198.
R4 Test Coverage — 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. 54 further occurrence(s) are not listed individually; the score already reflects all 94.
R7 Dead Code — 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. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
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. 103 further occurrence(s) are not listed individually; the score already reflects all 143.
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.
X25 Inert configuration knob — 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. 32 further occurrence(s) are not listed individually; the score already reflects all 72.
X27 Collection changed while being enumerated — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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.
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. 306 further occurrence(s) are not listed individually; the score already reflects all 346.
X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 802 further occurrence(s) are not listed individually; the score already reflects all 842.
X5 Nullable reference types — 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. 91 further occurrence(s) are not listed individually; the score already reflects all 131.
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. 57 further occurrence(s) are not listed individually; the score already reflects all 97.
Repo exclusion declarations: 12 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.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
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.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
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.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
668 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was acp-connections-context.AcpConnectionsProvider at 489. A further 29 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 codeg::parsers::cursor::tool_name_for_field at 83 — they are counted neither in the figure above nor in this dimension's score. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src-tauri/src/browser/doc_guest.rs (codeg::browser::doc_guest::content_type at 29), src-tauri/src/commands/computer.rs (codeg::commands::computer::denied at 23), src-tauri/src/acp/registry.rs (codeg::acp::registry::get_agent_meta at 22), src-tauri/src/models/agent.rs (AgentType::fmt at 22), src/components/message/delegation-status-badge.tsx (delegation-status-badge.ErrorLabel at 19), and 5 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.
+ 508 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with acp-connections-context.AcpConnectionsProvider (cyclomatic 489), workspace-context.WorkspaceProvider (cyclomatic 454), tab-store.useTabStore (cyclomatic 289). — 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 7 together lifts Cyclomatic Complexity from 2.5 to about 3.6/10, projected with the scoring formula itself and assuming each lands exactly at 240; 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.
+ 618 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 38 bodies over 120 down to 120 or less in Cognitive Complexity — start with acp-agent-settings.AcpAgentSettings (cognitive 971), CodexParser::parse_conversation_detail (cognitive 873), acp-connections-context.AcpConnectionsProvider (cognitive 610). — 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 38 together lifts Cognitive Complexity from 2.0 to about 3.2/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 Classes7.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 319 FunctionTooLong finding(s) in God Classes — start with connection.rs (9), mod.rs (5), folders.rs (4). — One of this dimension's main actionable groups (319 warning-level).
Resolve the 213 FileTooLong finding(s) in God Classes — start with mod.rs (8), acp.rs (2), engine.rs (2). — One of this dimension's main actionable groups (213 warning-level).
Resolve the 30 MethodTooLong finding(s) in God Classes — start with engine.rs (4), broker.rs (3), manager.rs (3). — One of this dimension's main actionable groups (30 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.
597 duplicated block group(s) detected. 3.0 % of the production lines (27,147 of 919,401) are in a reported copy. A further 415 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 1012 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. Measured on part of this repository only: .tsx (24% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
+ 265 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 54 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with folders.rs (5), _common.py (5), acp.rs (4). — One of this dimension's main actionable groups (54 warning-level).
Resolve the 46 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with acp.rs (4), folders.rs (4), work_task_service.rs (3). — One of this dimension's main actionable groups (46 warning-level).
Resolve the 46 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with automation.rs (3), windows.rs (3), acp.rs (2). — One of this dimension's main actionable groups (46 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ 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.
2 production modules (Cargo+npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence.
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.
D10 · Test Quality10.0 / 10Stronggated by 9 serious findings✓ 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.
1 skipped (1 with a documented reason), 7 zero-assertion, 2 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 10727 tests. Measured on the JavaScript/TypeScript suite only — at least 28 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: says the shortcut waits for computer use to be switched on · ×7src/components/settings/computer-settings.test.tsx:498
Fixed-sleep synchronisation: re-probes an unconfirmed snapshot exactly once, then treats it as not switched · ×2src/components/settings/assistant-editor-dialog.test.tsx:523
Mock-dominated test: is wired into the shared defineMonacoThemes beforeMount hook · ×44src/lib/monaco-themes.test.ts:103
Resolve the 44 Mock-dominated test finding(s) in Test Quality — start with forge-issue-detail-sheet.test.tsx (5), heavy-plugins-warmup.test.tsx (4), use-connection-lifecycle.send-failure.test.ts (3). — One of this dimension's main actionable groups (44 recommendation-level).
Resolve the 7 No assertions finding(s) in Test Quality — start with config-sync-settings.test.tsx (2), cursor-config-panel.test.tsx (2), computer-settings.test.tsx. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 2 Fixed-sleep synchronisation finding(s) in Test Quality — start with assistant-editor-dialog.test.tsx, provider-models.test.tsx. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
29 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: axum · ×29
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 842 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 1 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, 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: src/components/settings/acp-agent-settings.tsx (53×797=42241); src/contexts/acp-connections-context.tsx (69×489=33741); src-tauri/src/acp/connection.rs (195×144=28080) Repeated repair below the complexity floor: src-tauri/src/work_task/git.rs (14 of 22 changes were fixes); src-tauri/src/computer/local.rs (12 of 21 changes were fixes); src-tauri/src/commands/system_settings.rs (12 of 16 changes were fixes)
Resolve the 235 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (2), acp-agent-settings.tsx, acp-connections-context.tsx. — One of this dimension's main actionable groups (235 warning-level).
Resolve the 52 Repeated repair finding(s) in Churn × Complexity Hotspots — start with git.rs, local.rs, system_settings.rs. — One of this dimension's main actionable groups (52 warning-level).
Detailed fixes: d15_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.
6 deducted task-comment markers across 919401 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
TodoComment · ×5src-tauri/src/parsers/grok.rs:181
XxxCommentsrc-tauri/src/acp/registry.rs:2332
What to do
Resolve the 5 TodoComment finding(s) in Explicit Debt — start with work_task_service.rs (2), grok.rs, m20260801_000001_work_task.rs. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 XxxComment finding(s) in Explicit Debt — start with registry.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 3 document(s) read across 2 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with package.json. — 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.
1 naming inconsistencies among 39 declarations measured against a convention their peers follow.
`getJSON` spells `JSON` where 38 names in the project spell it `Json`src/components/chat/composer/rich-composer.tsx:89
What to do
Resolve the 1 `getJSON` spells `JSON` where 38 names in the project spell it `Json` finding(s) in Naming Consistency — start with rich-composer.tsx. — 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.
2 of 2 build units (Cargo, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×2src-tauri/Cargo.toml:1
What to do
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cargo.toml, package.json. — One of this dimension's main actionable groups (2 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).
86 finding(s): 0 critical, 66 high, 20 medium, 0 low. 33 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 62 file(s) — `install.sh` (line 442, line 447), `src-tauri/experts/skills/executing-plans/scripts/task-done` (line 40), `src-tauri/src/acp/agent_process.rs` (line 795, line 807, line 1424), `src/components/ai-elements/message.tsx` (line 547), `src/components/automations/cron-builder-dialog.tsx` (line 64), … (+57 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 18 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (18). — One of this dimension's main actionable groups (18 issue-level).
Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (7 issue-level).
No action in Static Analysis (SAST) — all 33 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (33 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 16 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (16). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (2). — One of this dimension's main actionable groups (8 issue-level).
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 5 High IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — 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.
15 of 1363 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src-tauri/src/db/migration/m20260211_000001_init.rs. Counted over 1363 of the 1696 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 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with conversation-detail-panel.tsx, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 14 Change coupling finding(s) in Change Coupling — start with mod.rs (2), use-appearance.ts, aux-panel-file-tree-tab.tsx. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 3 Change coupling clique finding(s) in Change Coupling — start with content-parts-renderer.tsx, acp-agent-settings.tsx, codex.rs. — One of this dimension's main actionable groups (3 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.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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. — 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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 76 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.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives6.5 / 10Strong✓ 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. — src/lib/custom-style.ts:471
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 & labels4.3 / 10Weak✓ 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.
An element made editable (contenteditable, or role="textbox"/"searchbox" with a tab stop or key handling) is a text-entry control, and it has no aria-label, no aria-labelledby and no title, so assistive tech announces an unnamed edit field. Point aria-labelledby at its visible caption, or add an aria-label. — REDACTED:80
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×5) — src/app/login/page.tsx:91, src/components/canvas/add-node-menu.tsx:239, src/components/canvas/add-node-menu.tsx:456, …
This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×11) — src/components/automations/agent-config-section.tsx:381, src/components/settings/acp-agent-settings.tsx:4946, src/components/settings/acp-agent-settings.tsx:4954, …
This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×12) — src/components/chat/ask-question-card.tsx:412, src/components/conversations/conversation-manage-dialog.tsx:896, src/components/conversations/conversation-manage-dialog.tsx:927, …
This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — REDACTED:2260, src/components/conversations/move-to-folder-menu.tsx:47, src/components/conversations/move-to-folder-menu.tsx:116
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×4) — src/components/chat/message-queue-display.tsx:95, src/components/conversations/conversation-manage-dialog.tsx:1012, src/components/layout/status-bar-alerts.tsx:183, …
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — src/components/chat/plan-approval-card.tsx:91, src/components/layout/commit-dialog.tsx:1305, src/components/settings/acp-agent-settings.tsx:9003
This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it. — src/components/settings/acp-agent-settings.tsx:9403
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.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×2) — REDACTED:60, src-tauri/experts/skills/brainstorming/scripts/frame-template.html:2
An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label. (×4) — REDACTED:103, REDACTED:106, REDACTED:111, …
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — src-tauri/experts/skills/brainstorming/scripts/frame-template.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 interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. — REDACTED:69
This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — src/components/canvas/nodes/note-node.tsx:93
This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — src/components/canvas/nodes/region-node.tsx:184
This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). — src/components/conversations/group-split-handle.tsx:80
This <span> carries its own click handler, but it sits inside a <button> that performs a different action. A keyboard user reaches the <button> and activating it runs the <button>'s handler, never this one, so this action has no keyboard path at all. Role and tabindex cannot supply one: HTML forbids a <button> from containing interactive content or any descendant with a tabindex, so the browser will not put this element in the tab order however it is marked up. Move it out of the <button> and make it a sibling <button>, so each action has its own control. (×2) — src/components/files/file-workspace-panel.tsx:2019, src/components/shared/directory-browser.tsx:498
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. — src/components/layout/sidebar.tsx:667
A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. — src/components/terminal/terminal-tab-bar.tsx:91
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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.
aria-activedescendant is present but empty, so it references no element and the relationship is lost. Point it at the id(s) of the target element, or remove it. — src/components/chat/composer/suggestion/suggestion-popup.tsx:594
This is not a valid WAI-ARIA attribute, so assistive technology ignores it (usually a typo). Use the correct aria-* attribute. — src/components/chat/sub-agent-overlay.tsx:179
What to do
Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
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.
`.option .letter` sets color: #86868b on background-color: #e5e5e7 — 2.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src-tauri/experts/skills/brainstorming/scripts/frame-template.html:123
`.option.selected .letter` sets color: white on background-color: #0a84ff — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src-tauri/experts/skills/brainstorming/scripts/frame-template.html:131
`.mockup-header` sets color: #86868b on background-color: #e5e5e7 — 2.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src-tauri/experts/skills/brainstorming/scripts/frame-template.html:161
`.placeholder` sets color: #aeaeb2 on background-color: #e5e5e7 — 1.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src-tauri/experts/skills/brainstorming/scripts/frame-template.html:183
`.mock-nav` sets color: white on background-color: #0a84ff — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src-tauri/experts/skills/brainstorming/scripts/frame-template.html:193
`.mock-button` sets color: white on background-color: #0a84ff — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src-tauri/experts/skills/brainstorming/scripts/frame-template.html:196
<button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×15) — src/app/pet/_components/PetBadge.tsx:44, src/components/chat/composer-connection-status.tsx:207, src/components/chat/conversation-context-bar.tsx:515, …
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×7) — src/components/automations/automation-editor.tsx:346, src/components/browser/browser-toolbar.tsx:368, src/components/chat/composer/composer-add-menu.tsx:240, …
<span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — src/components/automations/automations-page.tsx:951, src/components/conversations/sidebar-conversation-card.tsx:597
<div> moves — its `animate-[browser-loading_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — src/components/browser/browser-toolbar.tsx:499
<textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — src/components/canvas/nodes/note-node.tsx:122
<div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×3) — src/components/chat/chat-width-handles.tsx:310, src/components/diff/image-diff-view.tsx:324, src/components/files/pdf-viewer.tsx:538
<div> moves — its `animate-[computer-marker-fade_1100ms_ease-out_forwards]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — src/components/computer/computer-marker.tsx:60
<span> moves — its `animate-[computer-marker-ring_900ms_ease-out_forwards]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — src/components/computer/computer-marker.tsx:65
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. — src/components/layout/session-details-insights.tsx:185
<div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — src/components/layout/status-bar-tasks.tsx:15, src/components/layout/status-bar-update.tsx:32
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 dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether 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.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
What to do
Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
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 · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
`binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×3) — src-tauri/src/acp/binary_cache.rs:116, src-tauri/src/acp/binary_cache.rs:122, src-tauri/src/acp/binary_cache.rs:137
`binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — src-tauri/src/acp/binary_cache.rs:120, src-tauri/src/acp/binary_cache.rs:177
`binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:159
`binary_cache.uvx_prepared_version` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:193
`binary_cache.mark_uvx_agent_prepared` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:202
`binary_cache.mark_uvx_agent_prepared` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::write`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:205
`binary_cache.clear_uvx_agent_prepared` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:212
`binary_cache.clear_agent_dir_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — src-tauri/src/acp/binary_cache.rs:498, src-tauri/src/acp/binary_cache.rs:521
`binary_cache.clear_agent_dir_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:511
`binary_cache.clear_agent_dir_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:518
`binary_cache.installed_binary_path_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:662
`binary_cache.collect_version_labels` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:689
`binary_cache.file_sha256` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:907
`binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×3) — src-tauri/src/acp/binary_cache.rs:960, src-tauri/src/acp/binary_cache.rs:967, src-tauri/src/acp/binary_cache.rs:983
`binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×3) — src-tauri/src/acp/binary_cache.rs:965, src-tauri/src/acp/binary_cache.rs:1021, src-tauri/src/acp/binary_cache.rs:1024
`binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1005
`binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1009
`binary_cache.install_extracted_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1081
`binary_cache.install_extracted_tree` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1085
`binary_cache.download_file_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::create`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1195
`binary_cache.unpack_download` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1249
`binary_cache.extract_tar_gz` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1261
`binary_cache.extract_zip` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1281
`binary_cache.set_executable_permissions` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1294
`binary_cache.set_executable_permissions` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::set_permissions`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1298
`binary_cache.is_binary_file_compatible` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/binary_cache.rs:1308
`claude_model_picker.user_picker` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/claude_model_picker.rs:104
`lock.normalize_home` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/codex_catalog_commit/lock.rs:129
`lock.next_seq` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/codex_catalog_commit/lock.rs:245
`codex_catalog_commit.read_opt` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/codex_catalog_commit/mod.rs:265
`codex_catalog_commit.same_path` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/codex_catalog_commit/mod.rs:378
`txn.hash_of` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — src-tauri/src/acp/codex_catalog_commit/txn.rs:170
What to do
Use the awaited twin of each blocking call, or move the work off the loop with `tokio::task::spawn_blocking` — a synchronous handler cannot simply `.await` in place.
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.
Other · Code Health — Unreviewed-generation residue in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`handle_cursor_update_todos` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/acp/connection.rs:11080
`handle_cursor_task` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/acp/connection.rs:11093
`handle_cursor_generate_image` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/acp/connection.rs:11101
`send_broker_cancel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/acp/delegation/companion.rs:97
`client_commit_feedback` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/acp/delegation/transport.rs:717
`send` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/acp/event_stream.rs:81
`install_delegation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/acp/manager.rs:724
`install_chat_channel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/acp/manager.rs:731
`workdir_of` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. (×2) — src-tauri/src/browser/listener.rs:533, src-tauri/src/browser/listener.rs:556
`listener_pid` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/browser/listener.rs:548
`program_of` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/browser/listener.rs:552
`refresh_user_agent` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/browser/shim/linux_child.rs:201
`devtools_visible` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/browser/shim/windows.rs:222
`navigating_to` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. (×2) — src-tauri/src/browser/surface_window.rs:666, src-tauri/src/browser/surface_window.rs:827
`refresh_user_agent` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. (×2) — src-tauri/src/browser/surface_window.rs:771, src-tauri/src/browser/surface_window.rs:905
`adopt` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/browser/surface_window.rs:823
`forget` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/browser/surface_window.rs:825
`can_go_back` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/browser/surface_window.rs:877
`can_go_forward` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/browser/surface_window.rs:881
`cancel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/cli/run.rs:722
`set_opener` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/cli_run/service.rs:512
`cleanup_prepared_sources` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/commands/backup/source.rs:206
`validate_preferences` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/commands/config_sync/domains.rs:204
`emit_workspace_transfer_progress` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/commands/remote_proxy.rs:1219
`process_start` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src-tauri/src/computer/procinfo.rs:238
`update` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — src-tauri/src/db/service/work_task_service.rs:1010
`persist_pet_closed` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/lib.rs:201
`apply_settings` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/logging/hub.rs:199
`set_log_file` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/logging/panic_hook.rs:178
`log_status` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/network/webdav.rs:307
`start` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. — src-tauri/src/work_task/engine.rs:827
`delete_ref` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src-tauri/src/work_task/git.rs:367
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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.
`package.json` 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`. — package.json:26
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.
Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse. — REDACTED:1239
What to do
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ 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).
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · 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.
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×5) — src-tauri/src/acp/binary_cache.rs:1178, src-tauri/src/commands/version_control.rs:267, src-tauri/src/commands/version_control.rs:362, …
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. 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.
`spawn_agent_connection` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — src-tauri/src/acp/connection.rs:2776
What to do
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
Do you agree with this assessment?
R1 · Type Safety10.0 / 10Exemplary✓ 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.
259 duplicated blocks under src/components/ have copies in at least two of the sibling directories ai-elements, automations, browser, canvas, chat, computer (+16 more sibling(s) not listed) — 108 of them are reported below, and 151 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 259 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 259 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 259 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. — src/components/layout/commit-message-settings-dialog.tsx:284
81 duplicated blocks under src/ have copies in at least two of the sibling directories app, components, contexts, hooks, lib, stores — 36 of them are reported below, and 45 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 81 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 81 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 81 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. — src/hooks/use-proxied-background-thumb.ts:44
7 duplicated blocks under src/app/ have copies in at least two of the sibling directories commit, import-sessions, merge, project-boot, push, settings (+2 more sibling(s) not listed) — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 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. — src/app/merge/page.tsx:6
src/components/layout/branch-selector-list.tsx:204 · src/components/layout/git-log-branch-filter-list.tsx:118 — the two spans are one implementation copied and then locally edited — 1738 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. — src/components/layout/branch-selector-list.tsx:204
src/components/layout/command-manage-dialog.tsx:530 · src/components/layout/remote-workspace-manage-dialog.tsx:417 — the two spans are one implementation copied and then locally edited — 1122 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. — src/components/layout/command-manage-dialog.tsx:530
src/components/layout/command-manage-dialog.tsx:159 · src/components/layout/remote-workspace-manage-dialog.tsx:117 — the two spans are one implementation copied and then locally edited — 1361 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. — src/components/layout/command-manage-dialog.tsx:159
src/components/project-boot/hyperframes/hyperframes-launcher.tsx:83 · src/components/project-boot/shadcn/create-project-dialog.tsx:69 — the two spans are one implementation copied and then locally edited — 1009 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. — src/components/project-boot/hyperframes/hyperframes-launcher.tsx:83
src/components/layout/commit-message-settings-dialog.tsx:284 · src/components/settings/assistant-editor-dialog.tsx:224 — the two spans are one implementation copied and then locally edited — 1019 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. — src/components/layout/commit-message-settings-dialog.tsx:284
src/components/layout/remote-workspace-manage-dialog.tsx:174 · src/components/settings/quick-messages-settings.tsx:131 — the two spans are one implementation copied and then locally edited — 1066 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. — src/components/layout/remote-workspace-manage-dialog.tsx:174
src/components/shared/directory-browser.tsx:156 · src/components/shared/server-file-browser-dialog.tsx:46 — the two spans are one implementation copied and then locally edited — 996 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. — src/components/shared/directory-browser.tsx:156
src/components/settings/add-model-provider-dialog.tsx:46 · src/components/settings/edit-model-provider-dialog.tsx:49 — the two spans are one implementation copied and then locally edited — 836 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. — src/components/settings/add-model-provider-dialog.tsx:46
src/components/conversations/sidebar-conversation-list.tsx:558 · src/components/conversations/sidebar-folder-group-header.tsx:220 — the two spans are one implementation copied and then locally edited — 663 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. — src/components/conversations/sidebar-conversation-list.tsx:558
src/components/layout/push-workspace.tsx:322 · src/components/layout/unstash-dialog.tsx:192 — the two spans are one implementation copied and then locally edited — 783 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. — src/components/layout/push-workspace.tsx:322
src/lib/transport/remote-desktop-transport.ts:155 · src/lib/transport/web-transport.ts:126 — the two spans are one implementation copied and then locally edited — 779 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. — src/lib/transport/remote-desktop-transport.ts:155
src/components/settings/experts-settings.tsx:35 · src/components/settings/science-settings.tsx:39 — the two spans are one implementation copied and then locally edited — 701 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. — src/components/settings/experts-settings.tsx:35
src/components/layout/aux-panel-git-log-tab.tsx:425 · src/components/layout/push-workspace.tsx:84 — 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. — src/components/layout/aux-panel-git-log-tab.tsx:425
src/components/settings/add-chat-channel-dialog.tsx:114 · src/components/settings/edit-chat-channel-dialog.tsx:102 — the two spans are one implementation copied and then locally edited — 624 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. — src/components/settings/add-chat-channel-dialog.tsx:114
src/components/forge/forge-combine-dialog.tsx:145 · src/components/forge/forge-start-dialog.tsx:173 — the two spans are one implementation copied and then locally edited — 530 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. — src/components/forge/forge-combine-dialog.tsx:145
src/components/settings/opencode-behavior-section.tsx:64 · src/components/settings/opencode-permissions-section.tsx:103 — the two spans are one implementation copied and then locally edited — 547 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. — src/components/settings/opencode-behavior-section.tsx:64
src/app/merge/page.tsx:6 · src/app/push/page.tsx:6 — the two spans are one implementation copied and then locally edited — 554 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. — src/app/merge/page.tsx:6
src/components/message/reply-artifacts.tsx:138 · src/components/message/reply-artifacts.tsx:246 — the two spans are one implementation copied and then locally edited — 445 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. — src/components/message/reply-artifacts.tsx:138
src/lib/desktop-notification-prefs.ts:85 · src/lib/notification-sound-prefs.ts:81 — the two spans are one implementation copied and then locally edited — 548 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. — src/lib/desktop-notification-prefs.ts:85
src/components/chat/chat-input.tsx:32 · src/components/chat/conversation-shell.tsx:82 — the two spans are one implementation copied and then locally edited — 490 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. — src/components/chat/chat-input.tsx:32
src/components/files/file-workspace-tab-bar.tsx:73 · src/components/tabs/tab-bar.tsx:279 — the two spans are one implementation copied and then locally edited — 509 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. — src/components/files/file-workspace-tab-bar.tsx:73
src/components/layout/aux-panel-git-changes-tab.tsx:292 · src/components/layout/aux-panel-git-log-tab.tsx:461 · src/components/layout/push-workspace.tsx:120 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — src/components/layout/aux-panel-git-changes-tab.tsx:292
src/components/ui/context-menu.tsx:26 · src/components/ui/dropdown-menu.tsx:39 — the two spans are one implementation copied and then locally edited — 337 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. — src/components/ui/context-menu.tsx:26
src/app/commit/page.tsx:3 · src/app/merge/page.tsx:3 — these 2 files are line-for-line copies of one another — 86 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/app/commit/page.tsx:3
src/components/layout/aux-panel-git-changes-tab.tsx:1877 · src/components/layout/aux-panel-git-changes-tab.tsx:1995 — 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. — src/components/layout/aux-panel-git-changes-tab.tsx:1877
src/components/settings/mcp-settings.tsx:1538 · src/components/settings/mcp-settings.tsx:1662 — the two spans are one implementation copied and then locally edited — 368 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. — src/components/settings/mcp-settings.tsx:1538
src/components/settings/command-code-config-panel.tsx:75 · src/components/settings/trae-config-panel.tsx:84 — 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. — src/components/settings/command-code-config-panel.tsx:75
src/components/layout/commit-dialog.tsx:118 · src/components/layout/unstash-dialog.tsx:79 — 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. — src/components/layout/commit-dialog.tsx:118
src/components/tasks/task-follow-up-dialog.tsx:63 · src/components/tasks/task-restart-dialog.tsx:57 — the two spans are one implementation copied and then locally edited — 366 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. — src/components/tasks/task-follow-up-dialog.tsx:63
REDACTED:26 · REDACTED:108 — the two spans are one implementation copied and then locally edited — 423 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. — REDACTED:26
src/components/chat/conversation-context-bar.tsx:117 · src/components/chat/conversation-context-bar.tsx:272 — the two spans are one implementation copied and then locally edited — 412 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. — src/components/chat/conversation-context-bar.tsx:117
src/components/settings/custom-agent-mcp-toggle.tsx:35 · src/components/settings/custom-agent-skills-toggle.tsx:36 — the two spans are one implementation copied and then locally edited — 330 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. — src/components/settings/custom-agent-mcp-toggle.tsx:35
src/components/settings/opencode-connect-dialog.tsx:118 · src/components/settings/opencode-connect-dialog.tsx:498 — the two spans are one implementation copied and then locally edited — 277 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. — src/components/settings/opencode-connect-dialog.tsx:118
src/contexts/workspace-context.tsx:1829 · src/contexts/workspace-context.tsx:2184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/contexts/workspace-context.tsx:1829
src/components/settings/general-settings.tsx:170 · src/components/settings/system-network-settings.tsx:281 — the two spans are one implementation copied and then locally edited — 257 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. — src/components/settings/general-settings.tsx:170
src/app/push/page.tsx:54 · src/app/stash/page.tsx:38 — 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. — src/app/push/page.tsx:54
src/components/canvas/canvas-conversation-surface.tsx:691 · src/components/conversations/conversation-detail-panel.tsx:1314 — the two spans are one implementation copied and then locally edited — 218 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. — src/components/canvas/canvas-conversation-surface.tsx:691
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.
AcpAgentSettings has cyclomatic complexity 275 and cognitive complexity 260; 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. — src/components/settings/acp-agent-settings.tsx:4973
connectionsReducer has cyclomatic complexity 269 and cognitive complexity 360; 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. — src/contexts/acp-connections-context.tsx:1982
reducer has cyclomatic complexity 162 and cognitive complexity 188; 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. — src/stores/conversation-runtime-store.ts:2363
(anonymous) has cyclomatic complexity 155 and cognitive complexity 196; 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. — src/contexts/acp-connections-context.tsx:5279
TaskDetailSheet has cyclomatic complexity 133 and cognitive complexity 154; 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. — src/components/tasks/task-detail-sheet.tsx:219
PiConfigPanel has cyclomatic complexity 107 and cognitive complexity 95; 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. — src/components/settings/pi-config-panel.tsx:306
buildStreamingTurnsFromLiveMessage has cyclomatic complexity 86 and cognitive complexity 204; 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. — src/stores/conversation-runtime-store.ts:1138
ConversationTabView has cyclomatic complexity 85 and cognitive complexity 72; 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. — src/components/conversations/conversation-detail-panel.tsx:271
FileWorkspacePanelBody has cyclomatic complexity 83 and cognitive complexity 90; 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. — src/components/files/file-workspace-panel.tsx:779
(anonymous) has cyclomatic complexity 78 and cognitive complexity 123; 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. — src/contexts/acp-connections-context.tsx:7316
adaptMessageTurn has cyclomatic complexity 73 and cognitive complexity 157; 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. — src/lib/adapters/ai-elements-adapter.ts:2452
StatusBarUpdate has cyclomatic complexity 72 and cognitive complexity 68; 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. — src/components/layout/status-bar-update.tsx:115
buildAgentDraft has cyclomatic complexity 71 and cognitive complexity 70; 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. — src/components/settings/acp-agent-settings.tsx:3907
GitChangesTab has cyclomatic complexity 70 and cognitive complexity 66; 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. — src/components/layout/aux-panel-git-changes-tab.tsx:505
ForgeIssueDetailSheet has cyclomatic complexity 69 and cognitive complexity 64; 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. — src/components/forge/forge-issue-detail-sheet.tsx:2506
TaskDeliverPrDialog has cyclomatic complexity 68 and cognitive complexity 63; 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. — src/components/tasks/task-deliver-pr-dialog.tsx:90
MessageInput has cyclomatic complexity 65 and cognitive complexity 55; 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. — REDACTED:332
(anonymous) has cyclomatic complexity 64 and cognitive complexity 95; 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. — REDACTED:201
ForgePage has cyclomatic complexity 63 and cognitive complexity 62; 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. — src/components/forge/forge-page.tsx:630
TokenUsagePage has cyclomatic complexity 62 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 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. — src/components/token-usage/token-usage-page.tsx:328
CursorConfigPanel has cyclomatic complexity 61 and cognitive complexity 58; 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. — src/components/settings/cursor-config-panel.tsx:333
SystemNetworkSettings has cyclomatic complexity 59 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 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. — src/components/settings/system-network-settings.tsx:108
AgentRow has cyclomatic complexity 59 and cognitive complexity 48; 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. — src/components/message/activity/rows/agent-row.tsx:47
pipelineStages has cyclomatic complexity 58 and cognitive complexity 88; 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. — src/lib/grep-no-match.ts:179
MessageListView has cyclomatic complexity 57 and cognitive complexity 56; 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. — src/components/message/message-list-view.tsx:1525
splitCommandLine has cyclomatic complexity 54 and cognitive complexity 104; 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. — src/lib/activity/exit-meaning.ts:78
SkillsSettings has cyclomatic complexity 54 and cognitive complexity 46; 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. — src/components/settings/skills-settings.tsx:166
actJson has cyclomatic complexity 53 and cognitive complexity 69; 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. — REDACTED:526
CodexModelListEditor has cyclomatic complexity 53 and cognitive complexity 46; 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. — src/components/settings/codex-model-list-editor.tsx:246
BackupSettings has cyclomatic complexity 53 and cognitive complexity 44; 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. — src/components/settings/backup-settings.tsx:118
deriveFlowGraph has cyclomatic complexity 51 and cognitive complexity 85; 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. — src/components/canvas/canvas-model.ts:891
inferFromInput has cyclomatic complexity 50 and cognitive complexity 41; 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. — REDACTED:409
codeModeCallSite has cyclomatic complexity 49 and cognitive complexity 88; 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. — src/lib/delegation-card.ts:429
McpSettings has cyclomatic complexity 47 and cognitive complexity 46; 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. — src/components/settings/mcp-settings.tsx:412
describeUncached has cyclomatic complexity 47 and cognitive complexity 42; 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. — src/lib/activity/describe-tool-call.ts:631
FileTreeTab has cyclomatic complexity 46 and cognitive complexity 43; 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. — src/components/layout/aux-panel-file-tree-tab.tsx:1136
toolStepKind has cyclomatic complexity 46 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 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. — src/lib/activity/describe-tool-call.ts:98
ConfigSyncSettings has cyclomatic complexity 45 and cognitive complexity 43; 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. — src/components/settings/config-sync-settings.tsx:140
ComposerContextUsage has cyclomatic complexity 45 and cognitive complexity 42; 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. — src/components/chat/composer-context-usage.tsx:34
DelegationStatusRow has cyclomatic complexity 45 and cognitive complexity 41; 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. — src/components/message/delegation-status-row.tsx:90
Do you agree with this assessment?
R3 · Large Files2.3 / 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.
src/components/settings/acp-agent-settings.tsx has 13289 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/settings/acp-agent-settings.tsx:1
src/contexts/acp-connections-context.tsx has 8293 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/contexts/acp-connections-context.tsx:1
src/lib/api.ts has 6194 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/lib/api.ts:1
src/lib/types.ts has 5908 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/lib/types.ts:1
src/stores/conversation-runtime-store.ts has 5177 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/stores/conversation-runtime-store.ts:1
src/contexts/workspace-context.tsx has 3646 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/contexts/workspace-context.tsx:1
src/components/conversations/sidebar-conversation-list.tsx has 3642 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/conversations/sidebar-conversation-list.tsx:1
src/stores/tab-store.ts has 3554 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/stores/tab-store.ts:1
src/components/layout/aux-panel-file-tree-tab.tsx has 3498 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/layout/aux-panel-file-tree-tab.tsx:1
src/components/forge/forge-issue-detail-sheet.tsx has 3214 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/forge/forge-issue-detail-sheet.tsx:1
src/components/conversations/conversation-detail-panel.tsx has 3168 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/conversations/conversation-detail-panel.tsx:1
src/components/forge/forge-page.tsx has 2876 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/forge/forge-page.tsx:1
src/lib/adapters/ai-elements-adapter.ts has 2737 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/lib/adapters/ai-elements-adapter.ts:1
REDACTED has 2702 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/components/layout/aux-panel-git-log-tab.tsx has 2652 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/layout/aux-panel-git-log-tab.tsx:1
src/components/message/message-list-view.tsx has 2379 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/message/message-list-view.tsx:1
src/components/canvas/canvas-view.tsx has 2321 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/canvas/canvas-view.tsx:1
REDACTED has 2266 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
src/components/layout/aux-panel-git-changes-tab.tsx has 2227 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/layout/aux-panel-git-changes-tab.tsx:1
src/components/tasks/task-detail-sheet.tsx has 2066 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/tasks/task-detail-sheet.tsx:1
src/components/files/file-workspace-panel.tsx has 1977 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/files/file-workspace-panel.tsx:1
src/components/settings/mcp-settings.tsx has 1787 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/settings/mcp-settings.tsx:1
src/components/conversations/sidebar-conversation-grouping.ts has 1672 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/conversations/sidebar-conversation-grouping.ts:1
src/lib/delegation-card.ts has 1640 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/lib/delegation-card.ts:1
src/components/settings/pi-config-panel.tsx has 1606 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/settings/pi-config-panel.tsx:1
src/components/token-usage/token-usage-page.tsx has 1535 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/token-usage/token-usage-page.tsx:1
src/app/activity-gallery/page.gallery.tsx has 1523 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/activity-gallery/page.gallery.tsx:1
src/app/workspace/layout.tsx has 1503 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/workspace/layout.tsx:1
browser-agent/src/act.ts has 1467 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browser-agent/src/act.ts:1
src/components/automations/automations-page.tsx has 1434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/automations/automations-page.tsx:1
src/components/chat/composer/use-composer-attachments.ts has 1402 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/chat/composer/use-composer-attachments.ts:1
src/components/layout/commit-dialog.tsx has 1380 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/layout/commit-dialog.tsx:1
src/browser-injected/picker.js has 1288 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/browser-injected/picker.js:1
src/components/settings/kimi-code-config-panel.tsx has 1282 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/settings/kimi-code-config-panel.tsx:1
src/components/settings/antigravity-config-panel.tsx has 1275 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/settings/antigravity-config-panel.tsx:1
src/components/settings/config-sync-settings.tsx has 1264 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/settings/config-sync-settings.tsx:1
src/components/settings/skills-settings.tsx has 1256 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/settings/skills-settings.tsx:1
src/components/message/conversation-message-nav.tsx has 1177 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/message/conversation-message-nav.tsx:1
src/lib/tauri.ts has 1170 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/lib/tauri.ts:1
src/components/conversations/conversation-manage-dialog.tsx has 1157 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/components/conversations/conversation-manage-dialog.tsx: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 Coverage9.0 / 10Exemplary✓ 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. (×40) — REDACTED:1, src/app/activity-gallery/page.gallery.tsx:1, src/browser-injected/picker.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 package.json 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: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.0 / 10Strong✓ 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.
Unreachable from the 111 application, 9 tooling and 846 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (111 application, 9 tooling, 846 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 (×6) — src/components/chat/experts-command-menu.tsx, src/hooks/use-branch-tree-expansion.ts, src/components/layout/new-folder-dropdown.tsx, …
no import path from any entry point (111 application, 9 tooling, 846 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/components/ui/folder-badge.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — src/lib/folder-badge.ts
Nothing imports this binding — it is safe to review for removal. (×32) — src/components/ai-elements/code-block.tsx:232, src/components/ai-elements/code-block.tsx:248, src/components/ai-elements/code-block.tsx:258, …
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 the root 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. — package.json:47
Every import is type-only — move it to devDependencies. — src/components/ai-elements/message.tsx: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.
src/components/chat/sub-agent-overlay.tsx → src/components/message/session-viewer-host.tsx → src/components/message/sub-agent-session-dialog.tsx → src/components/message/live-transcript-view.tsx → src/components/message/message-list-view.tsx → src/components/chat/sub-agent-overlay.tsx (one verified cycle inside a mutually-dependent group of 14 files) — src/components/chat/sub-agent-overlay.tsx:36
What to do
Break each cycle by extracting the shared piece into a module both sides can import.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (src-tauri/src/web/browser_bridge.rs:819)), 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.
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×3) — src-tauri/src/browser/egress.rs:955, src-tauri/src/browser/profile.rs:160, src-tauri/src/parsers/opencode_context_window.rs:190
Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options, X-DNS-Prefetch-Control, X-Frame-Options. Missing: Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−0.5 on this card.) The server: `axum::serve(` (src-tauri/src/web/browser_bridge.rs:819).
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 3 sites, not one: `src-tauri/src/browser/egress.rs:955` (`Sha1::new`), `src-tauri/src/browser/profile.rs:160` (`Sha1::new`), `src-tauri/src/parsers/opencode_context_window.rs:190` (`Sha1::digest`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Add Strict-Transport-Security beside the headers the Rust server already sets.
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.
The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it. — REDACTED:498
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted 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 a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. 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 `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.7 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`cap_json_to_budget` is public, takes a document from its caller (line 1419) and hands it to `cap_json_string_values`, which calls itself at line 1471 with a piece of the document (and at line 1476) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `cap_json_string_values` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src-tauri/src/parsers/grok.rs:1471
`extract_tool_call_paths` is public, takes a document from its caller (line 65) and hands it to `walk_input`, which calls itself at line 147 with a piece of the document (and at line 152) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `walk_input` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src-tauri/src/agent_turn_files/extract.rs:147
`json_value_size` is public and takes `value: &serde_json::Value` from its caller, and it calls itself at line 275 with a piece of the document (and at line 282) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `json_value_size` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src-tauri/src/acp/event_stream.rs:275
`cst_value` is public and takes `value: &Value` from its caller, and it calls itself at line 114 with a piece of the document (and at line 117) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `cst_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src-tauri/src/acp/opencode_config.rs:114
`element_text` is public, takes a document from its caller (line 99) and hands it to `walk`, which calls itself at line 115 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src-tauri/science/skills/paper-lookup/scripts/jats_to_text.py:115
`leafIds` is exported and takes `tree: LayoutNode` from its caller, and it calls itself at line 55 (`leafIds`) with a piece of `tree` — and nowhere in `leafIds` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `leafIds` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:55
`firstLeafId` is exported and takes `tree: LayoutNode` from its caller, and it calls itself at line 59 (`firstLeafId`) with a piece of `tree` — and nowhere in `firstLeafId` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `firstLeafId` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:59
`parentSplitOf` is exported and takes `tree: LayoutNode` from its caller, and it calls itself at line 72 (`parentSplitOf`) with a piece of `tree` — and nowhere in `parentSplitOf` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `parentSplitOf` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:72
`splitGroup` is exported, takes a document from its caller (line 129) and hands it to `collapse`, which calls itself at line 107 (`collapse`) with a piece of `node` — and nowhere in `collapse` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `collapse` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:107
`splitGroup` is exported, takes a document from its caller (line 129) and hands it to `walk`, which calls itself at line 165 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:165
`removeGroup` is exported, takes a document from its caller (line 178) and hands it to `prune`, which calls itself at line 184 (`prune`) with a piece of `node` — and nowhere in `prune` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `prune` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:184
`removeGroup` is exported, takes a document from its caller (line 178) and hands it to `prune`, which calls itself at line 215 (`prune`) with a piece of `node` — and nowhere in `prune` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `prune` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:215
`normalizeTree` is exported, takes a document from its caller (line 206) and hands it to `sameTree`, which calls itself at line 242 (`sameTree`) with a piece of `a` — and nowhere in `sameTree` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sameTree` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:242
`toggleOrientation` is exported, takes a document from its caller (line 249) and hands it to `flipWalk`, which calls itself at line 266 (`flipWalk`) with a piece of `node` — and nowhere in `flipWalk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `flipWalk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:266
`splitGroup` is exported, takes a document from its caller (line 129) and hands it to `walk`, which calls itself at line 313 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:313
`splitGroup` is exported, takes a document from its caller (line 129) and hands it to `walk`, which calls itself at line 387 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:387
`isLayoutNode` is exported and takes `value: unknown` from its caller, and it calls itself at line 421 (`isLayoutNode`) with a piece of `value` — and nowhere in `isLayoutNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `isLayoutNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/tab-group-layout.ts:421
`commandFromUnknownValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 121 (`commandFromUnknownValue`) with a piece of `value` (and at line 127) — and nowhere in `commandFromUnknownValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `commandFromUnknownValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/activity/command.ts:121
`countJsonNodes` is exported, takes a document from its caller (line 57) and hands it to `walk`, which calls itself at line 65 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/components/ai-elements/json-tree.tsx:65
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`txn` (line 1202) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 1303; the `return` on line 1238 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — src-tauri/src/db/service/conversation_service.rs:1202
`admitted` (line 1394) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — src-tauri/src/commands/computer.rs:1394
`admitted` (line 1531) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — src-tauri/src/commands/computer.rs:1531
`admitted` (line 1616) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — src-tauri/src/commands/computer.rs:1616
`decoded.into_raw()` (line 2012) gives up ownership in exchange for a raw handle — the value's `Drop` will no longer run — and nothing in the crate's code ever reclaims a `image` from a raw pointer (`image::from_raw`). The memory or descriptor stays allocated until the process ends, once per call. Pair the hand-out with its reclaim (a `free` function that rebuilds the owner with `from_raw` and drops it), or keep the owning value. — src-tauri/src/commands/windows.rs:2012
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
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 4/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.
`uploadAttachment` 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 })`. — src/lib/api.ts:4577
`workspaceFileFetch` 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 })`. — src/lib/api.ts:4717
`seedRelease` 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 })`. — public/sw.js:137
`fetchBootDocument` 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 })`. — public/sw.js:189
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.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`. In Rust, where a guard or permit releases when it is dropped, whether a release written BY HAND — `add_permits` after a forgotten permit, `force_unlock` after a leaked guard, a raw lock's `unlock` — matches the state the function's own acquisitions put the primitive in: not after a try or timed acquire whose failure does not leave, not from a cleanup set up before an acquire that can fail, not skipped by a `?`, `return`, `break` or `continue`, and not on top of a guard that still releases itself.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
`tracing::debug!` at line 1875 is called with an argument built by `initiator_text.chars().take(60).collect::<String>()` (line 1877), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls. — src-tauri/src/acp/background_watch.rs:1875
`tracing::debug!` at line 1881 is called with an argument built by `initiator_text.chars().take(60).collect::<String>()` (line 1883), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls. — src-tauri/src/acp/background_watch.rs:1881
What to do
In Rust, hand the logger the value and let it format only what it writes: `debug!("rows: {:?}", rows)` or a field, `debug!(rows = ?rows, "loaded")` — `format_args!` and `?`/`%` fields defer the formatting. When the line needs a computed view (a `collect`, a `join`, a `serde_json::to_string`), put it behind `if log_enabled!(Level::Debug)` (`if tracing::enabled!(Level::DEBUG)` for tracing), which asks the target's own filter. The macros put their arguments behind the global maximum level only, so a collect or serialisation in the argument runs whenever any target is at debug, and the logger then drops this line.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`CatalogMeta.pending_format` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/codex_catalog_commit/mod.rs:221
`CatalogCounts.listed` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/codex_endpoint_catalog.rs:520
`JsonRpcRequest.jsonrpc` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/delegation/companion.rs:108
`RegistryAgentItem.website` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/remote_registry.rs:34
`RegistryAgentItem.license` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/remote_registry.rs:38
`SessionInfo.found` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/session_info.rs:68
`SessionInfo.workspace_name` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/session_info.rs:88
`SessionInfo.is_delegation_child` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/session_info.rs:99
`SessionInfo.stats` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/session_info.rs:101
`AgentOptionsSnapshot.unapplied_config_ids` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/types.rs:1719
`CodexSandboxSettings.has_permissions_table` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/acp/types.rs:1914
`ListenerIdentity.workdir` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/browser/agent.rs:98
`GlobalArgs.no_color` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/cli/args.rs:248
`Launch.requested` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/cli_run/wire.rs:536
`Launch.effective` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/cli_run/wire.rs:538
`Launch.unconfirmed` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/cli_run/wire.rs:541
`DeviceCodeUserCodeResp.interval` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/acp.rs:15352
`DeviceCodeTokenResp.code_challenge` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/acp.rs:15392
`ApplyReport.appearance` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/config_sync/snapshot.rs:117
`ConfigSyncState.last_pulled_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/config_sync/webdav_sync.rs:260
`Manifest.codeg_version` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. (×2) — src-tauri/src/commands/experts.rs:173, src-tauri/src/commands/science.rs:138
`Manifest.installed_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. (×2) — src-tauri/src/commands/experts.rs:175, src-tauri/src/commands/science.rs:140
`ManifestEntry.installed_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. (×2) — src-tauri/src/commands/experts.rs:185, src-tauri/src/commands/science.rs:150
`OfficialIcon._mime_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/mcp.rs:5795
`OfficialIcon._sizes` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/mcp.rs:5797
`OfficialArgument._is_repeated` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/mcp.rs:5835
`SmitheryServerSummary._id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/mcp.rs:5971
`ScienceTomlEntry.featured` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/science.rs:197
`ScienceTomlEntry.accent` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/science.rs:199
`ScienceTomlEntry.needs_key` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/science.rs:201
`ScienceTomlEntry.needs_env` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commands/science.rs:203
`CommitMessageSettings.auto_commit` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/commit_message/mod.rs:61
`RawItem.comment_count` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Its value is copied into `comments`, and nothing reads that either. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — src-tauri/src/forge/cnb.rs:899
`RawIssue.comments` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. (×2) — src-tauri/src/forge/gitea.rs:1287, src-tauri/src/forge/github.rs:75
`RawPull.changed_files` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. (×2) — src-tauri/src/forge/gitea.rs:1444, src-tauri/src/forge/github.rs:612
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
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.
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 element7.7 / 10Strong✓ Tool-verified
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.
This loop runs once per element of `rows`, and the statement it guards acts on the element it is on — `row`. The test deciding whether that statement runs does not: `label === null` reads `rows[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 192, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — src/lib/json-render/chart-data.ts:195
What to do
Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`error!` at line 540 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:540
`error!` at line 570 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:570
`debug!` at line 577 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:577
`debug!` at line 772 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:772
`debug!` at line 938 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:938
`debug!` at line 955 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:955
`debug!` at line 974 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:974
`debug!` at line 1170 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:1170
`debug!` at line 1220 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/acp_transcript.rs:1220
`warn!` at line 185 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/app_menu.rs:185
`warn!` at line 266 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/deep_link.rs:266
`warn!` at line 292 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/deep_link.rs:292
`info!` at line 297 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/deep_link.rs:297
`warn!` at line 300 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/deep_link.rs:300
`info!` at line 336 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/deep_link.rs:336
`warn!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/deep_link.rs:337
`error!` at line 167 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:167
`error!` at line 181 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:181
`info!` at line 542 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:542
`warn!` at line 552 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:552
`info!` at line 559 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:559
`error!` at line 576 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:576
`info!` at line 584 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:584
`info!` at line 589 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:589
`info!` at line 622 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:622
`error!` at line 630 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/git_credential.rs:630
`warn!` at line 105 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/keyring_store.rs:105
`warn!` at line 296 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:296
`error!` at line 604 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:604
`warn!` at line 794 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:794
`warn!` at line 814 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:814
`warn!` at line 839 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:839
`warn!` at line 876 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:876
`error!` at line 913 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:913
`error!` at line 941 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:941
`info!` at line 947 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:947
`error!` at line 962 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:962
`info!` at line 968 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:968
`info!` at line 991 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:991
`error!` at line 996 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src-tauri/src/lib.rs:996
Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
`open.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `compact_batch` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/acp_transcript.rs:702
`std::fs::metadata(path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `mode_bits` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/keyring_store.rs:358
`builder.plugin(tauri_plugin_window_state::Builder::new().with_state_flags(tauri_plugin_window_state::StateFlags::all()&!tauri_plugin_window_state::StateFlags::DECORATIONS,).with_denylist(&[crate::computer::indicator::INDICATOR_LABEL,crate::computer::marker::MARKER_LABEL,]).build(),).plugin(tauri_plugin_deep_link::init()).plugin(tauri_plugin_opener::init()).plugin(tauri_plugin_dialog::init()).plugin(tauri_plugin_updater::Builder::new().build()).plugin(tauri_plugin_process::init()).plugin(tauri_plugin_notification::init()).plugin(tauri_plugin_global_shortcut::Builder::new().build()).plugin(tauri_plugin_autostart::init(tauri_plugin_autostart::MacosLauncher::LaunchAgent,None,)).manage(ConnectionManager::new()).manage(crate::browser::BrowserRegistry::default()).manage(crate::browser::egress::EgressRegistry::default()).manage(crate::browser::BrowserDownloads::default()).manage(crate::browser::DocGuests::default()).manage(crate::browser::confirm::EvalConsent::new()).manage(crate::browser::open_request::OpenRequests::new()).manage(crate::browser::policy::BrowserPolicy::load()).manage(TerminalManager::new()).manage(ChatChannelManager::new()).manage(windows::SettingsWindowState::new()).manage(windows::CommitWindowState::new()).manage(windows::MergeWindowState::new()).manage(windows::AuxWindowState::new()).manage(workspace_windows::WorkspaceWindowSession::new()).manage(web::WebServerState::new()).manage(std::sync::Arc::new(crate::commands::remote_proxy::RemoteProxyState::new(),)).manage(std::sync::Arc::new(crate::workspace_transfer::WorkspaceTransferManager::new_from_env(),)).manage(std::sync::Arc::new(web::event_bridge::WebEventBroadcaster::new(),)).manage({let metrics=std::sync::Arc::new(crate::acp::EventBusMetrics::default());std::sync::Arc::new(crate::acp::InternalEventBus::new(metrics))}).manage(crate::pet_state_mapper::new_pet_state_handle()).manage(crate::update::new_update_state_handle()).setup(|app|{let app_data_dir=app.path().app_data_dir()?;let effective_data_dir=paths::resolve_effective_data_dir(&app_data_dir);let derived_data_dir=paths::desktop_data_dir(None,dirs::data_dir().as_deref(),&app.config().identifier,);if derived_data_dir.as_deref()!=Some(git_credential::absolutize(&app_data_dir).as_path()){tracing::warn!("[paths][WARN] the data directory derived at startup ({:?}) differs from Tauri's app_data_dir ({}); the database follows {}",derived_data_dir,app_data_dir.display(),effective_data_dir.display());}if let Some(home)=std::env::var_os("CODEG_HOME").filter(|s|!s.is_empty()){let home_path=git_credential::absolutize(std::path::Path::new(&home));if home_path!=effective_data_dir{tracing::warn!("[paths][WARN] CODEG_HOME ({}) and CODEG_DATA_DIR ({}) point at different roots. \
Uploads/pets follow CODEG_HOME; the database follows CODEG_DATA_DIR. \
Unset one or align them to avoid split state.",home_path.display(),effective_data_dir.display());}}let refused=match crate::runtime_lock::try_shared(&effective_data_dir){Ok(Some(lock))=>{app.manage(HeldRuntimeLock(lock));None}Ok(None)=>Some(format!("{} is in use by a `codeg-cli --standalone` server. Open Codeg again \
once that command has finished.",effective_data_dir.display())),Err(e)if crate::runtime_lock::locking_unsupported(&e)=>{tracing::warn!("[startup] {} cannot lock files ({e}); going on without, so a \
`codeg-cli --standalone` there would not see this window",effective_data_dir.display());None}Err(e)=>Some(format!("Codeg cannot lock its data directory {}: {e}",effective_data_dir.display())),};if let Some(message)=refused{use tauri_plugin_dialog::{DialogExt,MessageDialogKind};let handle=app.handle().clone();app.dialog().message(message).title("Codeg").kind(MessageDialogKind::Error).show(move|_|handle.exit(1));return Ok(());}let app_version=env!("CARGO_PKG_VERSION");let database=tauri::async_runtime::block_on(db::init_database(&effective_data_dir,app_version,)).map_err(|e|e.to_string())?;app.manage(database);if let Some(layout)=crate::cli_run::shim::layout(){std::thread::spawn(move||{if let Err(e)=layout.write(){tracing::warn!("[cli] this app's own codeg-cli: {e}");}});}let db=app.state::<db::AppDatabase>();tauri::async_runtime::block_on(network::proxy::init_proxy_from_db(&db.conn));tauri::async_runtime::block_on(crate::logging::init::apply_persisted_level(&db.conn,));if let Some(hub)=crate::logging::hub::log_hub(){hub.set_emitter(crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone(),));}tauri::async_runtime::block_on(windows::load_saved_zoom(&db.conn));tauri::async_runtime::block_on(windows::load_saved_appearance_mode(&db.conn));let tray_locale=tauri::async_runtime::block_on(crate::commands::system_settings::load_system_language_settings(&db.conn),).map(|settings|settings.language).unwrap_or_default();if let Err(err)=windows::install_tray_icon(app.handle(),tray_locale){tracing::error!("[Tray] failed to install tray icon: {err}");}std::thread::spawn(||{let _=std::panic::catch_unwind(||{crate::acp::binary_cache::migrate_legacy_root();crate::sweep_acp_binary_trash();crate::sweep_acp_scratch_dirs();});});tauri::async_runtime::spawn(crate::scratch_sweep_task());tauri::async_runtime::spawn(async move{let report=crate::commands::experts::ensure_central_experts_installed().await;if!report.errors.is_empty(){tracing::error!("[Experts] install finished with {} error(s): {:?}",report.errors.len(),report.errors);}else{tracing::info!("[Experts] install ok: installed={} updated={} pending_review={}",report.installed_count,report.updated_count,report.pending_user_review.len());}});tauri::async_runtime::spawn(async move{let report=crate::commands::science::ensure_central_science_installed().await;if!report.errors.is_empty(){tracing::error!("[Science] install finished with {} error(s): {:?}",report.errors.len(),report.errors);}else{tracing::info!("[Science] install ok: installed={} updated={} pending_review={}",report.installed_count,report.updated_count,report.pending_user_review.len());}});{let gc_conn=app.state::<db::AppDatabase>().conn.clone();let gc_data_dir=effective_data_dir.clone();tauri::async_runtime::spawn(async move{match crate::commands::conversations::gc_orphan_chat_dirs_core(&gc_conn,&gc_data_dir,).await{Ok(n)if n>0=>tracing::info!("[conversations] chat-dir GC: reclaimed {n} orphan scratch dir(s)"),Ok(_)=>{}Err(err)=>{tracing::error!("[conversations] chat-dir GC failed: {err}")}}});}{let db_for_shell=app.state::<db::AppDatabase>().conn.clone();let shell_config=app.state::<ConnectionManager>().terminal_shell_config();tauri::async_runtime::block_on(async move{crate::commands::system_settings::apply_persisted_terminal_settings(&db_for_shell,&shell_config,).await;});}{let db_for_close=app.state::<db::AppDatabase>().conn.clone();tauri::async_runtime::block_on(async move{crate::commands::system_settings::apply_persisted_close_behavior(&db_for_close,).await;});}{let db_for_sync=app.state::<db::AppDatabase>().conn.clone();let emitter=std::sync::Arc::new(web::event_bridge::EventEmitter::Tauri(app.handle().clone(),));tauri::async_runtime::spawn(async move{crate::commands::config_sync::auto_sync::run_auto_sync_loop(db_for_sync,emitter,env!("CARGO_PKG_VERSION").to_string(),).await;});}if let Some(scheduler)=crate::acp::codex_catalog_refresh::build(web::event_bridge::EventEmitter::Tauri(app.handle().clone()),){tauri::async_runtime::spawn(crate::acp::codex_catalog_refresh::run(scheduler));}{let db=db::AppDatabase{conn:app.state::<db::AppDatabase>().conn.clone(),};let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());tauri::async_runtime::spawn(async move{let n=crate::commands::folders::backfill_worktree_folder_aliases(&emitter,&db).await;if n>0{tracing::info!("[folders] labeled {n} worktree folder(s) by branch");}});}{let cm=app.state::<ConnectionManager>();let ccm=app.state::<ChatChannelManager>();cm.install_chat_channel(ccm.clone_ref());}{let ccm=app.state::<ChatChannelManager>();let broadcaster=app.state::<std::sync::Arc<web::event_bridge::WebEventBroadcaster>>();let db_conn=app.state::<db::AppDatabase>().conn.clone();let data_dir=effective_data_dir.clone();let ccm_ref=ccm.clone_ref();let br=broadcaster.inner().clone();let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();let cm=app.state::<ConnectionManager>().clone_ref();let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());tauri::async_runtime::spawn(async move{ccm_ref.start_background(br,bus,db_conn,data_dir,cm,emitter).await;});}{let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();let broadcaster=app.state::<std::sync::Arc<web::event_bridge::WebEventBroadcaster>>().inner().clone();let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());let pet_state_handle=app.state::<crate::pet_state_mapper::PetStateHandle>().inner().clone();tauri::async_runtime::spawn(crate::pet_state_mapper::pet_state_subscriber_task(bus,broadcaster,emitter,pet_state_handle,),);}{let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();let broadcaster=app.state::<std::sync::Arc<web::event_bridge::WebEventBroadcaster>>().inner().clone();let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());let manager=app.state::<ConnectionManager>().inner().clone_ref();let db_conn=app.state::<db::AppDatabase>().conn.clone();tauri::async_runtime::spawn(crate::pet_sessions::pet_sessions_subscriber_task(bus,broadcaster,emitter,manager,db_conn,),);}let broker_for_lifecycle={let cm_state=app.state::<ConnectionManager>();let db_conn=app.state::<db::AppDatabase>().conn.clone();let(broker,tokens,socket_path,feedback_config,question_config,session_info_config,chat_authoring_config,browser_tools_config,computer_tools_config,)=crate::app_state::build_delegation_stack(&cm_state,db_conn.clone(),effective_data_dir.clone(),);app.manage(broker.clone());app.manage(tokens.clone());app.manage(feedback_config.clone());app.manage(question_config.clone());app.manage(session_info_config.clone());app.manage(chat_authoring_config.clone());app.manage(browser_tools_config.clone());computer_tools_config.mark_served();app.manage(computer_tools_config.clone());app.manage(crate::commands::delegation::DelegationSocketPath(socket_path.clone(),));let broker_for_init=broker.clone();let db_for_init=db_conn.clone();let feedback_for_init=feedback_config.clone();let question_for_init=question_config.clone();let session_info_for_init=session_info_config.clone();let chat_authoring_for_init=chat_authoring_config.clone();let browser_tools_for_init=browser_tools_config.clone();let computer_tools_for_init=computer_tools_config.clone();tauri::async_runtime::block_on(async move{delegation_commands::apply_persisted_config(&db_for_init,&broker_for_init,).await;crate::commands::feedback::apply_persisted_feedback_config(&db_for_init,&feedback_for_init,).await;crate::commands::question::apply_persisted_question_config(&db_for_init,&question_for_init,).await;crate::commands::session_info::apply_persisted_session_info_config(&db_for_init,&session_info_for_init,).await;crate::commands::chat_authoring::apply_persisted_chat_authoring_config(&db_for_init,&chat_authoring_for_init,).await;crate::commands::browser_tools::apply_persisted_browser_tools_config(&db_for_init,&browser_tools_for_init,).await;crate::commands::computer_tools::apply_persisted_computer_tools_config(&db_for_init,&computer_tools_for_init,).await;crate::commands::generative_ui::install_generative_ui_skill(&db_for_init,).await;});let computer_service=crate::commands::computer::ComputerService::start(crate::commands::computer::ComputerHost::Desktop(app.handle().clone()),computer_tools_config.clone(),);app.manage(computer_service.clone());let listener_broker=broker.clone();let listener=crate::acp::delegation::listener::DelegationListener::new(listener_broker,tokens,std::sync::Arc::new(crate::acp::manager::ConnectionManagerParentLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),std::sync::Arc::new(crate::acp::manager::ConnectionManagerFeedbackLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),std::sync::Arc::new(crate::acp::manager::ConnectionManagerQuestionLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),std::sync::Arc::new(crate::commands::session_info::DbSessionInfoLookup::new(std::sync::Arc::new(db::AppDatabase{conn:db_conn.clone(),}),),),std::sync::Arc::new(crate::work_task::EngineWorkTaskTools),std::sync::Arc::new(crate::commands::chat_authoring::DbChatAuthoring::new(std::sync::Arc::new(db::AppDatabase{conn:db_conn.clone(),}),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone(),),chat_authoring_config.clone(),),),std::sync::Arc::new(crate::commands::browser::McpBrowserTools::new(app.handle().clone(),browser_tools_config.clone(),),),std::sync::Arc::new(crate::commands::computer::McpComputerTools::new(computer_service,)),std::sync::Arc::new(crate::acp::result_tool::ConnectionManagerResultLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),);let service=crate::acp::delegation::service::DelegationService::new(listener,socket_path,);crate::acp::delegation::service::install(service.clone());tauri::async_runtime::spawn(async move{if let Err(e)=service.start().await{tracing::error!("[delegation] listener failed to start: {e}");}});broker};{let db_conn=app.state::<db::AppDatabase>().conn.clone();let cm=app.state::<ConnectionManager>().clone_ref();let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();tauri::async_runtime::spawn(crate::acp::lifecycle_subscriber_task(db_conn,cm,bus,Some(broker_for_lifecycle),));}{let service=crate::cli_run::CliRunService::new(&app.state::<db::AppDatabase>(),&app.state::<ConnectionManager>(),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone(),effective_data_dir.clone(),crate::cli_run::wire::RuntimeKind::Desktop,);service.set_opener(std::sync::Arc::new(DesktopSessionOpener(app.handle().clone(),)));let access=crate::cli_run::CliAccess::new(service.clone(),effective_data_dir.clone());app.manage(service.clone());app.manage(access.clone());let db_conn=app.state::<db::AppDatabase>().conn.clone();tauri::async_runtime::spawn(async move{service.spawn_background();access.start_if_enabled(&db_conn).await;});}match tauri::async_runtime::block_on(web::load_web_service_config(&db.conn)){Ok(config)if config.auto_start=>{let port=config.port.unwrap_or(web::DEFAULT_WEB_SERVICE_PORT);let ws=app.state::<web::WebServerState>();if let Err(err)=tauri::async_runtime::block_on(web::do_start_web_server_tauri(app.handle().clone(),&ws,config.port,None,config.token,)){tracing::error!("[WEB] auto-start failed: {err}");notify_web_auto_start_failed(app.handle(),port,&err);}}Ok(_)=>{}Err(err)=>tracing::error!("[WEB] failed to load auto-start config: {err}"),}if let Some(idle_timeout)=crate::acp::idle_timeout_from_env(){let cm=app.state::<ConnectionManager>().clone_ref();tauri::async_runtime::spawn(crate::acp::idle_sweep_task(cm,idle_timeout,std::time::Duration::from_secs(crate::acp::SWEEP_INTERVAL_SECS),));}if let Some(idle_timeout)=crate::office_watch::idle_timeout_from_env(){tauri::async_runtime::spawn(crate::office_watch::office_watch_idle_sweep_task(idle_timeout,std::time::Duration::from_secs(crate::office_watch::SWEEP_INTERVAL_SECS),));}if let Some(engine)=crate::automation::build_engine(crate::db::AppDatabase{conn:app.state::<crate::db::AppDatabase>().conn.clone(),},app.state::<ConnectionManager>().clone_ref(),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone(),effective_data_dir.clone(),){tauri::async_runtime::spawn(crate::automation::run_automation_engine(engine));}if let Some(engine)=crate::work_task::build_task_engine(crate::db::AppDatabase{conn:app.state::<crate::db::AppDatabase>().conn.clone(),},app.state::<ConnectionManager>().clone_ref(),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone(),effective_data_dir.clone(),){tauri::async_runtime::spawn(crate::work_task::run_task_engine(engine));if let Some(processor)=crate::forge::auto::build(crate::db::AppDatabase{conn:app.state::<crate::db::AppDatabase>().conn.clone(),},crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),){tauri::async_runtime::spawn(crate::forge::auto::run(processor));}}{use tauri_plugin_deep_link::DeepLinkExt;let handle=app.handle().clone();let _=app.deep_link().on_open_url(move|event|{let urls:Vec<String>=event.urls().iter().map(|url|url.to_string()).collect();crate::deep_link::handle_raw_urls(&handle,&urls);});#[cfg(all(not(debug_assertions),any(windows,target_os="linux")))]if let Err(e)=app.deep_link().register_all(){tracing::warn!("[deep-link] scheme registration failed: {e}");}}let startup_urls:Vec<String>={use tauri_plugin_deep_link::DeepLinkExt;app.deep_link().get_current().ok().flatten().unwrap_or_default().into_iter().map(|url|url.to_string()).collect()};let workspace_path=tauri::async_runtime::block_on(crate::deep_link::startup_workspace_path(&db::AppDatabase{conn:app.state::<db::AppDatabase>().conn.clone(),},&startup_urls,),);#[cfg(target_os="macos")]crate::browser::shim::macos::prefer_detached_inspector();let restore=tauri::async_runtime::block_on(workspace_windows::load_restore(&db.conn,startup_urls.iter().any(|url|crate::deep_link::parse_deep_link(url).is_some()),windows::can_hide_to_tray(),));if app.get_webview_window("main").is_none(){let url=tauri::WebviewUrl::App(workspace_path.into());let builder=tauri::WebviewWindowBuilder::new(app,"main",url).title("Codeg").inner_size(1260.0,860.0).min_inner_size(400.0,600.0).visible(restore.show_local());let builder=windows::apply_platform_window_style(builder);#[cfg(target_os="macos")]let builder=builder.traffic_light_position(windows::workspace_window_traffic_light_position(),);if let Ok(w)=builder.build(){windows::post_window_setup(&w);if!restore.show_local()&&w.is_visible().unwrap_or(false){let _=w.hide();}}}workspace_windows::begin_restore(app.handle(),restore);#[cfg(all(feature="browser-child",any(target_os="macos",target_os="windows",target_os="linux")))]crate::browser::surface_child::init_main_thread();crate::browser::surface_window::init_main_thread();#[cfg(feature="browser-smoke")]crate::browser::smoke::spawn_if_enabled(app.handle().clone());Ok(())}).on_menu_event(|app,event|{let id=event.id().as_ref().to_string();#[cfg(target_os="macos")]if crate::app_menu::handle_event(app,&id){return;}if id.starts_with(windows::TRAY_MENU_ID_PREFIX){match id.as_str(){windows::TRAY_MENU_ID_SHOW=>windows::show_main_window(app),windows::TRAY_MENU_ID_QUIT=>app.exit(0),_=>{}}return;}if!id.starts_with(windows::PET_MENU_ID_PREFIX){return;}let payload:serde_json::Value=if let Some(scale)=windows::pet_menu_scale_from_id(&id){serde_json::json!({"type":"scale","value":scale})}else if id==windows::PET_MENU_ID_OPEN_MANAGER{serde_json::json!({"type":"open_manager"})}else if id==windows::PET_MENU_ID_CLOSE{serde_json::json!({"type":"close"})}else{return;};use tauri::Emitter;let _=app.emit_to("pet","pet://menu-action",payload);}).on_window_event(|window,event|{let label=window.label().to_string();workspace_windows::on_window_event(window,event);if matches!(event,tauri::WindowEvent::Destroyed){browser_commands::close_all_for_owner(window.app_handle(),&label);}if(label=="settings"||label.starts_with("remote-settings-"))&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::SettingsWindowState>(){windows::restore_windows_after_settings(app,&state,&label);}}if(label.starts_with("commit-")||label.starts_with("remote-commit-"))&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::CommitWindowState>(){windows::restore_window_after_commit(app,&state,&label);}}if(label.starts_with("merge-")||label.starts_with("remote-merge-"))&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::MergeWindowState>(){windows::restore_window_after_merge(app,&state,&label);}if label.starts_with("merge-"){let app_clone=window.app_handle().clone();let label_clone=label.clone();tauri::async_runtime::spawn(async move{windows::cleanup_dangling_merge(&app_clone,&label_clone).await;});}}if matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::AuxWindowState>(){windows::restore_window_after_aux(app,&state,&label);}}if label=="pet"&&!APP_QUITTING.load(Ordering::Relaxed)&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){if let Some(db)=window.app_handle().try_state::<db::AppDatabase>(){let conn=db.conn.clone();tauri::async_runtime::spawn(async move{persist_pet_closed(&conn).await});}}if label==windows::PET_PANEL_LABEL&&matches!(event,tauri::WindowEvent::Focused(false)){windows::close_pet_panel_on_blur(window.app_handle());}if label=="main"{if let tauri::WindowEvent::CloseRequested{api,..}=event{if!APP_QUITTING.load(Ordering::Relaxed){api.prevent_close();handle_main_close_request(window,&label);return;}let app=window.app_handle();if let Some(cm)=app.try_state::<ConnectionManager>(){let disconnected=tauri::async_runtime::block_on(cm.disconnect_by_owner_window(&label),);tracing::info!("[ACP] main window closing disconnected_connections={}",disconnected);}if let Some(tm)=app.try_state::<TerminalManager>(){let killed=tm.kill_by_owner_window(&label);tracing::info!("[TERM] main window closing killed_terminals={}",killed);}}}}).invoke_handler(tauri::generate_handler![browser_commands::browser_capabilities,browser_commands::browser_open_tab,browser_commands::browser_close,browser_commands::browser_set_bounds,browser_commands::browser_set_window_viewport,browser_commands::browser_set_visible,browser_commands::browser_freeze_frame,browser_commands::browser_navigate,browser_commands::browser_reload,browser_commands::browser_go_back,browser_commands::browser_go_forward,browser_commands::browser_stop,browser_commands::browser_open_devtools,browser_commands::browser_get_state,browser_commands::browser_list_tabs,browser_commands::browser_list_services,browser_commands::browser_clear_data,browser_commands::browser_find,browser_commands::browser_list_downloads,browser_commands::browser_reveal_download,browser_commands::browser_clear_downloads,browser_commands::browser_set_host_rules,browser_commands::browser_set_sign_in_user_agent,browser_commands::browser_set_blank_page_theme,browser_commands::browser_remove_profile,browser_commands::browser_doc_open,browser_commands::browser_doc_set_mode,browser_commands::browser_doc_state,browser_commands::browser_agent_grant,browser_commands::browser_agent_snapshot,browser_commands::browser_agent_act,browser_commands::browser_agent_console,browser_commands::browser_agent_capture,browser_commands::browser_agent_eval,browser_commands::browser_eval_decide,browser_commands::browser_answer_open_request,browser_commands::browser_pick_element,browser_commands::browser_pick_cancel,browser_commands::browser_page_capture,browser_commands::browser_page_console,conversations::list_conversations,conversations::get_conversation,conversations::list_all_conversations,conversations::list_child_conversations,conversations::list_opened_tabs,conversations::save_opened_tabs,conversations::import_local_conversations,conversations::scan_importable_sessions,conversations::import_selected_sessions,conversations::get_folder_conversation,conversations::get_folder_conversation_turns,conversations::get_folder_conversation_outline,conversations::list_folders,conversations::get_stats,conversations::get_sidebar_data,conversations::create_conversation,conversations::create_chat_conversation,conversations::create_chat_dir,conversations::update_conversation_status,conversations::update_conversation_title,conversations::update_conversation_pinned,assistant_commands::assistant_list,assistant_commands::assistant_create,assistant_commands::assistant_update,assistant_commands::assistant_delete,assistant_commands::assistant_reorder,conversation_tags::list_conversation_tags,conversation_tags::create_conversation_tag,conversation_tags::update_conversation_tag,conversation_tags::delete_conversation_tag,conversation_tags::reorder_conversation_tags,conversation_tags::update_conversation_tags,conversation_tags::get_conversation_branch_tag,conversation_tags::update_conversation_branch_tag,conversations::delete_conversation,conversations::move_conversations,folders::load_folder_history,folders::get_folder,folders::list_open_folder_details,folders::list_all_folder_details,folders::open_folder,folders::open_worktree_folder,folders::resolve_worktree_folder,folders::open_folder_in_workspace,folders::open_folder_by_id,open_in::open_in_code,folders::remove_folder_from_workspace,folders::list_folder_groups,folders::create_folder_group,folders::update_folder_group,folders::delete_folder_group,folders::apply_sidebar_layout,folders::set_folder_group,folders::update_folder_color,folders::update_folder_alias,folders::update_folder_default_agent,folder_links::list_folder_links,folder_links::preview_folder_links,folder_links::create_folder_links,folder_links::rename_folder_link,folder_links::repair_folder_link,folder_links::remove_folder_link,canvas_commands::canvas_list_boards,canvas_commands::canvas_create_board,canvas_commands::canvas_update_board,canvas_commands::canvas_delete_board,canvas_commands::canvas_list_nodes,canvas_commands::canvas_create_node,canvas_commands::canvas_group_into_region,canvas_commands::canvas_update_node,canvas_commands::canvas_move_nodes,canvas_commands::canvas_detach_member,canvas_commands::canvas_delete_node,canvas_commands::canvas_delete_nodes,folders::add_folder_to_history,folders::remove_folder_from_history,folders::create_folder_directory,folders::clone_repository,folders::get_git_branch,folders::get_git_head,folders::git_init,folders::git_pull,folders::git_start_pull_merge,folders::git_has_merge_head,folders::git_fetch,folders::git_update_branch,folders::git_push_info,folders::git_push,folders::git_new_branch,folders::git_worktree_add,folders::git_checkout,folders::git_reset,folders::git_list_branches,folders::git_stash_push,folders::git_stash_pop,folders::git_stash_list,folders::git_stash_apply,folders::git_stash_drop,folders::git_stash_clear,folders::git_stash_show,folders::git_status,folders::git_is_tracked,folders::git_diff,folders::git_diff_with_branch,folders::git_show_diff,folders::git_show_file,folders::git_show_file_base64,folders::git_commit,commit_message_commands::git_generate_commit_message,commit_message_commands::git_generate_commit_message_cancel,commit_message_commands::get_commit_message_settings,commit_message_commands::set_commit_message_settings,commit_message_commands::delete_commit_message_settings,folders::git_rollback_file,folders::git_add_files,folders::git_list_all_branches,folders::git_list_remotes,folders::git_fetch_remote,folders::git_add_remote,folders::git_remove_remote,folders::git_set_remote_url,folders::git_merge,folders::git_rebase,folders::git_delete_branch,folders::git_remove_worktree,folders::git_delete_remote_branch,folders::git_list_conflicts,folders::git_conflict_file_versions,folders::git_resolve_conflict,folders::git_abort_operation,folders::git_continue_operation,workspace_state_commands::start_workspace_state_stream,workspace_state_commands::stop_workspace_state_stream,workspace_state_commands::get_workspace_snapshot,folders::get_home_directory,folders::list_directory_entries,crate::commands::create_directory::create_directory,folders::list_directory_with_files,folders::get_file_tree,folders::list_workspace_files,crate::commands::workspace_file_search::search_workspace_files,crate::commands::workspace_file_search::cancel_workspace_file_search,crate::commands::workspace_file_search::prepare_workspace_file_search,folders::read_file_base64,folders::read_workspace_file_base64,folders::read_file_preview,folders::read_file_for_edit,folders::save_file_content,folders::save_file_copy,folders::rename_file_tree_entry,folders::move_file_tree_entry,folders::delete_file_tree_entry,folders::create_file_tree_entry,folders::git_log,folders::git_current_user,folders::git_commit_files,folders::git_search_authors,folders::git_commit_branches,windows::open_folder_window,windows::open_commit_window,windows::open_settings_window,windows::open_merge_window,windows::open_stash_window,windows::open_push_window,windows::open_project_boot_window,windows::open_import_sessions_window,windows::open_local_workspace,remote_workspace_commands::list_remote_workspace_connections,remote_workspace_commands::create_remote_workspace_connection,remote_workspace_commands::update_remote_workspace_connection,remote_workspace_commands::delete_remote_workspace_connection,remote_workspace_commands::test_remote_workspace_connection,remote_workspace_commands::get_remote_workspace_connection,remote_workspace_commands::reorder_remote_workspace_connections,remote_workspace_commands::open_remote_workspace,workspace_windows::take_workspace_restore_failures,remote_proxy_commands::remote_http_call,remote_proxy_commands::remote_cache_forge_image,remote_proxy_commands::remote_upload_attachment,remote_proxy_commands::remote_upload_workspace_paths,remote_proxy_commands::remote_cancel_workspace_transfer,remote_proxy_commands::remote_download_workspace_file,remote_proxy_commands::remote_download_workspace_dir,remote_proxy_commands::read_local_file_for_upload,remote_proxy_commands::remote_ws_subscribe,remote_proxy_commands::remote_ws_unsubscribe,remote_proxy_commands::remote_ws_send_text,windows::open_pet_window,windows::close_pet_window,windows::pet_window_record_position,windows::pet_show_context_menu,windows::toggle_pet_panel,windows::close_pet_panel,windows::resize_pet_panel,windows::focus_conversation,crate::deep_link::take_pending_deep_link,windows::update_traffic_light_position,windows::update_appearance_mode,windows::set_tray_locale,pet_commands::pet_list,pet_commands::pet_get,pet_commands::pet_read_spritesheet,pet_commands::pet_add,pet_commands::pet_update_meta,pet_commands::pet_replace_sprite,pet_commands::pet_delete,pet_commands::pet_list_importable_codex,pet_commands::pet_import_codex,pet_commands::pet_codex_import_available,pet_commands::pet_get_settings,pet_commands::pet_set_active,pet_commands::pet_save_window_state,pet_commands::pet_marketplace_list,pet_commands::pet_marketplace_install,pet_commands::pet_marketplace_asset,pet_commands::pet_celebrate,pet_commands::pet_get_current_state,pet_commands::pet_list_active_sessions,background_commands::background_read,background_commands::background_set,background_commands::background_clear,background_commands::background_market_search,background_commands::background_market_asset,background_commands::background_market_download,app_update_commands::app_update_state,app_update_commands::perform_app_update,app_update_commands::restart_app,project_boot::detect_package_manager,project_boot::create_shadcn_project,project_boot::detect_hyperframes_skills,project_boot::install_hyperframes_skills,project_boot::create_hyperframes_project,system_settings::get_system_proxy_settings,system_settings::update_system_proxy_settings,system_settings::get_system_language_settings,system_settings::update_system_language_settings,system_settings::get_system_terminal_settings,system_settings::update_system_terminal_settings,system_settings::get_available_terminal_shells,system_settings::probe_terminal_shell_path,system_settings::get_system_rendering_settings,system_settings::update_system_rendering_settings,system_settings::get_system_autostart_settings,system_settings::update_system_autostart_settings,system_settings::get_system_close_behavior_settings,system_settings::update_system_close_behavior_settings,system_settings::resolve_close_request,logging_commands::get_log_settings,logging_commands::set_log_settings,logging_commands::get_recent_logs,logging_commands::list_log_files,logging_commands::open_logs_dir,delegation_commands::get_delegation_settings,delegation_commands::set_delegation_settings,crate::commands::mcp_service::get_codeg_mcp_service_status,crate::commands::mcp_service::start_codeg_mcp_service,crate::commands::mcp_service::set_codeg_mcp_tool_group,feedback_commands::get_feedback_settings,feedback_commands::set_feedback_settings,feedback_commands::submit_session_feedback,question_commands::get_question_settings,question_commands::set_question_settings,session_info_commands::get_session_info_settings,session_info_commands::set_session_info_settings,chat_authoring_commands::get_chat_authoring_settings,chat_authoring_commands::set_chat_authoring_settings,crate::commands::browser_tools::get_browser_tools_settings,crate::commands::browser_tools::set_browser_tools_settings,crate::commands::computer_tools::get_computer_tools_settings,crate::commands::computer_tools::set_computer_tools_settings,crate::commands::computer_tools::set_computer_tools_enabled,crate::commands::computer_tools::set_computer_tools_preferences,crate::commands::computer::computer_status,crate::commands::computer::computer_request_permission,crate::commands::computer::computer_open_permission_settings,crate::commands::computer::computer_reveal_helper,crate::commands::computer::computer_list_shareable_windows,crate::commands::computer::computer_window_thumbnail,crate::commands::computer::computer_share_window,crate::commands::computer::computer_share_windows,crate::commands::computer::computer_share_app,crate::commands::computer::computer_share_screen,crate::commands::computer::computer_revoke_all,crate::commands::computer::computer_stop,crate::commands::computer::computer_shared_state,crate::commands::computer::computer_stop_key_status,crate::commands::computer::computer_indicator_fit,crate::commands::computer::computer_driver_info,crate::commands::computer::computer_driver_install,crate::commands::computer::computer_driver_uninstall,version_control::detect_git,version_control::test_git_path,version_control::get_git_settings,version_control::update_git_settings,version_control::get_github_accounts,version_control::validate_github_token,version_control::validate_gitlab_token,version_control::validate_gitea_token,version_control::validate_cnb_token,version_control::update_github_accounts,version_control::save_account_token,version_control::get_account_token,version_control::delete_account_token,acp_commands::acp_preflight,acp_commands::acp_cursor_auth_status,acp_commands::acp_cursor_list_models,acp_commands::acp_qoder_auth_status,acp_commands::acp_connect,acp_commands::acp_prompt,acp_commands::acp_set_mode,acp_commands::acp_set_config_option,acp_commands::acp_goal_control,acp_commands::acp_describe_agent_options,acp_commands::acp_cancel,acp_commands::acp_fork,acp_commands::acp_stop_async_task,acp_commands::acp_respond_permission,acp_commands::acp_answer_question,acp_commands::acp_answer_plan_approval,acp_commands::acp_disconnect,acp_commands::acp_touch_connection,acp_commands::acp_list_connections,acp_commands::acp_get_session_snapshot,acp_commands::acp_get_session_snapshot_by_conversation,acp_commands::acp_find_connection_for_conversation,acp_commands::acp_list_agents,acp_commands::acp_get_agent_status,acp_commands::acp_env_diagnostics,acp_commands::acp_clear_binary_cache,acp_commands::acp_scan_leaked_temp,acp_commands::acp_reclaim_leaked_temp,acp_commands::acp_download_agent_binary,acp_commands::acp_update_system_agent,acp_commands::acp_install_uv_tool,acp_commands::acp_detect_agent_local_version,acp_commands::acp_fetch_agent_latest_release,acp_commands::acp_prepare_npx_agent,acp_commands::acp_uninstall_agent,acp_commands::acp_update_agent_preferences,acp_commands::acp_update_agent_env,acp_commands::acp_update_agent_config,acp_commands::acp_update_hermes_config,acp_commands::acp_update_claude_model_picker,acp_commands::acp_update_kimi_code_config,deepseek_settings_commands::acp_load_deepseek_model_catalog,deepseek_settings_commands::acp_update_deepseek_model_catalog,acp_commands::acp_update_pi_config,acp_commands::acp_load_pi_config,acp_commands::acp_list_pi_model_capabilities,acp_commands::acp_validate_pi_command,acp_commands::acp_sync_antigravity_settings,acp_commands::acp_antigravity_login_start,acp_commands::acp_antigravity_login_finish,acp_commands::acp_antigravity_login_cancel,acp_commands::acp_antigravity_sign_out,acp_commands::acp_pi_project_trust_state,acp_commands::acp_pi_set_project_trust,acp_commands::acp_pi_acknowledge_project_trust,acp_commands::acp_pi_list_trust_entries,acp_commands::acp_install_pi_binary,acp_commands::acp_uninstall_pi_binary,acp_commands::acp_open_hermes_setup_terminal,acp_commands::acp_reveal_hermes_home,acp_commands::acp_reorder_agents,crate::commands::custom_agents::acp_list_custom_agents,crate::commands::custom_agents::acp_save_custom_agent,crate::commands::custom_agents::acp_delete_custom_agent,crate::commands::custom_agents::acp_fetch_registry_catalog,crate::commands::custom_agents::acp_add_registry_agent,crate::commands::custom_agents::acp_current_platform,acp_commands::acp_list_agent_skills,acp_commands::acp_list_agent_runtime_skills,acp_commands::acp_read_agent_skill,acp_commands::acp_save_agent_skill,acp_commands::acp_delete_agent_skill,acp_commands::opencode_list_plugins,acp_commands::opencode_provider_catalog,acp_commands::codex_bundled_catalog,crate::commands::opencode_credentials::opencode_list_integrations,crate::commands::opencode_credentials::opencode_connect_key,crate::commands::opencode_credentials::opencode_disconnect_provider,crate::commands::codex_catalog::codex_catalog_plan_preview,crate::commands::codex_catalog::codex_fetch_endpoint_catalog,crate::commands::codex_catalog::codex_endpoint_catalog_published,crate::commands::codex_catalog::codex_endpoint_catalog_cached,crate::commands::codex_catalog::codex_endpoint_catalog_status,crate::commands::codex_catalog::codex_refresh_endpoint_catalog,acp_commands::opencode_add_plugin,acp_commands::opencode_remove_plugin,acp_commands::codex_request_device_code,acp_commands::codex_poll_device_code,experts_commands::experts_list,experts_commands::experts_get_install_status,experts_commands::experts_list_all_install_statuses,experts_commands::experts_link_to_agent,experts_commands::experts_unlink_from_agent,experts_commands::experts_apply_links,experts_commands::experts_read_content,experts_commands::experts_open_central_dir,science_commands::science_list,science_commands::science_get_install_status,science_commands::science_list_all_install_statuses,science_commands::science_link_to_agent,science_commands::science_unlink_from_agent,science_commands::science_apply_links,science_commands::science_read_content,science_commands::science_open_central_dir,crate::commands::generative_ui::generative_ui_skill_info,crate::commands::generative_ui::generative_ui_list_all_install_statuses,crate::commands::generative_ui::generative_ui_apply_links,crate::commands::generative_ui::generative_ui_read_content,custom_skills_commands::custom_list,custom_skills_commands::custom_list_all_install_statuses,custom_skills_commands::custom_apply_links,custom_skills_commands::custom_read_skill,custom_skills_commands::custom_create_skill,custom_skills_commands::custom_save_skill,custom_skills_commands::custom_duplicate_skill,custom_skills_commands::custom_import_skill,custom_skills_commands::custom_import_from_agent,custom_skills_commands::custom_delete_skills,office_tools_commands::officecli_detect,office_tools_commands::officecli_install,office_tools_commands::officecli_uninstall,office_tools_commands::officecli_list_skills,office_tools_commands::officecli_sync_skills,office_tools_commands::officecli_skill_link_to_agent,office_tools_commands::officecli_skill_unlink_from_agent,office_tools_commands::officecli_skill_get_install_status,office_tools_commands::officecli_skill_list_all_install_statuses,office_tools_commands::officecli_skill_apply_links,office_tools_commands::officecli_skill_read_content,office_tools_commands::officecli_render_html,office_tools_commands::start_office_watch,office_tools_commands::stop_office_watch,office_tools_commands::renew_office_watch,folder_commands::list_folder_commands,folder_commands::create_folder_command,folder_commands::update_folder_command,folder_commands::delete_folder_command,folder_commands::reorder_folder_commands,folder_commands::bootstrap_folder_commands_from_package_json,local_command::run_local_command,quick_messages_commands::quick_messages_list,quick_messages_commands::quick_messages_create,quick_messages_commands::quick_messages_update,quick_messages_commands::quick_messages_delete,quick_messages_commands::quick_messages_reorder,automation_commands::automation_list,automation_commands::automation_get,automation_commands::automation_runs,automation_commands::automation_create,automation_commands::automation_update,automation_commands::automation_set_enabled,automation_commands::automation_delete,automation_commands::automation_mark_seen,automation_commands::automation_compute_next_run,automation_commands::automation_run_now,automation_commands::automation_cancel_run,token_usage_commands::token_usage_report,token_usage_commands::token_usage_facets,token_usage_commands::token_usage_status,token_usage_commands::token_usage_sync,work_task_commands::work_task_list,work_task_commands::work_task_get,work_task_commands::work_task_events,work_task_commands::work_task_attention_count,work_task_commands::work_task_create,work_task_commands::work_task_update,work_task_commands::work_task_reorder,work_task_commands::work_task_delete,work_task_commands::work_task_start,work_task_commands::work_task_start_all,work_task_commands::work_task_retry,work_task_commands::work_task_requeue,work_task_commands::work_task_schedule,work_task_commands::work_task_return,work_task_commands::work_task_cancel,work_task_commands::work_task_stop_background_wait,work_task_commands::work_task_merge,work_task_commands::work_task_merge_unqueue,work_task_commands::work_task_deliver_pr,work_task_commands::work_task_complete,work_task_commands::work_task_archive,work_task_commands::work_task_defer,work_task_commands::work_task_set_writeback,work_task_commands::work_task_cleanup,work_task_commands::work_task_diff,work_task_commands::work_task_changed_files,work_task_commands::work_task_uncommitted_files,work_task_commands::work_task_settings_get,work_task_commands::work_task_settings_get_own,work_task_commands::work_task_settings_effective,work_task_commands::work_task_settings_set,work_task_commands::work_task_settings_delete,work_task_commands::work_task_template_list,work_task_commands::work_task_template_save,work_task_commands::work_task_template_delete,forge_commands::folder_forge_remote,forge_commands::forge_list_issues,forge_commands::forge_issue_detail,forge_commands::forge_read_image,forge_commands::forge_tab_count,forge_commands::forge_list_labels,forge_commands::forge_list_comments,forge_commands::forge_create_comment,forge_commands::forge_set_item_state,forge_commands::forge_create_issue,forge_commands::forge_change_detail,forge_commands::forge_check_summaries,forge_commands::forge_approve_workflows,forge_commands::forge_change_files,forge_commands::forge_identity,forge_commands::forge_merge_options,forge_commands::forge_merge_change,forge_commands::work_task_create_from_forge,forge_commands::work_task_create_from_forge_issues,forge_commands::work_task_lookup_by_source,forge_commands::forge_settings_get,forge_commands::forge_settings_set,forge_commands::forge_auto_status,forge_commands::forge_auto_scan_now,terminal_commands::terminal_spawn,terminal_commands::terminal_write,terminal_commands::terminal_resize,terminal_commands::terminal_snapshot,terminal_commands::terminal_kill,terminal_commands::terminal_list,mcp_commands::mcp_scan_local,mcp_commands::mcp_list_marketplaces,mcp_commands::mcp_search_marketplace,mcp_commands::mcp_get_marketplace_server_detail,mcp_commands::mcp_install_from_marketplace,mcp_commands::mcp_upsert_local_server,mcp_commands::mcp_set_server_apps,mcp_commands::mcp_remove_server,notification::send_notification,notification::notification_identity,notification::open_system_notification_settings,file_io::save_binary_file,file_io::save_text_file,file_io::save_pasted_attachment,clipboard_commands::copy_files_to_clipboard,clipboard_commands::read_clipboard_files,config_sync::config_sync_export_file,config_sync::config_sync_peek_file,config_sync::config_sync_import_file,config_sync::config_sync_get_settings,config_sync::config_sync_update_settings,config_sync::config_sync_get_state,config_sync::config_sync_test_connection,config_sync::config_sync_upload_now,config_sync::config_sync_peek_remote,config_sync::config_sync_download_apply,config_sync::config_sync_export_content,config_sync::config_sync_peek_content,config_sync::config_sync_import_content,config_sync::config_sync_list_rollbacks,config_sync::config_sync_apply_rollback,config_sync::config_sync_mirror_appearance,backup::backup_create,backup::backup_prepare_source,backup::backup_release_source,backup::backup_scan_external_conflicts,backup::backup_restore_stage,backup::backup_cancel,backup::backup_list_safety_snapshots,backup::backup_rollback,backup::backup_discard_pending,backup::backup_active_agents,chat_channel_commands::list_chat_channels,chat_channel_commands::create_chat_channel,chat_channel_commands::update_chat_channel,chat_channel_commands::delete_chat_channel,chat_channel_commands::save_chat_channel_token,chat_channel_commands::get_chat_channel_has_token,chat_channel_commands::delete_chat_channel_token,chat_channel_commands::connect_chat_channel,chat_channel_commands::disconnect_chat_channel,chat_channel_commands::test_chat_channel,chat_channel_commands::get_chat_channel_status,chat_channel_commands::list_chat_channel_messages,chat_channel_commands::get_chat_command_prefix,chat_channel_commands::set_chat_command_prefix,chat_channel_commands::get_chat_event_filter,chat_channel_commands::set_chat_event_filter,chat_channel_commands::get_chat_event_webhooks,chat_channel_commands::set_chat_event_webhooks,chat_channel_commands::get_chat_event_top_level_only,chat_channel_commands::set_chat_event_top_level_only,chat_channel_commands::get_chat_message_language,chat_channel_commands::set_chat_message_language,chat_channel_commands::weixin_get_qrcode,chat_channel_commands::weixin_check_qrcode,model_provider_commands::list_model_providers,model_provider_commands::create_model_provider,model_provider_commands::update_model_provider,model_provider_commands::delete_model_provider,model_provider_commands::list_provider_models,web::start_web_server,web::stop_web_server,web::get_web_server_status,crate::commands::cli_access::cli_access_status,crate::commands::cli_access::cli_access_set_enabled,crate::commands::cli_access::cli_tool_status,crate::commands::cli_access::cli_tool_install,web::get_web_service_config,web::update_web_service_config,web::probe_web_service_port,]).build(context)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/lib.rs:2456
`Command::new("/bin/sh").args(["-c","printf '%s' \"$2\" > \"$1\"","sh"]).arg(path).arg(content).stdin(std::process::Stdio::null()).status()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `write_test_script` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/process.rs:221
`std::fs::set_permissions(path,std::fs::Permissions::from_mode(0o755))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `write_test_script` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/process.rs:228
`task.conversation_id` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `launch` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/work_task/engine.rs:1477
`events.last()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handle_attach` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/web/ws_attach.rs:167
`terminals.remove(terminal_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `finish_terminal_reader` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/terminal/manager.rs:1082
`Regex::new(concat!(r"(?s)",r"<system-reminder>.*?</system-reminder>",r"|<local-command-caveat>.*?</local-command-caveat>",r"|<command-name>.*?</command-name>",r"|<command-message>.*?</command-message>",r"|<command-args>.*?</command-args>",r"|<local-command-stdout>.*?</local-command-stdout>",r"|<user-prompt-submit-hook>.*?</user-prompt-submit-hook>",r"|<task-notification>.*?</task-notification>",r"|<fast_mode_info>.*?</fast_mode_info>",))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `system_tag_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:33
`Regex::new(r"(?s)<note>(.*?)</note>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_note_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:130
`Regex::new(r"(?s)<task-id>(.*?)</task-id>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_task_id_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:184
`Regex::new(r"(?s)<status>(.*?)</status>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_status_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:189
`Regex::new(r"(?s)<summary>(.*?)</summary>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_summary_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:194
`Regex::new(r"(?s)<tool-use-id>(.*?)</tool-use-id>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_tool_use_id_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:205
`Regex::new(r"(?s)<result>(.*?)</result>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_result_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:210
`Regex::new(r"(?s)<command-name>(.*?)</command-name>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `command_name_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:236
`Regex::new(r"(?s)<command-args>(.*?)</command-args>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `command_args_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:242
`snapshot.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `goal_status_transition` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:580
`Regex::new(&format!(r"\A\s*{}[^\n]*\n(?:[ \t]*\r?\n)*(?:[ \t]*<system-reminder>[\s\S]*?</system-reminder>[ \t]*\r?\n(?:[ \t]*\r?\n)*)*(?:[ \t]*Summary:[ \t]*\r?\n)?",regex::escape(CONTEXT_CONTINUATION_PREFIX)))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `continuation_preamble_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:947
`messages.last_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `feed_value` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:2444
`content.into_iter().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `feed_value` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/claude.rs:2446
`Regex::new(r"…\d+ chars truncated…")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `codex_truncated_mcp_result_preview` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex.rs:1731
`pending_exec_scripts.keys().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_conversation_detail` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex.rs:3932
`Regex::new(r"(?s)\A# AGENTS\.md instructions for [^\n]+\n\s*\n<INSTRUCTIONS>.*?</INSTRUCTIONS>\s*",)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `agents_instructions_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex.rs:6013
`Regex::new(r"@([^\s@]+)\s*\[blocked[^\]]*\]")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `strip_blocked_resource_mentions` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex.rs:7150
`Regex::new(r"(?i)</?image\s*/?>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `strip_blocked_resource_mentions` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex.rs:7151
`Regex::new(r"[ \t]{2,}")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `strip_blocked_resource_mentions` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex.rs:7152
`Regex::new(r"^\s*(?:\(\s*([A-Za-z_$][A-Za-z0-9_$]*)\s*(?:,\s*([A-Za-z_$][A-Za-z0-9_$]*)\s*)?\)|([A-Za-z_$][A-Za-z0-9_$]*))\s*=>",)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `arrow_parameters` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex_code_mode.rs:1150
`Regex::new(pattern)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/codex_desktop_attachments.rs:134
`out.subagents.last_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_updates` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/grok.rs:1041
`assistant.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `ensure_assistant` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/grok.rs:1699
`openers.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `fold_reference_links` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/mod.rs:772
`Regex::new(r"(?i)\[\s*([0-9]+(?:\.[0-9]+)?)\s*([km])\s*\]\s*$")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `model_capacity_suffix_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/mod.rs:1002
`Regex::new(r"(?i)\b1m\b")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `claude_one_million_id_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/mod.rs:1012
`Regex::new(r"^claude-(opus|sonnet|haiku|fable|mythos)-(\d{1,2})(?:[-.](\d{1,2}))?(?:$|\D)")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `claude_family_version_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/mod.rs:1031
`Regex::new(r"(?s)^Sender \(untrusted metadata\):\s*```[^`]*```\s*")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `sender_block_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/openclaw.rs:22
`Regex::new(r"^\[.*?\]\s*")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `timestamp_prefix_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/openclaw.rs:27
`Regex::new(r"^\[Working directory:[^\]]*\]\s*")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `working_dir_prefix_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/openclaw.rs:32
`Regex::new(r"\[Working directory:\s*([^\]]+)\]")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `working_dir_extract_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/openclaw.rs:38
`candidates.into_iter().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `find_reset_file` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src-tauri/src/parsers/openclaw.rs:831
What to do
Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 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 — 3 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.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 3 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.
Not included — 44 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.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; 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 function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — AX6 reached only 38% of this repository's production lines — rust (572,281 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 — compose up failed (exit 17 — an image could not be built) — failed to solve: process "/bin/sh -c pnpm install --frozen-lockfile" did not complete successfully: exit code: 1; likely cause (the repository): a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c pnpm install --frozen-lockfile`): the build's own command failed, for example a compile or test error; runtime evidence skipped The cause is in the repository, not in our sandbox: a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c pnpm install --frozen-lockfile`): the build's own command failed, for example a compile or test error. Nothing here says the surface is inaccessible, only that it was never rendered.
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
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
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#, TypeScript, Go 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 (src-tauri), 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) — 41 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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 — no integration events detected — coupling check not applicable
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
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 pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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 — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X24 Document value interpolated into markup unescaped — X24 reached only 38% of this repository's production lines — rust (572,281 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — X3 reached only 38% of this repository's production lines — rust (572,281 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.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 162 finding(s)
ED1 · Handler temporal coupling· Blocking call on the event loop · ×40
Blocking call on the event loop: binary_cache.ensure_uv_tool calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:116— `binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_uv_tool calls `std::fs::remove_dir_all` src-tauri/src/acp/binary_cache.rs:120— `binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_uv_tool calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:122— `binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_uv_tool calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:137— `binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_uv_tool calls `std::fs::copy` src-tauri/src/acp/binary_cache.rs:159— `binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_uv_tool calls `std::fs::remove_dir_all` src-tauri/src/acp/binary_cache.rs:177— `binary_cache.ensure_uv_tool` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.uvx_prepared_version calls `std::fs::read_to_string` src-tauri/src/acp/binary_cache.rs:193— `binary_cache.uvx_prepared_version` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.mark_uvx_agent_prepared calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:202— `binary_cache.mark_uvx_agent_prepared` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.mark_uvx_agent_prepared calls `std::fs::write` src-tauri/src/acp/binary_cache.rs:205— `binary_cache.mark_uvx_agent_prepared` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::write`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.clear_uvx_agent_prepared calls `std::fs::remove_file` src-tauri/src/acp/binary_cache.rs:212— `binary_cache.clear_uvx_agent_prepared` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.clear_agent_dir_in calls `std::fs::remove_dir_all` src-tauri/src/acp/binary_cache.rs:498— `binary_cache.clear_agent_dir_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.clear_agent_dir_in calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:511— `binary_cache.clear_agent_dir_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.clear_agent_dir_in calls `std::fs::rename` src-tauri/src/acp/binary_cache.rs:518— `binary_cache.clear_agent_dir_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.clear_agent_dir_in calls `std::fs::remove_dir_all` src-tauri/src/acp/binary_cache.rs:521— `binary_cache.clear_agent_dir_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.installed_binary_path_in calls `std::fs::remove_file` src-tauri/src/acp/binary_cache.rs:662— `binary_cache.installed_binary_path_in` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.collect_version_labels calls `std::fs::read_dir` src-tauri/src/acp/binary_cache.rs:689— `binary_cache.collect_version_labels` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.file_sha256 calls `File::open` src-tauri/src/acp/binary_cache.rs:907— `binary_cache.file_sha256` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:960— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::remove_dir_all` src-tauri/src/acp/binary_cache.rs:965— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:967— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::create_dir_all` src-tauri/src/acp/binary_cache.rs:983— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::copy` src-tauri/src/acp/binary_cache.rs:1005— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::copy`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::remove_file` src-tauri/src/acp/binary_cache.rs:1009— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::remove_dir_all` src-tauri/src/acp/binary_cache.rs:1021— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: binary_cache.ensure_binary_with_progress calls `std::fs::remove_dir_all` src-tauri/src/acp/binary_cache.rs:1024— `binary_cache.ensure_binary_with_progress` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
AC2 · Forms & labels· <label> that labels no control · ×11
<label> that labels no control src/components/automations/agent-config-section.tsx:381— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:4946— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:4954— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:8996— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:9025— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:9050— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:9247— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:9256— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:9399— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:9438— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/components/settings/acp-agent-settings.tsx:9460— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels· <input> without a programmatic label · ×4
<input> without a programmatic label src/app/login/page.tsx:91— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/components/canvas/add-node-menu.tsx:239— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/components/canvas/add-node-menu.tsx:456— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label src/components/canvas/nodes/region-node.tsx:171— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels· <button> with no accessible text · ×4
<button> with no accessible text src/components/chat/message-queue-display.tsx:95— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text src/components/conversations/conversation-manage-dialog.tsx:1012— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text src/components/layout/status-bar-alerts.tsx:183— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text src/components/layout/status-bar-alerts.tsx:219— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC3 · Page structure· <iframe> without a title · ×4
<iframe> without a title REDACTED:103— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title REDACTED:106— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title REDACTED:111— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title src/components/project-boot/shadcn/shadcn-preview.tsx:53— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×3
Click handler on a non-interactive <div> REDACTED:69— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> src/components/layout/sidebar.tsx:667— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> src/components/terminal/terminal-tab-bar.tsx:91— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
<html> without a lang REDACTED:60— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang src-tauri/experts/skills/brainstorming/scripts/frame-template.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC4 · Keyboard semantics· Click handler on a <span> nested inside <button> · ×2
Click handler on a <span> nested inside <button> src/components/files/file-workspace-panel.tsx:2019— This <span> carries its own click handler, but it sits inside a <button> that performs a different action. A keyboard user reaches the <button> and activating it runs the <button>'s handler, never this one, so this action has no keyboard path at all. Role and tabindex cannot supply one: HTML forbids a <button> from containing interactive content or any descendant with a tabindex, so the browser will not put this element in the tab order however it is marked up. Move it out of the <button> and make it a sibling <button>, so each action has its own control.
Click handler on a <span> nested inside <button> src/components/shared/directory-browser.tsx:498— This <span> carries its own click handler, but it sits inside a <button> that performs a different action. A keyboard user reaches the <button> and activating it runs the <button>'s handler, never this one, so this action has no keyboard path at all. Role and tabindex cannot supply one: HTML forbids a <button> from containing interactive content or any descendant with a tabindex, so the browser will not put this element in the tab order however it is marked up. Move it out of the <button> and make it a sibling <button>, so each action has its own control.
Boundary-crossing change coupling: conversation-detail-panel.tsx ↔ use-connection.ts src/components/conversations/conversation-detail-panel.tsx:1— `src/components/conversations/conversation-detail-panel.tsx` (context components) and `src/hooks/use-connection.ts` (context hooks) sit in DIFFERENT parts of the tree yet change together 79% of the time (19 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) — 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 19 shared commits counted here, the most recent 3 are `6c0b8acc` fix(chat): raise "load background activity" only after a connection's…; `c9e6329c` feat(acp): pin claude-agent-acp 0.93.0 and show Claude Code's Remote …; `e4c38963` fix(acp): show the session coming up when a historical conversation o… — run `git show` on any of them.
Boundary-crossing change coupling: REDACTED ↔ use-session-feedback.ts REDACTED:1— `REDACTED` (context components) and `src/hooks/use-session-feedback.ts` (context hooks) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `1deaf524` feat(chat): offer the mid-turn send on every session with a delivery …; `a462935b` fix(chat): default the mid-turn send to the weaker promise and lock i…; `b058ccbd` fix(chat): steer a draft with image attachments instead of refusing it — run `git show` on any of them.
AC2 · Forms & labels· Editable <div> without an accessible name · ×1
Editable <div> without an accessible name REDACTED:80— An element made editable (contenteditable, or role="textbox"/"searchbox" with a tab stop or key handling) is a text-entry control, and it has no aria-label, no aria-labelledby and no title, so assistive tech announces an unnamed edit field. Point aria-labelledby at its visible caption, or add an aria-label.
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label src/components/canvas/nodes/note-node.tsx:122— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics· Double-click handler on a non-interactive <div> · ×1
Double-click handler on a non-interactive <div> src/components/canvas/nodes/note-node.tsx:93— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
AC4 · Keyboard semantics· Double-click handler on a non-interactive <span> · ×1
Double-click handler on a non-interactive <span> src/components/canvas/nodes/region-node.tsx:184— This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
AC4 · Keyboard semantics· Clickable role="separator" that no keyboard user can reach · ×1
Clickable role="separator" that no keyboard user can reach src/components/conversations/group-split-handle.tsx:80— This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
Empty aria-activedescendant reference src/components/chat/composer/suggestion/suggestion-popup.tsx:594— aria-activedescendant is present but empty, so it references no element and the relationship is lost. Point it at the id(s) of the target element, or remove it.
Unknown ARIA attribute "aria-label:let" src/components/chat/sub-agent-overlay.tsx:179— This is not a valid WAI-ARIA attribute, so assistive technology ignores it (usually a typo). Use the correct aria-* attribute.
codeg::acp::connection::run_conversation_loop (cognitive 302) src-tauri/src/acp/connection.rs:14805— codeg::acp::connection::run_conversation_loop has cognitive complexity 302 (threshold 15). Drivers by points: if/else 56 (228 pts), match/switch 18 (65 pts), loops 4 (9 pts) (nesting depth added 224). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::acp::connection::emit_conversation_update (cognitive 263) src-tauri/src/acp/connection.rs:25481— codeg::acp::connection::emit_conversation_update has cognitive complexity 263 (threshold 15). Drivers by points: if/else 93 (189 pts), match/switch 22 (54 pts), boolean chains 20 (nesting depth added 128). 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.
codeg::agent_turn_files::extract::tokenize (cognitive 217) src-tauri/src/agent_turn_files/extract.rs:268— codeg::agent_turn_files::extract::tokenize has cognitive complexity 217 (threshold 15). Drivers by points: if/else 65 (150 pts), boolean chains 35, loops 8 (23 pts), match/switch 3 (9 pts) (nesting depth added 106). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::acp::connection::run_connection (cognitive 145) src-tauri/src/acp/connection.rs:8555— codeg::acp::connection::run_connection has cognitive complexity 145 (threshold 15). Drivers by points: if/else 61 (117 pts), match/switch 10 (17 pts), boolean chains 8, loops 1 (3 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::process::node_bin_dir_candidates (cognitive 145) src-tauri/src/process.rs:287— codeg::process::node_bin_dir_candidates has cognitive complexity 145 (threshold 15). Drivers by points: if/else 45 (116 pts), loops 8 (29 pts) (nesting depth added 92). Of this number, 142 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
codeg::chat_channel::session_event_subscriber::handle_acp_envelope (cognitive 144) src-tauri/src/chat_channel/session_event_subscriber.rs:121— codeg::chat_channel::session_event_subscriber::handle_acp_envelope has cognitive complexity 144 (threshold 15). Drivers by points: if/else 43 (119 pts), match/switch 12 (23 pts), boolean chains 2 (nesting depth added 87). 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.
codeg::parsers::cursor::decode_tool_variant (cognitive 135) src-tauri/src/parsers/cursor.rs:1528— codeg::parsers::cursor::decode_tool_variant has cognitive complexity 135 (threshold 15). Drivers by points: if/else 37 (105 pts), match/switch 5 (15 pts), loops 4 (13 pts), boolean chains 2 (nesting depth added 87). 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.
codeg::parsers::deepseek::parse_session_events (cognitive 133) src-tauri/src/parsers/deepseek.rs:812— codeg::parsers::deepseek::parse_session_events has cognitive complexity 133 (threshold 15). Drivers by points: if/else 36 (112 pts), match/switch 4 (13 pts), boolean chains 4, loops 2 (4 pts) (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.
codeg::acp::connection::build_agent (cognitive 108) src-tauri/src/acp/connection.rs:2183— codeg::acp::connection::build_agent has cognitive complexity 108 (threshold 15). Drivers by points: if/else 41 (81 pts), loops 6 (15 pts), boolean chains 6, match/switch 3 (6 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.
codeg::parsers::codex_file_citations::win32::normalize (cognitive 97) src-tauri/src/parsers/codex_file_citations.rs:677— codeg::parsers::codex_file_citations::win32::normalize has cognitive complexity 97 (threshold 15). Drivers by points: if/else 30 (68 pts), boolean chains 14, loops 4 (14 pts), match/switch 1 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
codeg::commands::acp::acp_list_agents_core (cognitive 95) src-tauri/src/commands/acp.rs:12785— codeg::commands::acp::acp_list_agents_core has cognitive complexity 95 (threshold 15). Drivers by points: if/else 34 (82 pts), match/switch 3 (7 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 55). 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.
codeg::parsers::codex::parse_codex_subagent_stats (cognitive 91) src-tauri/src/parsers/codex.rs:2993— codeg::parsers::codex::parse_codex_subagent_stats has cognitive complexity 91 (threshold 15). Drivers by points: if/else 31 (68 pts), match/switch 5 (11 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::tauri_app::run (cognitive 90) src-tauri/src/lib.rs:543— codeg::tauri_app::run has cognitive complexity 90 (threshold 15). Drivers by points: if/else 54 (75 pts), boolean chains 9, match/switch 5 (6 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.
codeg::parsers::claude::parse_subagent_tool_calls (cognitive 89) src-tauri/src/parsers/claude.rs:3843— codeg::parsers::claude::parse_subagent_tool_calls has cognitive complexity 89 (threshold 15). Drivers by points: if/else 19 (67 pts), match/switch 5 (11 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 60). 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.
codeg::acp::codex_catalog_commit::prepare (cognitive 85) src-tauri/src/acp/codex_catalog_commit/mod.rs:1284— codeg::acp::codex_catalog_commit::prepare has cognitive complexity 85 (threshold 15). Drivers by points: if/else 36 (62 pts), match/switch 5 (10 pts), boolean chains 9, loops 4 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::parsers::grok::parse_updates (cognitive 83) src-tauri/src/parsers/grok.rs:689— codeg::parsers::grok::parse_updates has cognitive complexity 83 (threshold 15). Drivers by points: if/else 25 (65 pts), match/switch 4 (11 pts), boolean chains 5, loops 2 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::parsers::kimi_code::parse_wire (cognitive 81) src-tauri/src/parsers/kimi_code.rs:350— codeg::parsers::kimi_code::parse_wire has cognitive complexity 81 (threshold 15). Drivers by points: if/else 21 (65 pts), match/switch 4 (13 pts), boolean chains 2, loops 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::parsers::qoder::parse_transcript (cognitive 76) src-tauri/src/parsers/qoder.rs:635— codeg::parsers::qoder::parse_transcript has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (63 pts), match/switch 3 (7 pts), boolean chains 4, loops 2 (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.
codeg::commands::remote_proxy::run_ws_connection (cognitive 70) src-tauri/src/commands/remote_proxy.rs:1885— codeg::commands::remote_proxy::run_ws_connection has cognitive complexity 70 (threshold 15). Drivers by points: if/else 11 (39 pts), match/switch 7 (23 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codeg::parsers::antigravity::project_steps (cognitive 63) src-tauri/src/parsers/antigravity.rs:820— codeg::parsers::antigravity::project_steps has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 3 (5 pts), match/switch 1 (3 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.
codeg::parsers::codex_file_citations::parse_citation_with (cognitive 63) src-tauri/src/parsers/codex_file_citations.rs:186— codeg::parsers::codex_file_citations::parse_citation_with has cognitive complexity 63 (threshold 15). Drivers by points: if/else 24 (45 pts), loops 6 (11 pts), boolean chains 7 (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.
codeg::commands::acp::build_report (cognitive 61) src-tauri/src/commands/acp.rs:1569— codeg::commands::acp::build_report has cognitive complexity 61 (threshold 15). Drivers by points: if/else 30 (51 pts), match/switch 4 (9 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.
codeg::pet_state_mapper::pet_state_subscriber_task (cognitive 61) src-tauri/src/pet_state_mapper.rs:358— codeg::pet_state_mapper::pet_state_subscriber_task has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (46 pts), match/switch 4 (12 pts), boolean chains 2, loops 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.
codeg::agent_turn_files::extract::scan_command (cognitive 60) src-tauri/src/agent_turn_files/extract.rs:534— codeg::agent_turn_files::extract::scan_command has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (44 pts), match/switch 3 (9 pts), boolean chains 6, loops 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.
codeg::commands::conversations::import_selected_from_summaries (cognitive 55) src-tauri/src/commands/conversations.rs:867— codeg::commands::conversations::import_selected_from_summaries has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 3 (6 pts), boolean chains 4, loops 3 (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.
FunctionTooLong: acp-connections-context.AcpConnectionsProvider src/contexts/acp-connections-context.tsx:3902— FunctionTooLong — AcpConnectionsProvider runs 2485 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2385 over it, 24.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: workspace-context.WorkspaceProvider src/contexts/workspace-context.tsx:635— FunctionTooLong — WorkspaceProvider runs 2036 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1936 over it, 20.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: aux-panel-file-tree-tab.FileTreeTab src/components/layout/aux-panel-file-tree-tab.tsx:1136— FunctionTooLong — FileTreeTab runs 1864 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1764 over it, 18.64× 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: codeg::web::router::build_router_with_proxy_auth src-tauri/src/web/router.rs:34— FunctionTooLong — codeg::web::router::build_router_with_proxy_auth runs 1626 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 1526 over it, 16.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codeg::tauri_app::run src-tauri/src/lib.rs:543— FunctionTooLong — codeg::tauri_app::run runs 1294 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 1194 over it, 12.94× 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: mcp-settings.McpSettings src/components/settings/mcp-settings.tsx:412— FunctionTooLong — McpSettings runs 1241 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1141 over it, 12.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codeg::acp::connection::run_connection src-tauri/src/acp/connection.rs:8555— FunctionTooLong — codeg::acp::connection::run_connection runs 1027 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 927 over it, 10.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.
FunctionTooLong: commit-dialog.CommitWorkspace src/components/layout/commit-dialog.tsx:240— FunctionTooLong — CommitWorkspace runs 977 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 877 over it, 9.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: acp-connections-context.connectionsReducer src/contexts/acp-connections-context.tsx:1982— FunctionTooLong — connectionsReducer runs 972 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 872 over it, 9.72× 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: file-workspace-panel.FileWorkspacePanelBody src/components/files/file-workspace-panel.tsx:779— FunctionTooLong — FileWorkspacePanelBody runs 956 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 856 over it, 9.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.
FunctionTooLong: forge-page.ForgePage src/components/forge/forge-page.tsx:630— FunctionTooLong — ForgePage runs 918 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 818 over it, 9.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: skills-settings.SkillsSettings src/components/settings/skills-settings.tsx:166— FunctionTooLong — SkillsSettings runs 907 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 807 over it, 9.07× 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: codeg::acp::connection::emit_conversation_update src-tauri/src/acp/connection.rs:25481— FunctionTooLong — codeg::acp::connection::emit_conversation_update runs 839 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 739 over it, 8.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: use-composer-attachments.useComposerAttachments src/components/chat/composer/use-composer-attachments.ts:211— FunctionTooLong — useComposerAttachments runs 806 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 706 over it, 8.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.
FunctionTooLong: backup-settings.BackupSettings src/components/settings/backup-settings.tsx:118— FunctionTooLong — BackupSettings runs 742 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 642 over it, 7.42× 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: kimi-code-config-panel.KimiCodeConfigPanel src/components/settings/kimi-code-config-panel.tsx:479— FunctionTooLong — KimiCodeConfigPanel runs 735 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 635 over it, 7.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: codeg::acp::connection::run_conversation_loop src-tauri/src/acp/connection.rs:14805— FunctionTooLong — codeg::acp::connection::run_conversation_loop runs 722 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 622 over it, 7.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: workspace-upload-dialog.WorkspaceUploadDialog src/components/layout/workspace-upload-dialog.tsx:153— FunctionTooLong — WorkspaceUploadDialog runs 664 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 564 over it, 6.64× 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: message-list-view.MessageListView src/components/message/message-list-view.tsx:1525— FunctionTooLong — MessageListView runs 657 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 557 over it, 6.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: system-network-settings.SystemNetworkSettings src/components/settings/system-network-settings.tsx:108— FunctionTooLong — SystemNetworkSettings runs 595 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 495 over it, 5.95× 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: terminal-view.TerminalView src/components/terminal/terminal-view.tsx:118— FunctionTooLong — TerminalView runs 555 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 455 over it, 5.55× 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: appearance-provider.AppearanceProvider src/components/appearance-provider.tsx:399— FunctionTooLong — AppearanceProvider runs 535 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 435 over it, 5.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: import-sessions-window.ImportSessionsWindow src/components/import-sessions/import-sessions-window.tsx:85— FunctionTooLong — ImportSessionsWindow runs 524 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 424 over it, 5.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.
FunctionTooLong: branch-selector-list.BranchSelectorList src/components/layout/branch-selector-list.tsx:182— FunctionTooLong — BranchSelectorList runs 517 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 417 over it, 5.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: command-manage-dialog.CommandManageDialog src/components/layout/command-manage-dialog.tsx:202— FunctionTooLong — CommandManageDialog runs 506 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 406 over it, 5.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.
Hotspot: src/components/settings/acp-agent-settings.tsx src/components/settings/acp-agent-settings.tsx:4973— src/components/settings/acp-agent-settings.tsx changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 797 in acp-agent-settings.AcpAgentSettings at line 4973. 18 of those changes were fix/bug commits, and the other 35 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/settings/acp-agent-settings.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/contexts/acp-connections-context.tsx src/contexts/acp-connections-context.tsx:3902— src/contexts/acp-connections-context.tsx changed 69 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 489 in acp-connections-context.AcpConnectionsProvider at line 3902. 30 of those changes were fix/bug commits, and the other 39 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/contexts/acp-connections-context.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/acp/connection.rs src-tauri/src/acp/connection.rs:25481— src-tauri/src/acp/connection.rs changed 195 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 144 in codeg::acp::connection::emit_conversation_update at line 25481. 94 of those changes were fix/bug commits, and the other 101 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/acp/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: src/contexts/workspace-context.tsx src/contexts/workspace-context.tsx:635— src/contexts/workspace-context.tsx changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 454 in workspace-context.WorkspaceProvider at line 635. 18 of those changes were fix/bug commits, and the other 22 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/contexts/workspace-context.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/components/conversations/conversation-detail-panel.tsx src/components/conversations/conversation-detail-panel.tsx:271— src/components/conversations/conversation-detail-panel.tsx changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 191 in conversation-detail-panel.ConversationTabView at line 271. 31 of those changes were fix/bug commits, and the other 31 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/conversations/conversation-detail-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:332— REDACTED changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 269 in message-input.MessageInput at line 332. 22 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/lib.rs src-tauri/src/lib.rs:543— src-tauri/src/lib.rs changed 127 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in codeg::tauri_app::run at line 543. 33 of those changes were fix/bug commits, and the other 94 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/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: src-tauri/src/parsers/codex.rs src-tauri/src/parsers/codex.rs:3241— src-tauri/src/parsers/codex.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 219 in CodexParser::parse_conversation_detail at line 3241. 23 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/parsers/codex.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: src/components/conversations/sidebar-conversation-list.tsx src/components/conversations/sidebar-conversation-list.tsx:961— src/components/conversations/sidebar-conversation-list.tsx changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 261 in sidebar-conversation-list.SidebarConversationList at line 961. 8 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/conversations/sidebar-conversation-list.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/stores/conversation-runtime-store.ts src/stores/conversation-runtime-store.ts:2363— src/stores/conversation-runtime-store.ts changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 145 in conversation-runtime-store.reducer at line 2363. 31 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/stores/conversation-runtime-store.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/components/message/message-list-view.tsx src/components/message/message-list-view.tsx:1525— src/components/message/message-list-view.tsx changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in message-list-view.MessageListView at line 1525. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/message/message-list-view.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/stores/tab-store.ts src/stores/tab-store.ts:1640— src/stores/tab-store.ts changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 289 in tab-store.useTabStore at line 1640. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/stores/tab-store.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/acp/session_state.rs src-tauri/src/acp/session_state.rs:1206— src-tauri/src/acp/session_state.rs changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in SessionState::apply_event_inner at line 1206. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/acp/session_state.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: src/components/forge/forge-page.tsx src/components/forge/forge-page.tsx:630— src/components/forge/forge-page.tsx changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in forge-page.ForgePage at line 630. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/forge/forge-page.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/commands/acp.rs src-tauri/src/commands/acp.rs:12785— src-tauri/src/commands/acp.rs changed 95 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in codeg::commands::acp::acp_list_agents_core at line 12785. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/commands/acp.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: src/components/files/file-workspace-panel.tsx src/components/files/file-workspace-panel.tsx:779— src/components/files/file-workspace-panel.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 176 in file-workspace-panel.FileWorkspacePanelBody at line 779. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/files/file-workspace-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/components/layout/aux-panel-file-tree-tab.tsx src/components/layout/aux-panel-file-tree-tab.tsx:1136— src/components/layout/aux-panel-file-tree-tab.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 271 in aux-panel-file-tree-tab.FileTreeTab at line 1136. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/layout/aux-panel-file-tree-tab.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/components/tasks/task-detail-sheet.tsx src/components/tasks/task-detail-sheet.tsx:219— src/components/tasks/task-detail-sheet.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 166 in task-detail-sheet.TaskDetailSheet at line 219. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/tasks/task-detail-sheet.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/parsers/claude.rs src-tauri/src/parsers/claude.rs:2020— src-tauri/src/parsers/claude.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in ClaudeRecordAccumulator::feed_value at line 2020. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/parsers/claude.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: src/components/canvas/canvas-view.tsx src/components/canvas/canvas-view.tsx:192— src/components/canvas/canvas-view.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 241 in canvas-view.CanvasFlow at line 192. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/canvas/canvas-view.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/browser/smoke.rs src-tauri/src/browser/smoke.rs:81— src-tauri/src/browser/smoke.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in codeg::browser::smoke::execute at line 81. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/browser/smoke.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: src/components/terminal/terminal-view.tsx src/components/terminal/terminal-view.tsx:118— src/components/terminal/terminal-view.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 156 in terminal-view.TerminalView at line 118. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/terminal/terminal-view.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/acp/delegation/companion.rs src-tauri/src/acp/delegation/companion.rs:877— src-tauri/src/acp/delegation/companion.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in codeg::acp::delegation::companion::build_tools_call_spawn at line 877. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/acp/delegation/companion.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: src/app/workspace/layout.tsx src/app/workspace/layout.tsx:779— src/app/workspace/layout.tsx changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in layout.FolderWorkspaceShell at line 779. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/app/workspace/layout.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src-tauri/src/work_task/engine.rs src-tauri/src/work_task/engine.rs:1279— src-tauri/src/work_task/engine.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in TaskEngine::launch at line 1279. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/work_task/engine.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.
FileTooLong: acp/connection.rs src-tauri/src/acp/connection.rs— FileTooLong — 12155 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 449 free functions. The bar is 500 significant lines; this is 11655 over it, 24.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: settings/acp-agent-settings.tsx src/components/settings/acp-agent-settings.tsx— FileTooLong — 10059 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 9559 over it, 20.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: commands/acp.rs src-tauri/src/commands/acp.rs— FileTooLong — 8757 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 434 free functions. The bar is 500 significant lines; this is 8257 over it, 17.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: contexts/acp-connections-context.tsx src/contexts/acp-connections-context.tsx— FileTooLong — 4732 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4232 over it, 9.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: work_task/engine.rs src-tauri/src/work_task/engine.rs— FileTooLong — 4655 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: TaskEngine (2 blocks, 236-6895), declaring 61 free functions. The bar is 500 significant lines; this is 4155 over it, 9.31× 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: commands/mcp.rs src-tauri/src/commands/mcp.rs— FileTooLong — 4559 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 267 free functions. The bar is 500 significant lines; this is 4059 over it, 9.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: commands/folders.rs src-tauri/src/commands/folders.rs— FileTooLong — 4356 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 194 free functions. The bar is 500 significant lines; this is 3856 over it, 8.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: lib/api.ts src/lib/api.ts— FileTooLong — 3960 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3460 over it, 7.92× 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: parsers/codex.rs src-tauri/src/parsers/codex.rs— FileTooLong — 3901 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 118 free functions. The bar is 500 significant lines; this is 3401 over it, 7.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: lib/types.ts src/lib/types.ts— FileTooLong — 3234 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2734 over it, 6.47× 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: delegation/companion.rs src-tauri/src/acp/delegation/companion.rs— FileTooLong — 2788 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 85 free functions. The bar is 500 significant lines; this is 2288 over it, 5.58× 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: layout/aux-panel-file-tree-tab.tsx src/components/layout/aux-panel-file-tree-tab.tsx— FileTooLong — 2775 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: FileTreeTab (1136-3684). The bar is 500 significant lines; this is 2275 over it, 5.55× 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: stores/conversation-runtime-store.ts src/stores/conversation-runtime-store.ts— FileTooLong — 2625 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2125 over it, 5.25× 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: acp/manager.rs src-tauri/src/acp/manager.rs— FileTooLong — 2584 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: ConnectionManager (3 blocks, 403-4719). The bar is 500 significant lines; this is 2084 over it, 5.17× 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: conversations/sidebar-conversation-list.tsx src/components/conversations/sidebar-conversation-list.tsx— FileTooLong — 2532 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2032 over it, 5.06× 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: commands/browser.rs src-tauri/src/commands/browser.rs— FileTooLong — 2491 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 134 free functions. The bar is 500 significant lines; this is 1991 over it, 4.98× 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: contexts/workspace-context.tsx src/contexts/workspace-context.tsx— FileTooLong — 2463 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: WorkspaceProvider (635-3744). The bar is 500 significant lines; this is 1963 over it, 4.93× 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: delegation/broker.rs src-tauri/src/acp/delegation/broker.rs— FileTooLong — 2449 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: DelegationBroker (2 blocks, 1503-4905). The bar is 500 significant lines; this is 1949 over it, 4.90× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: stores/tab-store.ts src/stores/tab-store.ts— FileTooLong — 2382 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1882 over it, 4.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: service/work_task_service.rs src-tauri/src/db/service/work_task_service.rs— FileTooLong — 2339 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 91 free functions. The bar is 500 significant lines; this is 1839 over it, 4.68× 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: parsers/claude.rs src-tauri/src/parsers/claude.rs— FileTooLong — 2223 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 84 free functions. The bar is 500 significant lines; this is 1723 over it, 4.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: forge/forge-issue-detail-sheet.tsx src/components/forge/forge-issue-detail-sheet.tsx— FileTooLong — 2119 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1619 over it, 4.24× 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: cli_run/service.rs src-tauri/src/cli_run/service.rs— FileTooLong — 2104 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: CliRunService (2 blocks, 441-2766). The bar is 500 significant lines; this is 1604 over it, 4.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: layout/aux-panel-git-log-tab.tsx src/components/layout/aux-panel-git-log-tab.tsx— FileTooLong — 2083 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1583 over it, 4.17× 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: conversations/conversation-detail-panel.tsx src/components/conversations/conversation-detail-panel.tsx— FileTooLong — 2018 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1518 over it, 4.04× 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.
codeg::acp::connection::emit_conversation_update (cyclomatic 144) src-tauri/src/acp/connection.rs:25481— codeg::acp::connection::emit_conversation_update has cyclomatic complexity 144 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codeg::agent_turn_files::extract::tokenize (cyclomatic 116) src-tauri/src/agent_turn_files/extract.rs:268— codeg::agent_turn_files::extract::tokenize has cyclomatic complexity 116 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codeg::acp::connection::run_conversation_loop (cyclomatic 96) src-tauri/src/acp/connection.rs:14805— codeg::acp::connection::run_conversation_loop has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codeg::browser::smoke::execute (cyclomatic 82) src-tauri/src/browser/smoke.rs:81— codeg::browser::smoke::execute has cyclomatic complexity 82 (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.
codeg::tauri_app::run (cyclomatic 73) src-tauri/src/lib.rs:543— codeg::tauri_app::run has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codeg::acp::connection::run_connection (cyclomatic 70) src-tauri/src/acp/connection.rs:8555— codeg::acp::connection::run_connection has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codeg::parsers::cursor::decode_tool_variant (cyclomatic 69) src-tauri/src/parsers/cursor.rs:1528— codeg::parsers::cursor::decode_tool_variant 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. This is NOT this file's highest cyclomatic complexity: codeg::parsers::cursor::tool_name_for_field (cyclomatic 83) 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.
codeg::chat_channel::session_event_subscriber::localize_stop_reason (cyclomatic 65) src-tauri/src/chat_channel/session_event_subscriber.rs:873— codeg::chat_channel::session_event_subscriber::localize_stop_reason has cyclomatic complexity 65 (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.
codeg::chat_channel::session_event_subscriber::handle_acp_envelope (cyclomatic 62) src-tauri/src/chat_channel/session_event_subscriber.rs:121— codeg::chat_channel::session_event_subscriber::handle_acp_envelope has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codeg::parsers::deepseek::parse_session_events (cyclomatic 60) src-tauri/src/parsers/deepseek.rs:812— codeg::parsers::deepseek::parse_session_events 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.
codeg::acp::delegation::companion::build_tools_call_spawn (cyclomatic 55) src-tauri/src/acp/delegation/companion.rs:877— codeg::acp::delegation::companion::build_tools_call_spawn 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.
codeg::acp::connection::build_agent (cyclomatic 53) src-tauri/src/acp/connection.rs:2183— codeg::acp::connection::build_agent 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.
codeg::acp::codex_catalog_commit::prepare (cyclomatic 51) src-tauri/src/acp/codex_catalog_commit/mod.rs:1284— codeg::acp::codex_catalog_commit::prepare 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.
codeg::process::node_bin_dir_candidates (cyclomatic 51) src-tauri/src/process.rs:287— codeg::process::node_bin_dir_candidates has cyclomatic complexity 51 (threshold 15). Of this number, 49 points are the body's own statements and 2 belong 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.
codeg::parsers::codex_file_citations::win32::normalize (cyclomatic 46) src-tauri/src/parsers/codex_file_citations.rs:677— codeg::parsers::codex_file_citations::win32::normalize 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.
codeg::parsers::grok::parse_updates (cyclomatic 45) src-tauri/src/parsers/grok.rs:689— codeg::parsers::grok::parse_updates 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.
codeg::parsers::codex::parse_codex_subagent_stats (cyclomatic 36) src-tauri/src/parsers/codex.rs:2993— codeg::parsers::codex::parse_codex_subagent_stats 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.
codeg::commands::deepseek_settings::splice_models (cyclomatic 35) src-tauri/src/commands/deepseek_settings.rs:942— codeg::commands::deepseek_settings::splice_models 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.
codeg::computer::helper::act::act_error (cyclomatic 35) src-tauri/src/computer/helper/act.rs:1583— codeg::computer::helper::act::act_error 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.
codeg::parsers::codex_code_mode::scan_body (cyclomatic 35) src-tauri/src/parsers/codex_code_mode.rs:1224— codeg::parsers::codex_code_mode::scan_body 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.
codeg::parsers::codex_file_citations::parse_citation_with (cyclomatic 35) src-tauri/src/parsers/codex_file_citations.rs:186— codeg::parsers::codex_file_citations::parse_citation_with 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.
codeg::acp::delegation::companion::computer_act_request (cyclomatic 34) src-tauri/src/acp/delegation/companion.rs:3941— codeg::acp::delegation::companion::computer_act_request has cyclomatic complexity 34 (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.
codeg::agent_turn_files::extract::scan_command (cyclomatic 34) src-tauri/src/agent_turn_files/extract.rs:534— codeg::agent_turn_files::extract::scan_command 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.
codeg::parsers::qoder::parse_transcript (cyclomatic 34) src-tauri/src/parsers/qoder.rs:635— codeg::parsers::qoder::parse_transcript 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.
codeg::commands::acp::acp_list_agents_core (cyclomatic 33) src-tauri/src/commands/acp.rs:12785— codeg::commands::acp::acp_list_agents_core 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.
Duplicated block (7 lines × 2) src-tauri/src/acp/manager.rs:1093— src-tauri/src/acp/manager.rs:1093-1099 | src-tauri/src/acp/manager.rs:3189-3195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/automation/engine.rs:232— src-tauri/src/automation/engine.rs:232-238 | src-tauri/src/work_task/engine.rs:486-492 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/automation/engine.rs:232` 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) src-tauri/src/browser/profile.rs:808— src-tauri/src/browser/profile.rs:808-814 | src-tauri/src/commands/clipboard.rs:190-196 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/browser/profile.rs:808` 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, `src-tauri/src/browser/profile.rs:805` calls `is_some`, `Ok`, `f` and `src-tauri/src/commands/clipboard.rs:189` 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) src-tauri/src/browser/surface_child.rs:1172— src-tauri/src/browser/surface_child.rs:1172-1178 | src-tauri/src/browser/surface_child.rs:1209-1215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/browser/surface_child.rs:1172` 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) src-tauri/src/chat_channel/backends/telegram.rs:580— src-tauri/src/chat_channel/backends/telegram.rs:580-586 | src-tauri/src/chat_channel/backends/telegram.rs:607-614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/backends/telegram.rs:580` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/commands/acp.rs:2897— src-tauri/src/commands/acp.rs:2897-2903 | src-tauri/src/commands/acp.rs:2920-2926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:2897` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/commands/acp.rs:5723— src-tauri/src/commands/acp.rs:5723-5729 | src-tauri/src/commands/acp.rs:5749-5755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:5723` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/commands/acp.rs:15160— src-tauri/src/commands/acp.rs:15160-15166 | src-tauri/src/commands/acp.rs:15227-15233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/commands/folders.rs:558— src-tauri/src/commands/folders.rs:558-564 | src-tauri/src/commands/folders.rs:6699-6705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:558` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/commands/folders.rs:1798— src-tauri/src/commands/folders.rs:1798-1804 | src-tauri/src/commands/folders.rs:3704-3710 — both copies are in the same file, so extract the 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 (7 lines × 2) src-tauri/src/commands/folders.rs:2384— src-tauri/src/commands/folders.rs:2384-2390 | src-tauri/src/commands/folders.rs:2392-2398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/commands/mcp.rs:6822— src-tauri/src/commands/mcp.rs:6822-6828 | src-tauri/src/commands/mcp.rs:6857-6863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/computer/launch_req.rs:134— src-tauri/src/computer/launch_req.rs:134-140 | src-tauri/src/forge/auto/webhook.rs:145-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 `src-tauri/src/computer/launch_req.rs:134` 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) src-tauri/src/db/service/canvas_service.rs:698— src-tauri/src/db/service/canvas_service.rs:698-704 | src-tauri/src/db/service/canvas_service.rs:865-871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/db/service/canvas_service.rs:976— src-tauri/src/db/service/canvas_service.rs:976-982 | src-tauri/src/db/service/canvas_service.rs:1025-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/db/service/work_task_service.rs:1816— src-tauri/src/db/service/work_task_service.rs:1816-1822 | src-tauri/src/db/service/work_task_service.rs:2085-2091 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:1816` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/db/service/work_task_service.rs:2100— src-tauri/src/db/service/work_task_service.rs:2100-2107 | src-tauri/src/db/service/work_task_service.rs:2846-2852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/db/service/work_task_service.rs:2853` calls `col_expr`, `value`, `clone` and `src-tauri/src/db/service/work_task_service.rs:2107` 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) src-tauri/src/db/service/work_task_service.rs:2505— src-tauri/src/db/service/work_task_service.rs:2505-2511 | src-tauri/src/db/service/work_task_service.rs:2914-2920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2505` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/db/service/work_task_service.rs:2954— src-tauri/src/db/service/work_task_service.rs:2954-2960 | src-tauri/src/db/service/work_task_service.rs:3016-3022 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2954` 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) src-tauri/src/parsers/claude.rs:3938— src-tauri/src/parsers/claude.rs:3938-3944 | src-tauri/src/parsers/claude.rs:4006-4012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:3938` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/parsers/codebuddy.rs:132— src-tauri/src/parsers/codebuddy.rs:132-138 | src-tauri/src/parsers/codebuddy.rs:245-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.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 (7 lines × 2) src-tauri/src/parsers/openclaw.rs:730— src-tauri/src/parsers/openclaw.rs:730-736 | src-tauri/src/parsers/openclaw.rs:761-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/openclaw.rs:730` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src-tauri/src/web/mod.rs:616— src-tauri/src/web/mod.rs:616-622 | src-tauri/src/web/mod.rs:854-860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/acp/provider_models.rs:132— src-tauri/src/acp/provider_models.rs:132-138 | src-tauri/src/web/proxy_auth.rs:133-139 — 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 `url` to `&Url` in one and `&reqwest::Url` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) src-tauri/src/chat_channel/command_handlers.rs:34— src-tauri/src/chat_channel/command_handlers.rs:34-40 | src-tauri/src/chat_channel/session_commands.rs:1399-1405 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
Repeated repair: src-tauri/src/work_task/git.rs src-tauri/src/work_task/git.rs:867— src-tauri/src/work_task/git.rs changed 22 times in last 90 days and 14 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 codeg::work_task::git::remove_worktree_and_branch at line 867), 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(git): find non-ASCII and renamed files by their real names”; “fix(git): read numstat paths unquoted, as git status already does”; “fix(git): preserve racy-clean detection in copied indexes”; “fix(work-task): record what a push-back added to the pull request”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/work_task/git.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: src-tauri/src/computer/local.rs src-tauri/src/computer/local.rs:969— src-tauri/src/computer/local.rs changed 21 times in last 90 days and 12 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 codeg::computer::local::launch at line 969), 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(computer): run the macOS helper from a copy outside codeg's bundle”; “fix(computer): ship the macOS helper as an app of its own”; “fix(computer): settle the review of the Windows and foreground work”; “fix(computer): build the tests against the delivery argument and meet clippy on Windows”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/computer/local.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: src-tauri/src/commands/system_settings.rs src-tauri/src/commands/system_settings.rs:632— src-tauri/src/commands/system_settings.rs changed 16 times in last 90 days and 12 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 codeg::commands::system_settings::resolve_close_request at line 632), 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(proxy): show the bypass list in one format and state its rules”; “fix(proxy): keep agents' loopback traffic off the proxy and add a bypass list”; “fix(settings): report the shell the default-terminal choice resolves to”; “fix(macos): key the fullscreen drain on the flag tao actually sets”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/commands/system_settings.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: src/components/ai-elements/reasoning.tsx src/components/ai-elements/reasoning.tsx:75— src/components/ai-elements/reasoning.tsx changed 16 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 2 (its worst body is reasoning.ReasoningMarkdown at line 75), 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(chat): number and bullet a thought's lists inside its column”; “fix(chat): keep a thought's line breaks in the built app”; “fix(chat): read message text in the direction of its own content”; “fix(deps): patch the packages pnpm audit flags”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/ai-elements/reasoning.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src-tauri/src/acp/scratch_dir.rs src-tauri/src/acp/scratch_dir.rs:560— src-tauri/src/acp/scratch_dir.rs changed 12 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 7 (its worst body is codeg::acp::scratch_dir::create at line 560), 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(acp): isolate Windows scratch dir for custom agents running Antigravity”; “fix(acp): stop pointing Windows agents' TMP at a per-launch directory”; “fix(delegation): see through aliases when scoping the broker socket”; “fix(acp): never sweep the launch dir this process uses as its temp dir”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/acp/scratch_dir.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: src-tauri/src/terminal/manager.rs src-tauri/src/terminal/manager.rs:438— src-tauri/src/terminal/manager.rs changed 15 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 11 (its worst body is TerminalManager::spawn_with_id at line 438), 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(terminal): load the user's PowerShell profile (#1088)”; “fix(appimage): programs codeg starts get the session's environment back”; “fix(terminal): close a stopped terminal's input only once it has died”; “fix(terminal): refuse a closed tab's launch however many others close”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/terminal/manager.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: REDACTED REDACTED:103— REDACTED 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 6 (its worst body is BrowserDownloads::finish at line 103), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(appimage): programs codeg starts get the session's environment back”; “fix(browser): finish the download a transfer reports, not the oldest of its URL”; “fix(browser): give each Linux surface its own process and keep GTK focus”; “fix(browser): embed Linux tabs in the workspace window via a GTK overlay”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src-tauri/src/commands/config_sync/webdav_sync.rs src-tauri/src/commands/config_sync/webdav_sync.rs:716— src-tauri/src/commands/config_sync/webdav_sync.rs changed 9 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 12 (its worst body is codeg::commands::config_sync::webdav_sync::upload_snapshot_core at line 716), 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(config-sync): a fresh browser must not replace the appearance mirror on open”; “fix(config-sync): never overwrite a remote snapshot this machine has not seen; sync appearance settings”; “fix(config-sync): the test credential guard cannot be a std mutex”; “fix(config-sync): two regressions the fix review caught”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/commands/config_sync/webdav_sync.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: src-tauri/src/computer/appident.rs src-tauri/src/computer/appident.rs:396— src-tauri/src/computer/appident.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 13 (its worst body is codeg::computer::appident::windows_name at line 396), 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(computer): settle the review of the Windows and foreground work”; “fix(computer): build the tests against the delivery argument and meet clippy on Windows”; “fix(computer): identify framed apps on Windows and stop listing unseen windows”; “fix(computer): identify window owners on Windows and name them as Windows does”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/computer/appident.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: src-tauri/src/acp/binary_cache.rs src-tauri/src/acp/binary_cache.rs:275— src-tauri/src/acp/binary_cache.rs changed 10 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 12 (its worst body is codeg::acp::binary_cache::migrate_root at line 275), 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(acp): stop doubling .exe for Windows binary agents from the registry”; “fix(computer): settle the first review of the settings page and share-all”; “fix(computer): close the gaps the M1 review found”; “fix(acp): isolate per-launch agent temp dirs, relocate the binary cache, and name JSON parse failures”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/acp/binary_cache.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: REDACTED REDACTED:303— REDACTED changed 10 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 3 (its worst body is probe.check at line 303), 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(browser): stop telling an off-canvas element that it paints nothing”; “fix(browser): separate a refusal the page can undo from one it cannot”; “fix(browser): make the scroll keys scroll, and say what a refusal means”; “fix(browser): stop a page taking the picker's press with inert”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src-tauri/src/automation/engine.rs src-tauri/src/automation/engine.rs:252— src-tauri/src/automation/engine.rs changed 9 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 15 (its worst body is codeg::automation::engine::run_automation_engine at line 252), 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(work-task): keep a later turn's answer across empty turns and a lost connection”; “fix(work-task): order a held run's answers by when the session got them”; “fix(work-task): a later turn on a held connection decides how the run ends”; “fix(work-task): keep a hold's claim through its settle; respect partial async-task tables”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/automation/engine.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: src-tauri/src/browser/policy.rs src-tauri/src/browser/policy.rs:105— src-tauri/src/browser/policy.rs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is codeg::browser::policy::parse_pattern at line 105), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(browser): give each Linux surface its own process and keep GTK focus”; “fix(browser): embed Linux tabs in the workspace window via a GTK overlay”; “fix(browser): name the rule score type”; “fix(browser): trim patterns as ASCII on both sides; make visibility changes atomic”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/browser/policy.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: src-tauri/src/commands/local_command.rs src-tauri/src/commands/local_command.rs:154— src-tauri/src/commands/local_command.rs changed 7 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 12 (its worst body is codeg::commands::local_command::reject_unsafe_cmd_variable at line 154), 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(terminal): load the user's PowerShell profile (#1088)”; “fix(local-command): stop naming the removed local: prefix in a refusal”; “fix(local-command): allow only plain quoted remote variables for cmd.exe”; “fix(local-command): make cmd.exe quote a remote window's variables”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/commands/local_command.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: src-tauri/src/browser/shim/linux.rs src-tauri/src/browser/shim/linux.rs:264— src-tauri/src/browser/shim/linux.rs changed 7 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 9 (its worst body is codeg::browser::shim::linux::install_world at line 264), 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(browser): finish the download a transfer reports, not the oldest of its URL”; “fix(browser): give each Linux surface its own process and keep GTK focus”; “fix(browser): embed Linux tabs in the workspace window via a GTK overlay”; “fix(browser): hear window.close(), and stop painting errors over a live page”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/browser/shim/linux.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: src-tauri/src/browser/doc_guest.rs src-tauri/src/browser/doc_guest.rs:659— src-tauri/src/browser/doc_guest.rs changed 7 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 11 (its worst body is codeg::browser::doc_guest::walk_links at line 659), 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(browser): give each Linux surface its own process and keep GTK focus”; “fix(browser): give every document guest an origin of its own”; “fix(browser): keep a document guest's own addresses to its own host”; “fix(browser): compile the child surface on Windows”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/browser/doc_guest.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: src-tauri/src/office_watch/mod.rs src-tauri/src/office_watch/mod.rs:507— src-tauri/src/office_watch/mod.rs changed 7 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 13 (its worst body is codeg::office_watch::start_within at line 507), 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(office): kill preview servers still starting when the app quits”; “fix(office): count a queued preview start against its own budget”; “fix(office): leave headroom for slow preview initialization”; “fix(office): allow cold-start preview servers to become ready”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/office_watch/mod.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: src/lib/platform.ts src/lib/platform.ts:177— src/lib/platform.ts changed 7 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 9 (its worst body is platform.openFileDialog at line 177), 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(terminal): restore panel sessions after refresh”; “fix(browser): read a windows path by either separator, a unix one by its own”; “fix(browser): keep a document guest's own addresses to its own host”; “fix(browser): show a download that landed on a network path”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/lib/platform.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/components/chat/message-queue-display.tsx src/components/chat/message-queue-display.tsx:45— src/components/chat/message-queue-display.tsx 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 8 (its worst body is message-queue-display.QueueItem at line 45), 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(chat): reuse queue flush after rejected steering and restore Codex gate”; “fix(chat): guard concurrent steering clicks and preserve draft edits”; “fix(chat): deliver queued Codex and Claude steering reliably”; “fix(chat): don't send a queued row twice when its insert races the turn end”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/chat/message-queue-display.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src-tauri/src/browser/profile.rs src-tauri/src/browser/profile.rs:230— src-tauri/src/browser/profile.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 5 (its worst body is codeg::browser::profile::parse_proxy at line 230), 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(browser): let a toast be seen over a page, and stop being an engine with no browser on it”; “fix(browser): install the channel wherever a surface can carry one”; “fix(browser): keep a profile in use until the engine has finished clearing it”; “fix(browser): count profile use while a deletion drains and pin popups to the profile they were built in”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/browser/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: src/contexts/tab-context.tsx src/contexts/tab-context.tsx:48— src/contexts/tab-context.tsx changed 8 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 14 (its worst body is tab-context.TabProvider at line 48), 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(tabs): give each folder its own split layout while tabs follow the folder”; “fix(tabs): follow a tabs-follow-folder switch made in another window”; “fix(workbench): move the picker's own draft into chat mode”; “fix(workbench): keep conversation tabs and the active folder consistent across worktrees”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/contexts/tab-context.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/components/browser/browser-viewer-drawer.tsx src/components/browser/browser-viewer-drawer.tsx:109— src/components/browser/browser-viewer-drawer.tsx changed 8 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 13 (its worst body is browser-viewer-drawer.BrowserViewerBody at line 109), 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(mobile): make the back gesture close overlays instead of unloading the page”; “fix(browser): decide a suspended tab's fate against the list it lands in”; “fix(browser): keep a profile in use until the engine has finished clearing it”; “fix(browser): count profile use while a deletion drains and pin popups to the profile they were built in”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/components/browser/browser-viewer-drawer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/lib/config-sync.ts src/lib/config-sync.ts:249— src/lib/config-sync.ts 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 5 (its worst body is config-sync.pickConfigFileToImport at line 249), 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(config-sync): never overwrite a remote snapshot this machine has not seen; sync appearance settings”; “fix(config-sync): two regressions the fix review caught”; “fix(config-sync): three more from the panel review”; “fix(config-sync): stamp the upload baseline with its destination”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src/lib/config-sync.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src-tauri/src/logging/init.rs src-tauri/src/logging/init.rs:333— src-tauri/src/logging/init.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 14 (its worst body is codeg::logging::init::parse_level at line 333), 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(acp): keep mid-turn messages, steer custom claude-agent-acp agents”; “fix(logging): stop the panic record doubling, and bound what it writes”; “fix(logging): deny the handshake dump's target outright, not by level”; “fix(logging): pin the handshake dump on its own target, not just the crate”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/logging/init.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: src-tauri/src/acp/terminal_runtime.rs src-tauri/src/acp/terminal_runtime.rs:313— src-tauri/src/acp/terminal_runtime.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is codeg::acp::terminal_runtime::own_terminal_process at line 313), 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(appimage): programs codeg starts get the session's environment back”; “fix(acp): end a terminal whose creation is dropped before registering it”; “fix(acp): end a connection's terminals when its handshake stops early”; “fix(acp): retry the terminal shell fallback when exec reports ETXTBSY”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:43:10 +08:00' --until='2026-11-16 21:43:10 +08:00' --full-history --no-merges -- src-tauri/src/acp/terminal_runtime.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 (8 lines × 2) src-tauri/src/acp/connection.rs:323— src-tauri/src/acp/connection.rs:323-330 | src-tauri/src/acp/connection.rs:347-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:323` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/acp/connection.rs:25893— src-tauri/src/acp/connection.rs:25893-25900 | src-tauri/src/acp/connection.rs:26423-26430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:25893` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/acp/cursor_ext.rs:131— src-tauri/src/acp/cursor_ext.rs:131-138 | src-tauri/src/acp/question.rs:528-535 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/cursor_ext.rs:131` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/acp/question.rs:260— src-tauri/src/acp/question.rs:260-267 | src-tauri/src/acp/question.rs:526-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/bin/codeg_server.rs:682— src-tauri/src/bin/codeg_server.rs:682-689 | src-tauri/src/bin/codeg_server.rs:701-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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/bin/codeg_server.rs:682` 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) src-tauri/src/chat_channel/backends/telegram.rs:240— src-tauri/src/chat_channel/backends/telegram.rs:240-247 | src-tauri/src/chat_channel/backends/weixin.rs:519-526 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) src-tauri/src/chat_channel/session_commands.rs:1172— src-tauri/src/chat_channel/session_commands.rs:1172-1179 | src-tauri/src/chat_channel/session_commands.rs:1265-1272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/session_commands.rs:1172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) src-tauri/src/commands/acp.rs:3579— src-tauri/src/commands/acp.rs:3579-3588 | src-tauri/src/commands/acp.rs:3689-3696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:3579` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/backup/archive.rs:330— src-tauri/src/commands/backup/archive.rs:330-337 | src-tauri/src/commands/backup/external.rs:1048-1055 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) src-tauri/src/commands/backup/crypto.rs:166— src-tauri/src/commands/backup/crypto.rs:166-173 | src-tauri/src/commands/backup/crypto.rs:229-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/backup/crypto.rs:166` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/custom_skills.rs:768— src-tauri/src/commands/custom_skills.rs:768-775 | src-tauri/src/commands/experts.rs:431-438 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/experts.rs` as WHOLE FILES: this scan already matched 6 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 `src-tauri/src/commands/custom_skills.rs:768` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/folders.rs:1799— src-tauri/src/commands/folders.rs:1799-1806 | src-tauri/src/commands/folders.rs:1855-1862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:1799` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/mcp.rs:1639— src-tauri/src/commands/mcp.rs:1639-1646 | src-tauri/src/commands/mcp.rs:4185-4192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/commands/system_settings.rs:762— src-tauri/src/commands/system_settings.rs:762-769 | src-tauri/src/web/handlers/system_settings.rs:123-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) src-tauri/src/commands/version_control.rs:154— src-tauri/src/commands/version_control.rs:154-161 | src-tauri/src/web/handlers/version_control.rs:102-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) src-tauri/src/commands/version_control.rs:201— src-tauri/src/commands/version_control.rs:201-208 | src-tauri/src/web/handlers/version_control.rs:142-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) src-tauri/src/db/service/conversation_service.rs:219— src-tauri/src/db/service/conversation_service.rs:219-226 | src-tauri/src/db/service/conversation_service.rs:250-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.
Duplicated block (8 lines × 2) src-tauri/src/db/service/work_task_service.rs:1213— src-tauri/src/db/service/work_task_service.rs:1213-1220 | src-tauri/src/db/service/work_task_service.rs:2274-2281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/db/service/work_task_service.rs:2582— src-tauri/src/db/service/work_task_service.rs:2582-2589 | src-tauri/src/db/service/work_task_service.rs:2756-2763 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2582` it does not close everything it opens, so those exact lines 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) src-tauri/src/db/service/work_task_service.rs:2705— src-tauri/src/db/service/work_task_service.rs:2705-2712 | src-tauri/src/db/service/work_task_service.rs:2755-2762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2705` it does not close everything it opens, so those exact lines 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) src-tauri/src/forge/cnb.rs:392— src-tauri/src/forge/cnb.rs:392-399 | src-tauri/src/forge/cnb.rs:599-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/forge/gitea.rs:408— src-tauri/src/forge/gitea.rs:408-415 | src-tauri/src/forge/gitea.rs:1033-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/parsers/codebuddy.rs:109— src-tauri/src/parsers/codebuddy.rs:109-116 | src-tauri/src/parsers/codebuddy.rs:225-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.
Duplicated block (8 lines × 2) src-tauri/src/parsers/codex.rs:6497— src-tauri/src/parsers/codex.rs:6497-6504 | src-tauri/src/parsers/codex.rs:7024-7031 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codex.rs:7024` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/parsers/kimi_code.rs:371— src-tauri/src/parsers/kimi_code.rs:371-378 | src-tauri/src/parsers/pi.rs:570-577 — before extracting anything, compare `src-tauri/src/parsers/kimi_code.rs` and `src-tauri/src/parsers/pi.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/kimi_code.rs:371` it does not close everything it opens, so those 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) src-tauri/src/acp/binary_cache.rs:118— src-tauri/src/acp/binary_cache.rs:118-123 | src-tauri/src/acp/binary_cache.rs:963-968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/acp/delegation/listener.rs:1476— src-tauri/src/acp/delegation/listener.rs:1476-1481 | src-tauri/src/acp/delegation/listener.rs:1520-1525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/listener.rs:1476` 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 first that the copies are not typed on the same thing: the declarations holding them bind `outcome` to `BrowserCaptureOutcome` in one and `ComputerCaptureOutcome` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) src-tauri/src/acp/question.rs:238— src-tauri/src/acp/question.rs:238-243 | src-tauri/src/acp/question.rs:520-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/browser/hooks.rs:255— src-tauri/src/browser/hooks.rs:255-260 | src-tauri/src/browser/hooks.rs:276-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/browser/hooks.rs:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/commands/acp.rs:10906— src-tauri/src/commands/acp.rs:10906-10911 | src-tauri/src/commands/acp.rs:11086-11091 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:10906` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/commands/folder_links.rs:542— src-tauri/src/commands/folder_links.rs:542-547 | src-tauri/src/commands/folder_links.rs:632-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/computer/helper/mcp.rs:269— src-tauri/src/computer/helper/mcp.rs:269-274 | src-tauri/src/computer/local.rs:356-361 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) src-tauri/src/db/service/canvas_service.rs:635— src-tauri/src/db/service/canvas_service.rs:635-640 | src-tauri/src/db/service/canvas_service.rs:1037-1042 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/db/service/token_usage_service.rs:153— src-tauri/src/db/service/token_usage_service.rs:153-158 | src-tauri/src/db/service/token_usage_service.rs:268-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.
Duplicated block (6 lines × 2) src-tauri/src/db/service/work_task_service.rs:2271— src-tauri/src/db/service/work_task_service.rs:2271-2276 | src-tauri/src/db/service/work_task_service.rs:2354-2359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/db/service/work_task_service.rs:2580— src-tauri/src/db/service/work_task_service.rs:2580-2585 | src-tauri/src/db/service/work_task_service.rs:2645-2650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2580` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/forge/gitea.rs:85— src-tauri/src/forge/gitea.rs:85-95 | src-tauri/src/forge/gitlab.rs:193-198 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/gitlab.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/forge/gitlab.rs:211— src-tauri/src/forge/gitlab.rs:211-216 | src-tauri/src/forge/gitlab.rs:290-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.
Duplicated block (6 lines × 2) src-tauri/src/lib.rs:1464— src-tauri/src/lib.rs:1464-1469 | src-tauri/src/lib.rs:1481-1486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/lib.rs:1464` 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) src-tauri/src/parsers/claude.rs:4134— src-tauri/src/parsers/claude.rs:4134-4139 | src-tauri/src/parsers/openclaw.rs:1057-1062 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/openclaw.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:4134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/parsers/cline.rs:1300— src-tauri/src/parsers/cline.rs:1300-1305 | src-tauri/src/parsers/codex.rs:7008-7013 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/cline.rs:1300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/parsers/codebuddy.rs:98— src-tauri/src/parsers/codebuddy.rs:98-103 | src-tauri/src/parsers/codebuddy.rs:195-200 — both copies are in the same file, so extract the block into 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) REDACTED:2474— REDACTED:2474-2479 | REDACTED:3235-3240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2474` 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) src-tauri/src/web/browser_bridge.rs:643— src-tauri/src/web/browser_bridge.rs:643-648 | src-tauri/src/web/browser_bridge.rs:723-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/web/browser_bridge.rs:643` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src-tauri/src/work_task/engine.rs:6506— src-tauri/src/work_task/engine.rs:6506-6511 | src-tauri/src/work_task/engine.rs:6518-6523 — both copies are in the same file, so extract the 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 (6 lines × 2) src-tauri/src/acp/background_watch.rs:1590— src-tauri/src/acp/background_watch.rs:1590-1595 | src-tauri/src/parsers/claude.rs:2313-2318 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/background_watch.rs:1590` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/acp/background_watch.rs:1589` calls `Some`, `get` and `src-tauri/src/parsers/claude.rs:2307` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) src-tauri/src/commands/browser.rs:1879— src-tauri/src/commands/browser.rs:1879-1884 | src-tauri/src/commands/browser.rs:2567-2572 — both copies are in the same file, so extract the 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 (6 lines × 2) src-tauri/src/db/service/token_usage_service.rs:162— src-tauri/src/db/service/token_usage_service.rs:162-167 | src-tauri/src/db/service/token_usage_service.rs:274-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/acp/file_system_runtime.rs:31— src-tauri/src/acp/file_system_runtime.rs:31-36 | src-tauri/src/acp/terminal_runtime.rs:57-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) src-tauri/src/acp_transcript.rs:183— src-tauri/src/acp_transcript.rs:183-188 | src-tauri/src/turn_timings.rs:334-339 — before extracting anything, compare `src-tauri/src/acp_transcript.rs` and `src-tauri/src/turn_timings.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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) src-tauri/src/acp/codex_catalog_commit/txn.rs:564— src-tauri/src/acp/codex_catalog_commit/txn.rs:564-572 | src-tauri/src/acp/codex_endpoint_catalog.rs:831-839 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/codex_catalog_commit/txn.rs:564` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src-tauri/src/acp/manager.rs:1286— src-tauri/src/acp/manager.rs:1286-1294 | src-tauri/src/acp/manager.rs:4634-4642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/manager.rs:1286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src-tauri/src/automation/engine.rs:217— src-tauri/src/automation/engine.rs:217-227 | src-tauri/src/work_task/engine.rs:476-484 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/automation/engine.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 (9 lines × 2) src-tauri/src/automation/engine.rs:1104— src-tauri/src/automation/engine.rs:1104-1112 | src-tauri/src/work_task/engine.rs:1015-1023 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/automation/engine.rs:1104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src-tauri/src/browser/shim/windows.rs:1413— src-tauri/src/browser/shim/windows.rs:1413-1421 | src-tauri/src/browser/shim/windows.rs:1508-1516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/browser/shim/windows.rs:1413` 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) src-tauri/src/browser/surface_child.rs:1159— src-tauri/src/browser/surface_child.rs:1159-1167 | src-tauri/src/browser/surface_child.rs:1195-1203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src-tauri/src/chat_channel/backends/lark.rs:285— src-tauri/src/chat_channel/backends/lark.rs:285-293 | src-tauri/src/chat_channel/backends/lark.rs:305-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/backends/lark.rs:285` 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) src-tauri/src/cli_run/shim.rs:333— src-tauri/src/cli_run/shim.rs:333-341 | src-tauri/src/update/install.rs:1290-1298 — 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 (9 lines × 2) src-tauri/src/commands/acp.rs:3443— src-tauri/src/commands/acp.rs:3443-3451 | src-tauri/src/commands/acp.rs:3888-3896 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:3443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src-tauri/src/commands/backup/crypto.rs:109— src-tauri/src/commands/backup/crypto.rs:109-117 | src-tauri/src/commands/config_sync/crypto.rs:148-156 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) src-tauri/src/commands/custom_skills.rs:432— src-tauri/src/commands/custom_skills.rs:432-441 | src-tauri/src/commands/office_tools.rs:1198-1206 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/office_tools.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/custom_skills.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 (9 lines × 2) src-tauri/src/commands/deepseek_settings.rs:686— src-tauri/src/commands/deepseek_settings.rs:686-694 | src-tauri/src/commands/mcp.rs:2870-2878 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/deepseek_settings.rs:686` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src-tauri/src/commands/folders.rs:5209— src-tauri/src/commands/folders.rs:5209-5217 | src-tauri/src/commands/folders.rs:5287-5295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/commands/folders.rs:5208` calls `to_path_buf` and `src-tauri/src/commands/folders.rs:5286` 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) src-tauri/src/commands/folders.rs:5577— src-tauri/src/commands/folders.rs:5577-5585 | src-tauri/src/commands/folders.rs:5675-5683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:5577` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/commands/folders.rs:5575` calls `clone` and `src-tauri/src/commands/folders.rs:5673` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) src-tauri/src/commands/generative_ui.rs:287— src-tauri/src/commands/generative_ui.rs:287-295 | src-tauri/src/commands/generative_ui.rs:376-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/generative_ui.rs:287` 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) src-tauri/src/commands/mcp.rs:1147— src-tauri/src/commands/mcp.rs:1147-1155 | src-tauri/src/commands/mcp.rs:1261-1269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src-tauri/src/computer/targets.rs:1761— src-tauri/src/computer/targets.rs:1761-1769 | src-tauri/src/computer/targets.rs:1773-1781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src-tauri/src/db/service/work_task_service.rs:1727— src-tauri/src/db/service/work_task_service.rs:1727-1735 | src-tauri/src/db/service/work_task_service.rs:1805-1813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src-tauri/src/forge/gitea.rs:627— src-tauri/src/forge/gitea.rs:627-635 | src-tauri/src/forge/github.rs:1551-1559 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:627` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src-tauri/src/forge/gitea.rs:1314— src-tauri/src/forge/gitea.rs:1314-1322 | src-tauri/src/forge/github.rs:112-120 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:1314` 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) src-tauri/src/forge/github.rs:1761— src-tauri/src/forge/github.rs:1761-1769 | src-tauri/src/forge/github.rs:1817-1825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/github.rs:1761` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/forge/github.rs:1816` calls `json` and `src-tauri/src/forge/github.rs:1760` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) src-tauri/src/parsers/claude.rs:3477— src-tauri/src/parsers/claude.rs:3477-3485 | src-tauri/src/parsers/openclaw.rs:996-1004 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/openclaw.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 79 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) src-tauri/src/parsers/cline.rs:1173— src-tauri/src/parsers/cline.rs:1173-1181 | src-tauri/src/parsers/openclaw.rs:986-994 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src-tauri/src/parsers/deepseek.rs:1358— src-tauri/src/parsers/deepseek.rs:1358-1366 | src-tauri/src/parsers/kimi_code.rs:1295-1303 — before extracting anything, compare `src-tauri/src/parsers/deepseek.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) src-tauri/src/parsers/openclaw.rs:289— src-tauri/src/parsers/openclaw.rs:289-297 | src-tauri/src/parsers/openclaw.rs:320-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/openclaw.rs:289` 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.
+ 17 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file REDACTED: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 src/app/activity-gallery/page.gallery.tsx: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 src/browser-injected/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 src/components/merge/three-pane-merge-editor.tsx: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 src/components/settings/pet-marketplace-dialog.tsx: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 src/components/settings/quick-messages-settings.tsx: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 src/components/settings/pet-manager-section.tsx: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 src/browser-injected/helper.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 src/browser-injected/console.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 src/components/project-boot/hyperframes/hyperframes-launcher.tsx: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 src/components/settings/channel-list-tab.tsx: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 src/components/settings/appearance-settings.tsx: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 src/components/project-boot/shadcn/create-project-dialog.tsx: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 src/app/pet/_components/PetWindow.tsx: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 src/components/settings/font-settings-section.tsx: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 src/components/merge/merge-workspace.tsx: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 src/components/settings/workspace-background-section.tsx: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 src/components/settings/add-chat-channel-dialog.tsx: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 src/components/project-boot/shadcn/constants.ts: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 src/app/pet/_hooks/usePetDrag.ts: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 src/components/settings/edit-chat-channel-dialog.tsx: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 src/components/settings/pet-editor.tsx: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 src/components/ui/field.tsx: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 src/components/settings/model-provider-settings.tsx: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 src/components/settings/weixin-qrcode-dialog.tsx: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.
Configuration option is read nowhere src-tauri/src/acp/codex_catalog_commit/mod.rs:221— `CatalogMeta.pending_format` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/codex_endpoint_catalog.rs:520— `CatalogCounts.listed` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/delegation/companion.rs:108— `JsonRpcRequest.jsonrpc` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/remote_registry.rs:34— `RegistryAgentItem.website` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/remote_registry.rs:38— `RegistryAgentItem.license` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/session_info.rs:68— `SessionInfo.found` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/session_info.rs:88— `SessionInfo.workspace_name` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/session_info.rs:99— `SessionInfo.is_delegation_child` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/session_info.rs:101— `SessionInfo.stats` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/types.rs:1719— `AgentOptionsSnapshot.unapplied_config_ids` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/acp/types.rs:1914— `CodexSandboxSettings.has_permissions_table` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/browser/agent.rs:98— `ListenerIdentity.workdir` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/cli/args.rs:248— `GlobalArgs.no_color` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/cli_run/wire.rs:536— `Launch.requested` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/cli_run/wire.rs:538— `Launch.effective` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/cli_run/wire.rs:541— `Launch.unconfirmed` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/acp.rs:15352— `DeviceCodeUserCodeResp.interval` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/acp.rs:15392— `DeviceCodeTokenResp.code_challenge` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/config_sync/snapshot.rs:117— `ApplyReport.appearance` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/config_sync/webdav_sync.rs:260— `ConfigSyncState.last_pulled_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/experts.rs:173— `Manifest.codeg_version` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/experts.rs:175— `Manifest.installed_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/experts.rs:185— `ManifestEntry.installed_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/mcp.rs:5795— `OfficialIcon._mime_type` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere src-tauri/src/commands/mcp.rs:5797— `OfficialIcon._sizes` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
+ 15 more in this group — see findings.md.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×40
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/acp_transcript.rs:702— `open.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `compact_batch` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/keyring_store.rs:358— `std::fs::metadata(path)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `mode_bits` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/lib.rs:2456— `builder.plugin(tauri_plugin_window_state::Builder::new().with_state_flags(tauri_plugin_window_state::StateFlags::all()&!tauri_plugin_window_state::StateFlags::DECORATIONS,).with_denylist(&[crate::computer::indicator::INDICATOR_LABEL,crate::computer::marker::MARKER_LABEL,]).build(),).plugin(tauri_plugin_deep_link::init()).plugin(tauri_plugin_opener::init()).plugin(tauri_plugin_dialog::init()).plugin(tauri_plugin_updater::Builder::new().build()).plugin(tauri_plugin_process::init()).plugin(tauri_plugin_notification::init()).plugin(tauri_plugin_global_shortcut::Builder::new().build()).plugin(tauri_plugin_autostart::init(tauri_plugin_autostart::MacosLauncher::LaunchAgent,None,)).manage(ConnectionManager::new()).manage(crate::browser::BrowserRegistry::default()).manage(crate::browser::egress::EgressRegistry::default()).manage(crate::browser::BrowserDownloads::default()).manage(crate::browser::DocGuests::default()).manage(crate::browser::confirm::EvalConsent::new()).manage(crate::browser::open_request::OpenRequests::new()).manage(crate::browser::policy::BrowserPolicy::load()).manage(TerminalManager::new()).manage(ChatChannelManager::new()).manage(windows::SettingsWindowState::new()).manage(windows::CommitWindowState::new()).manage(windows::MergeWindowState::new()).manage(windows::AuxWindowState::new()).manage(workspace_windows::WorkspaceWindowSession::new()).manage(web::WebServerState::new()).manage(std::sync::Arc::new(crate::commands::remote_proxy::RemoteProxyState::new(),)).manage(std::sync::Arc::new(crate::workspace_transfer::WorkspaceTransferManager::new_from_env(),)).manage(std::sync::Arc::new(web::event_bridge::WebEventBroadcaster::new(),)).manage({let metrics=std::sync::Arc::new(crate::acp::EventBusMetrics::default());std::sync::Arc::new(crate::acp::InternalEventBus::new(metrics))}).manage(crate::pet_state_mapper::new_pet_state_handle()).manage(crate::update::new_update_state_handle()).setup(|app|{let app_data_dir=app.path().app_data_dir()?;let effective_data_dir=paths::resolve_effective_data_dir(&app_data_dir);let derived_data_dir=paths::desktop_data_dir(None,dirs::data_dir().as_deref(),&app.config().identifier,);if derived_data_dir.as_deref()!=Some(git_credential::absolutize(&app_data_dir).as_path()){tracing::warn!("[paths][WARN] the data directory derived at startup ({:?}) differs from Tauri's app_data_dir ({}); the database follows {}",derived_data_dir,app_data_dir.display(),effective_data_dir.display());}if let Some(home)=std::env::var_os("CODEG_HOME").filter(|s|!s.is_empty()){let home_path=git_credential::absolutize(std::path::Path::new(&home));if home_path!=effective_data_dir{tracing::warn!("[paths][WARN] CODEG_HOME ({}) and CODEG_DATA_DIR ({}) point at different roots. \
Uploads/pets follow CODEG_HOME; the database follows CODEG_DATA_DIR. \
Unset one or align them to avoid split state.",home_path.display(),effective_data_dir.display());}}let refused=match crate::runtime_lock::try_shared(&effective_data_dir){Ok(Some(lock))=>{app.manage(HeldRuntimeLock(lock));None}Ok(None)=>Some(format!("{} is in use by a `codeg-cli --standalone` server. Open Codeg again \
once that command has finished.",effective_data_dir.display())),Err(e)if crate::runtime_lock::locking_unsupported(&e)=>{tracing::warn!("[startup] {} cannot lock files ({e}); going on without, so a \
`codeg-cli --standalone` there would not see this window",effective_data_dir.display());None}Err(e)=>Some(format!("Codeg cannot lock its data directory {}: {e}",effective_data_dir.display())),};if let Some(message)=refused{use tauri_plugin_dialog::{DialogExt,MessageDialogKind};let handle=app.handle().clone();app.dialog().message(message).title("Codeg").kind(MessageDialogKind::Error).show(move|_|handle.exit(1));return Ok(());}let app_version=env!("CARGO_PKG_VERSION");let database=tauri::async_runtime::block_on(db::init_database(&effective_data_dir,app_version,)).map_err(|e|e.to_string())?;app.manage(database);if let Some(layout)=crate::cli_run::shim::layout(){std::thread::spawn(move||{if let Err(e)=layout.write(){tracing::warn!("[cli] this app's own codeg-cli: {e}");}});}let db=app.state::<db::AppDatabase>();tauri::async_runtime::block_on(network::proxy::init_proxy_from_db(&db.conn));tauri::async_runtime::block_on(crate::logging::init::apply_persisted_level(&db.conn,));if let Some(hub)=crate::logging::hub::log_hub(){hub.set_emitter(crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone(),));}tauri::async_runtime::block_on(windows::load_saved_zoom(&db.conn));tauri::async_runtime::block_on(windows::load_saved_appearance_mode(&db.conn));let tray_locale=tauri::async_runtime::block_on(crate::commands::system_settings::load_system_language_settings(&db.conn),).map(|settings|settings.language).unwrap_or_default();if let Err(err)=windows::install_tray_icon(app.handle(),tray_locale){tracing::error!("[Tray] failed to install tray icon: {err}");}std::thread::spawn(||{let _=std::panic::catch_unwind(||{crate::acp::binary_cache::migrate_legacy_root();crate::sweep_acp_binary_trash();crate::sweep_acp_scratch_dirs();});});tauri::async_runtime::spawn(crate::scratch_sweep_task());tauri::async_runtime::spawn(async move{let report=crate::commands::experts::ensure_central_experts_installed().await;if!report.errors.is_empty(){tracing::error!("[Experts] install finished with {} error(s): {:?}",report.errors.len(),report.errors);}else{tracing::info!("[Experts] install ok: installed={} updated={} pending_review={}",report.installed_count,report.updated_count,report.pending_user_review.len());}});tauri::async_runtime::spawn(async move{let report=crate::commands::science::ensure_central_science_installed().await;if!report.errors.is_empty(){tracing::error!("[Science] install finished with {} error(s): {:?}",report.errors.len(),report.errors);}else{tracing::info!("[Science] install ok: installed={} updated={} pending_review={}",report.installed_count,report.updated_count,report.pending_user_review.len());}});{let gc_conn=app.state::<db::AppDatabase>().conn.clone();let gc_data_dir=effective_data_dir.clone();tauri::async_runtime::spawn(async move{match crate::commands::conversations::gc_orphan_chat_dirs_core(&gc_conn,&gc_data_dir,).await{Ok(n)if n>0=>tracing::info!("[conversations] chat-dir GC: reclaimed {n} orphan scratch dir(s)"),Ok(_)=>{}Err(err)=>{tracing::error!("[conversations] chat-dir GC failed: {err}")}}});}{let db_for_shell=app.state::<db::AppDatabase>().conn.clone();let shell_config=app.state::<ConnectionManager>().terminal_shell_config();tauri::async_runtime::block_on(async move{crate::commands::system_settings::apply_persisted_terminal_settings(&db_for_shell,&shell_config,).await;});}{let db_for_close=app.state::<db::AppDatabase>().conn.clone();tauri::async_runtime::block_on(async move{crate::commands::system_settings::apply_persisted_close_behavior(&db_for_close,).await;});}{let db_for_sync=app.state::<db::AppDatabase>().conn.clone();let emitter=std::sync::Arc::new(web::event_bridge::EventEmitter::Tauri(app.handle().clone(),));tauri::async_runtime::spawn(async move{crate::commands::config_sync::auto_sync::run_auto_sync_loop(db_for_sync,emitter,env!("CARGO_PKG_VERSION").to_string(),).await;});}if let Some(scheduler)=crate::acp::codex_catalog_refresh::build(web::event_bridge::EventEmitter::Tauri(app.handle().clone()),){tauri::async_runtime::spawn(crate::acp::codex_catalog_refresh::run(scheduler));}{let db=db::AppDatabase{conn:app.state::<db::AppDatabase>().conn.clone(),};let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());tauri::async_runtime::spawn(async move{let n=crate::commands::folders::backfill_worktree_folder_aliases(&emitter,&db).await;if n>0{tracing::info!("[folders] labeled {n} worktree folder(s) by branch");}});}{let cm=app.state::<ConnectionManager>();let ccm=app.state::<ChatChannelManager>();cm.install_chat_channel(ccm.clone_ref());}{let ccm=app.state::<ChatChannelManager>();let broadcaster=app.state::<std::sync::Arc<web::event_bridge::WebEventBroadcaster>>();let db_conn=app.state::<db::AppDatabase>().conn.clone();let data_dir=effective_data_dir.clone();let ccm_ref=ccm.clone_ref();let br=broadcaster.inner().clone();let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();let cm=app.state::<ConnectionManager>().clone_ref();let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());tauri::async_runtime::spawn(async move{ccm_ref.start_background(br,bus,db_conn,data_dir,cm,emitter).await;});}{let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();let broadcaster=app.state::<std::sync::Arc<web::event_bridge::WebEventBroadcaster>>().inner().clone();let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());let pet_state_handle=app.state::<crate::pet_state_mapper::PetStateHandle>().inner().clone();tauri::async_runtime::spawn(crate::pet_state_mapper::pet_state_subscriber_task(bus,broadcaster,emitter,pet_state_handle,),);}{let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();let broadcaster=app.state::<std::sync::Arc<web::event_bridge::WebEventBroadcaster>>().inner().clone();let emitter=web::event_bridge::EventEmitter::Tauri(app.handle().clone());let manager=app.state::<ConnectionManager>().inner().clone_ref();let db_conn=app.state::<db::AppDatabase>().conn.clone();tauri::async_runtime::spawn(crate::pet_sessions::pet_sessions_subscriber_task(bus,broadcaster,emitter,manager,db_conn,),);}let broker_for_lifecycle={let cm_state=app.state::<ConnectionManager>();let db_conn=app.state::<db::AppDatabase>().conn.clone();let(broker,tokens,socket_path,feedback_config,question_config,session_info_config,chat_authoring_config,browser_tools_config,computer_tools_config,)=crate::app_state::build_delegation_stack(&cm_state,db_conn.clone(),effective_data_dir.clone(),);app.manage(broker.clone());app.manage(tokens.clone());app.manage(feedback_config.clone());app.manage(question_config.clone());app.manage(session_info_config.clone());app.manage(chat_authoring_config.clone());app.manage(browser_tools_config.clone());computer_tools_config.mark_served();app.manage(computer_tools_config.clone());app.manage(crate::commands::delegation::DelegationSocketPath(socket_path.clone(),));let broker_for_init=broker.clone();let db_for_init=db_conn.clone();let feedback_for_init=feedback_config.clone();let question_for_init=question_config.clone();let session_info_for_init=session_info_config.clone();let chat_authoring_for_init=chat_authoring_config.clone();let browser_tools_for_init=browser_tools_config.clone();let computer_tools_for_init=computer_tools_config.clone();tauri::async_runtime::block_on(async move{delegation_commands::apply_persisted_config(&db_for_init,&broker_for_init,).await;crate::commands::feedback::apply_persisted_feedback_config(&db_for_init,&feedback_for_init,).await;crate::commands::question::apply_persisted_question_config(&db_for_init,&question_for_init,).await;crate::commands::session_info::apply_persisted_session_info_config(&db_for_init,&session_info_for_init,).await;crate::commands::chat_authoring::apply_persisted_chat_authoring_config(&db_for_init,&chat_authoring_for_init,).await;crate::commands::browser_tools::apply_persisted_browser_tools_config(&db_for_init,&browser_tools_for_init,).await;crate::commands::computer_tools::apply_persisted_computer_tools_config(&db_for_init,&computer_tools_for_init,).await;crate::commands::generative_ui::install_generative_ui_skill(&db_for_init,).await;});let computer_service=crate::commands::computer::ComputerService::start(crate::commands::computer::ComputerHost::Desktop(app.handle().clone()),computer_tools_config.clone(),);app.manage(computer_service.clone());let listener_broker=broker.clone();let listener=crate::acp::delegation::listener::DelegationListener::new(listener_broker,tokens,std::sync::Arc::new(crate::acp::manager::ConnectionManagerParentLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),std::sync::Arc::new(crate::acp::manager::ConnectionManagerFeedbackLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),std::sync::Arc::new(crate::acp::manager::ConnectionManagerQuestionLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),std::sync::Arc::new(crate::commands::session_info::DbSessionInfoLookup::new(std::sync::Arc::new(db::AppDatabase{conn:db_conn.clone(),}),),),std::sync::Arc::new(crate::work_task::EngineWorkTaskTools),std::sync::Arc::new(crate::commands::chat_authoring::DbChatAuthoring::new(std::sync::Arc::new(db::AppDatabase{conn:db_conn.clone(),}),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone(),),chat_authoring_config.clone(),),),std::sync::Arc::new(crate::commands::browser::McpBrowserTools::new(app.handle().clone(),browser_tools_config.clone(),),),std::sync::Arc::new(crate::commands::computer::McpComputerTools::new(computer_service,)),std::sync::Arc::new(crate::acp::result_tool::ConnectionManagerResultLookup{manager:std::sync::Arc::new(cm_state.clone_ref()),},),);let service=crate::acp::delegation::service::DelegationService::new(listener,socket_path,);crate::acp::delegation::service::install(service.clone());tauri::async_runtime::spawn(async move{if let Err(e)=service.start().await{tracing::error!("[delegation] listener failed to start: {e}");}});broker};{let db_conn=app.state::<db::AppDatabase>().conn.clone();let cm=app.state::<ConnectionManager>().clone_ref();let bus=app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone();tauri::async_runtime::spawn(crate::acp::lifecycle_subscriber_task(db_conn,cm,bus,Some(broker_for_lifecycle),));}{let service=crate::cli_run::CliRunService::new(&app.state::<db::AppDatabase>(),&app.state::<ConnectionManager>(),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone(),effective_data_dir.clone(),crate::cli_run::wire::RuntimeKind::Desktop,);service.set_opener(std::sync::Arc::new(DesktopSessionOpener(app.handle().clone(),)));let access=crate::cli_run::CliAccess::new(service.clone(),effective_data_dir.clone());app.manage(service.clone());app.manage(access.clone());let db_conn=app.state::<db::AppDatabase>().conn.clone();tauri::async_runtime::spawn(async move{service.spawn_background();access.start_if_enabled(&db_conn).await;});}match tauri::async_runtime::block_on(web::load_web_service_config(&db.conn)){Ok(config)if config.auto_start=>{let port=config.port.unwrap_or(web::DEFAULT_WEB_SERVICE_PORT);let ws=app.state::<web::WebServerState>();if let Err(err)=tauri::async_runtime::block_on(web::do_start_web_server_tauri(app.handle().clone(),&ws,config.port,None,config.token,)){tracing::error!("[WEB] auto-start failed: {err}");notify_web_auto_start_failed(app.handle(),port,&err);}}Ok(_)=>{}Err(err)=>tracing::error!("[WEB] failed to load auto-start config: {err}"),}if let Some(idle_timeout)=crate::acp::idle_timeout_from_env(){let cm=app.state::<ConnectionManager>().clone_ref();tauri::async_runtime::spawn(crate::acp::idle_sweep_task(cm,idle_timeout,std::time::Duration::from_secs(crate::acp::SWEEP_INTERVAL_SECS),));}if let Some(idle_timeout)=crate::office_watch::idle_timeout_from_env(){tauri::async_runtime::spawn(crate::office_watch::office_watch_idle_sweep_task(idle_timeout,std::time::Duration::from_secs(crate::office_watch::SWEEP_INTERVAL_SECS),));}if let Some(engine)=crate::automation::build_engine(crate::db::AppDatabase{conn:app.state::<crate::db::AppDatabase>().conn.clone(),},app.state::<ConnectionManager>().clone_ref(),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone(),effective_data_dir.clone(),){tauri::async_runtime::spawn(crate::automation::run_automation_engine(engine));}if let Some(engine)=crate::work_task::build_task_engine(crate::db::AppDatabase{conn:app.state::<crate::db::AppDatabase>().conn.clone(),},app.state::<ConnectionManager>().clone_ref(),crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),app.state::<std::sync::Arc<crate::acp::InternalEventBus>>().inner().clone(),effective_data_dir.clone(),){tauri::async_runtime::spawn(crate::work_task::run_task_engine(engine));if let Some(processor)=crate::forge::auto::build(crate::db::AppDatabase{conn:app.state::<crate::db::AppDatabase>().conn.clone(),},crate::web::event_bridge::EventEmitter::Tauri(app.handle().clone()),){tauri::async_runtime::spawn(crate::forge::auto::run(processor));}}{use tauri_plugin_deep_link::DeepLinkExt;let handle=app.handle().clone();let _=app.deep_link().on_open_url(move|event|{let urls:Vec<String>=event.urls().iter().map(|url|url.to_string()).collect();crate::deep_link::handle_raw_urls(&handle,&urls);});#[cfg(all(not(debug_assertions),any(windows,target_os="linux")))]if let Err(e)=app.deep_link().register_all(){tracing::warn!("[deep-link] scheme registration failed: {e}");}}let startup_urls:Vec<String>={use tauri_plugin_deep_link::DeepLinkExt;app.deep_link().get_current().ok().flatten().unwrap_or_default().into_iter().map(|url|url.to_string()).collect()};let workspace_path=tauri::async_runtime::block_on(crate::deep_link::startup_workspace_path(&db::AppDatabase{conn:app.state::<db::AppDatabase>().conn.clone(),},&startup_urls,),);#[cfg(target_os="macos")]crate::browser::shim::macos::prefer_detached_inspector();let restore=tauri::async_runtime::block_on(workspace_windows::load_restore(&db.conn,startup_urls.iter().any(|url|crate::deep_link::parse_deep_link(url).is_some()),windows::can_hide_to_tray(),));if app.get_webview_window("main").is_none(){let url=tauri::WebviewUrl::App(workspace_path.into());let builder=tauri::WebviewWindowBuilder::new(app,"main",url).title("Codeg").inner_size(1260.0,860.0).min_inner_size(400.0,600.0).visible(restore.show_local());let builder=windows::apply_platform_window_style(builder);#[cfg(target_os="macos")]let builder=builder.traffic_light_position(windows::workspace_window_traffic_light_position(),);if let Ok(w)=builder.build(){windows::post_window_setup(&w);if!restore.show_local()&&w.is_visible().unwrap_or(false){let _=w.hide();}}}workspace_windows::begin_restore(app.handle(),restore);#[cfg(all(feature="browser-child",any(target_os="macos",target_os="windows",target_os="linux")))]crate::browser::surface_child::init_main_thread();crate::browser::surface_window::init_main_thread();#[cfg(feature="browser-smoke")]crate::browser::smoke::spawn_if_enabled(app.handle().clone());Ok(())}).on_menu_event(|app,event|{let id=event.id().as_ref().to_string();#[cfg(target_os="macos")]if crate::app_menu::handle_event(app,&id){return;}if id.starts_with(windows::TRAY_MENU_ID_PREFIX){match id.as_str(){windows::TRAY_MENU_ID_SHOW=>windows::show_main_window(app),windows::TRAY_MENU_ID_QUIT=>app.exit(0),_=>{}}return;}if!id.starts_with(windows::PET_MENU_ID_PREFIX){return;}let payload:serde_json::Value=if let Some(scale)=windows::pet_menu_scale_from_id(&id){serde_json::json!({"type":"scale","value":scale})}else if id==windows::PET_MENU_ID_OPEN_MANAGER{serde_json::json!({"type":"open_manager"})}else if id==windows::PET_MENU_ID_CLOSE{serde_json::json!({"type":"close"})}else{return;};use tauri::Emitter;let _=app.emit_to("pet","pet://menu-action",payload);}).on_window_event(|window,event|{let label=window.label().to_string();workspace_windows::on_window_event(window,event);if matches!(event,tauri::WindowEvent::Destroyed){browser_commands::close_all_for_owner(window.app_handle(),&label);}if(label=="settings"||label.starts_with("remote-settings-"))&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::SettingsWindowState>(){windows::restore_windows_after_settings(app,&state,&label);}}if(label.starts_with("commit-")||label.starts_with("remote-commit-"))&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::CommitWindowState>(){windows::restore_window_after_commit(app,&state,&label);}}if(label.starts_with("merge-")||label.starts_with("remote-merge-"))&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::MergeWindowState>(){windows::restore_window_after_merge(app,&state,&label);}if label.starts_with("merge-"){let app_clone=window.app_handle().clone();let label_clone=label.clone();tauri::async_runtime::spawn(async move{windows::cleanup_dangling_merge(&app_clone,&label_clone).await;});}}if matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){let app=window.app_handle();if let Some(state)=app.try_state::<windows::AuxWindowState>(){windows::restore_window_after_aux(app,&state,&label);}}if label=="pet"&&!APP_QUITTING.load(Ordering::Relaxed)&&matches!(event,tauri::WindowEvent::CloseRequested{..}|tauri::WindowEvent::Destroyed){if let Some(db)=window.app_handle().try_state::<db::AppDatabase>(){let conn=db.conn.clone();tauri::async_runtime::spawn(async move{persist_pet_closed(&conn).await});}}if label==windows::PET_PANEL_LABEL&&matches!(event,tauri::WindowEvent::Focused(false)){windows::close_pet_panel_on_blur(window.app_handle());}if label=="main"{if let tauri::WindowEvent::CloseRequested{api,..}=event{if!APP_QUITTING.load(Ordering::Relaxed){api.prevent_close();handle_main_close_request(window,&label);return;}let app=window.app_handle();if let Some(cm)=app.try_state::<ConnectionManager>(){let disconnected=tauri::async_runtime::block_on(cm.disconnect_by_owner_window(&label),);tracing::info!("[ACP] main window closing disconnected_connections={}",disconnected);}if let Some(tm)=app.try_state::<TerminalManager>(){let killed=tm.kill_by_owner_window(&label);tracing::info!("[TERM] main window closing killed_terminals={}",killed);}}}}).invoke_handler(tauri::generate_handler![browser_commands::browser_capabilities,browser_commands::browser_open_tab,browser_commands::browser_close,browser_commands::browser_set_bounds,browser_commands::browser_set_window_viewport,browser_commands::browser_set_visible,browser_commands::browser_freeze_frame,browser_commands::browser_navigate,browser_commands::browser_reload,browser_commands::browser_go_back,browser_commands::browser_go_forward,browser_commands::browser_stop,browser_commands::browser_open_devtools,browser_commands::browser_get_state,browser_commands::browser_list_tabs,browser_commands::browser_list_services,browser_commands::browser_clear_data,browser_commands::browser_find,browser_commands::browser_list_downloads,browser_commands::browser_reveal_download,browser_commands::browser_clear_downloads,browser_commands::browser_set_host_rules,browser_commands::browser_set_sign_in_user_agent,browser_commands::browser_set_blank_page_theme,browser_commands::browser_remove_profile,browser_commands::browser_doc_open,browser_commands::browser_doc_set_mode,browser_commands::browser_doc_state,browser_commands::browser_agent_grant,browser_commands::browser_agent_snapshot,browser_commands::browser_agent_act,browser_commands::browser_agent_console,browser_commands::browser_agent_capture,browser_commands::browser_agent_eval,browser_commands::browser_eval_decide,browser_commands::browser_answer_open_request,browser_commands::browser_pick_element,browser_commands::browser_pick_cancel,browser_commands::browser_page_capture,browser_commands::browser_page_console,conversations::list_conversations,conversations::get_conversation,conversations::list_all_conversations,conversations::list_child_conversations,conversations::list_opened_tabs,conversations::save_opened_tabs,conversations::import_local_conversations,conversations::scan_importable_sessions,conversations::import_selected_sessions,conversations::get_folder_conversation,conversations::get_folder_conversation_turns,conversations::get_folder_conversation_outline,conversations::list_folders,conversations::get_stats,conversations::get_sidebar_data,conversations::create_conversation,conversations::create_chat_conversation,conversations::create_chat_dir,conversations::update_conversation_status,conversations::update_conversation_title,conversations::update_conversation_pinned,assistant_commands::assistant_list,assistant_commands::assistant_create,assistant_commands::assistant_update,assistant_commands::assistant_delete,assistant_commands::assistant_reorder,conversation_tags::list_conversation_tags,conversation_tags::create_conversation_tag,conversation_tags::update_conversation_tag,conversation_tags::delete_conversation_tag,conversation_tags::reorder_conversation_tags,conversation_tags::update_conversation_tags,conversation_tags::get_conversation_branch_tag,conversation_tags::update_conversation_branch_tag,conversations::delete_conversation,conversations::move_conversations,folders::load_folder_history,folders::get_folder,folders::list_open_folder_details,folders::list_all_folder_details,folders::open_folder,folders::open_worktree_folder,folders::resolve_worktree_folder,folders::open_folder_in_workspace,folders::open_folder_by_id,open_in::open_in_code,folders::remove_folder_from_workspace,folders::list_folder_groups,folders::create_folder_group,folders::update_folder_group,folders::delete_folder_group,folders::apply_sidebar_layout,folders::set_folder_group,folders::update_folder_color,folders::update_folder_alias,folders::update_folder_default_agent,folder_links::list_folder_links,folder_links::preview_folder_links,folder_links::create_folder_links,folder_links::rename_folder_link,folder_links::repair_folder_link,folder_links::remove_folder_link,canvas_commands::canvas_list_boards,canvas_commands::canvas_create_board,canvas_commands::canvas_update_board,canvas_commands::canvas_delete_board,canvas_commands::canvas_list_nodes,canvas_commands::canvas_create_node,canvas_commands::canvas_group_into_region,canvas_commands::canvas_update_node,canvas_commands::canvas_move_nodes,canvas_commands::canvas_detach_member,canvas_commands::canvas_delete_node,canvas_commands::canvas_delete_nodes,folders::add_folder_to_history,folders::remove_folder_from_history,folders::create_folder_directory,folders::clone_repository,folders::get_git_branch,folders::get_git_head,folders::git_init,folders::git_pull,folders::git_start_pull_merge,folders::git_has_merge_head,folders::git_fetch,folders::git_update_branch,folders::git_push_info,folders::git_push,folders::git_new_branch,folders::git_worktree_add,folders::git_checkout,folders::git_reset,folders::git_list_branches,folders::git_stash_push,folders::git_stash_pop,folders::git_stash_list,folders::git_stash_apply,folders::git_stash_drop,folders::git_stash_clear,folders::git_stash_show,folders::git_status,folders::git_is_tracked,folders::git_diff,folders::git_diff_with_branch,folders::git_show_diff,folders::git_show_file,folders::git_show_file_base64,folders::git_commit,commit_message_commands::git_generate_commit_message,commit_message_commands::git_generate_commit_message_cancel,commit_message_commands::get_commit_message_settings,commit_message_commands::set_commit_message_settings,commit_message_commands::delete_commit_message_settings,folders::git_rollback_file,folders::git_add_files,folders::git_list_all_branches,folders::git_list_remotes,folders::git_fetch_remote,folders::git_add_remote,folders::git_remove_remote,folders::git_set_remote_url,folders::git_merge,folders::git_rebase,folders::git_delete_branch,folders::git_remove_worktree,folders::git_delete_remote_branch,folders::git_list_conflicts,folders::git_conflict_file_versions,folders::git_resolve_conflict,folders::git_abort_operation,folders::git_continue_operation,workspace_state_commands::start_workspace_state_stream,workspace_state_commands::stop_workspace_state_stream,workspace_state_commands::get_workspace_snapshot,folders::get_home_directory,folders::list_directory_entries,crate::commands::create_directory::create_directory,folders::list_directory_with_files,folders::get_file_tree,folders::list_workspace_files,crate::commands::workspace_file_search::search_workspace_files,crate::commands::workspace_file_search::cancel_workspace_file_search,crate::commands::workspace_file_search::prepare_workspace_file_search,folders::read_file_base64,folders::read_workspace_file_base64,folders::read_file_preview,folders::read_file_for_edit,folders::save_file_content,folders::save_file_copy,folders::rename_file_tree_entry,folders::move_file_tree_entry,folders::delete_file_tree_entry,folders::create_file_tree_entry,folders::git_log,folders::git_current_user,folders::git_commit_files,folders::git_search_authors,folders::git_commit_branches,windows::open_folder_window,windows::open_commit_window,windows::open_settings_window,windows::open_merge_window,windows::open_stash_window,windows::open_push_window,windows::open_project_boot_window,windows::open_import_sessions_window,windows::open_local_workspace,remote_workspace_commands::list_remote_workspace_connections,remote_workspace_commands::create_remote_workspace_connection,remote_workspace_commands::update_remote_workspace_connection,remote_workspace_commands::delete_remote_workspace_connection,remote_workspace_commands::test_remote_workspace_connection,remote_workspace_commands::get_remote_workspace_connection,remote_workspace_commands::reorder_remote_workspace_connections,remote_workspace_commands::open_remote_workspace,workspace_windows::take_workspace_restore_failures,remote_proxy_commands::remote_http_call,remote_proxy_commands::remote_cache_forge_image,remote_proxy_commands::remote_upload_attachment,remote_proxy_commands::remote_upload_workspace_paths,remote_proxy_commands::remote_cancel_workspace_transfer,remote_proxy_commands::remote_download_workspace_file,remote_proxy_commands::remote_download_workspace_dir,remote_proxy_commands::read_local_file_for_upload,remote_proxy_commands::remote_ws_subscribe,remote_proxy_commands::remote_ws_unsubscribe,remote_proxy_commands::remote_ws_send_text,windows::open_pet_window,windows::close_pet_window,windows::pet_window_record_position,windows::pet_show_context_menu,windows::toggle_pet_panel,windows::close_pet_panel,windows::resize_pet_panel,windows::focus_conversation,crate::deep_link::take_pending_deep_link,windows::update_traffic_light_position,windows::update_appearance_mode,windows::set_tray_locale,pet_commands::pet_list,pet_commands::pet_get,pet_commands::pet_read_spritesheet,pet_commands::pet_add,pet_commands::pet_update_meta,pet_commands::pet_replace_sprite,pet_commands::pet_delete,pet_commands::pet_list_importable_codex,pet_commands::pet_import_codex,pet_commands::pet_codex_import_available,pet_commands::pet_get_settings,pet_commands::pet_set_active,pet_commands::pet_save_window_state,pet_commands::pet_marketplace_list,pet_commands::pet_marketplace_install,pet_commands::pet_marketplace_asset,pet_commands::pet_celebrate,pet_commands::pet_get_current_state,pet_commands::pet_list_active_sessions,background_commands::background_read,background_commands::background_set,background_commands::background_clear,background_commands::background_market_search,background_commands::background_market_asset,background_commands::background_market_download,app_update_commands::app_update_state,app_update_commands::perform_app_update,app_update_commands::restart_app,project_boot::detect_package_manager,project_boot::create_shadcn_project,project_boot::detect_hyperframes_skills,project_boot::install_hyperframes_skills,project_boot::create_hyperframes_project,system_settings::get_system_proxy_settings,system_settings::update_system_proxy_settings,system_settings::get_system_language_settings,system_settings::update_system_language_settings,system_settings::get_system_terminal_settings,system_settings::update_system_terminal_settings,system_settings::get_available_terminal_shells,system_settings::probe_terminal_shell_path,system_settings::get_system_rendering_settings,system_settings::update_system_rendering_settings,system_settings::get_system_autostart_settings,system_settings::update_system_autostart_settings,system_settings::get_system_close_behavior_settings,system_settings::update_system_close_behavior_settings,system_settings::resolve_close_request,logging_commands::get_log_settings,logging_commands::set_log_settings,logging_commands::get_recent_logs,logging_commands::list_log_files,logging_commands::open_logs_dir,delegation_commands::get_delegation_settings,delegation_commands::set_delegation_settings,crate::commands::mcp_service::get_codeg_mcp_service_status,crate::commands::mcp_service::start_codeg_mcp_service,crate::commands::mcp_service::set_codeg_mcp_tool_group,feedback_commands::get_feedback_settings,feedback_commands::set_feedback_settings,feedback_commands::submit_session_feedback,question_commands::get_question_settings,question_commands::set_question_settings,session_info_commands::get_session_info_settings,session_info_commands::set_session_info_settings,chat_authoring_commands::get_chat_authoring_settings,chat_authoring_commands::set_chat_authoring_settings,crate::commands::browser_tools::get_browser_tools_settings,crate::commands::browser_tools::set_browser_tools_settings,crate::commands::computer_tools::get_computer_tools_settings,crate::commands::computer_tools::set_computer_tools_settings,crate::commands::computer_tools::set_computer_tools_enabled,crate::commands::computer_tools::set_computer_tools_preferences,crate::commands::computer::computer_status,crate::commands::computer::computer_request_permission,crate::commands::computer::computer_open_permission_settings,crate::commands::computer::computer_reveal_helper,crate::commands::computer::computer_list_shareable_windows,crate::commands::computer::computer_window_thumbnail,crate::commands::computer::computer_share_window,crate::commands::computer::computer_share_windows,crate::commands::computer::computer_share_app,crate::commands::computer::computer_share_screen,crate::commands::computer::computer_revoke_all,crate::commands::computer::computer_stop,crate::commands::computer::computer_shared_state,crate::commands::computer::computer_stop_key_status,crate::commands::computer::computer_indicator_fit,crate::commands::computer::computer_driver_info,crate::commands::computer::computer_driver_install,crate::commands::computer::computer_driver_uninstall,version_control::detect_git,version_control::test_git_path,version_control::get_git_settings,version_control::update_git_settings,version_control::get_github_accounts,version_control::validate_github_token,version_control::validate_gitlab_token,version_control::validate_gitea_token,version_control::validate_cnb_token,version_control::update_github_accounts,version_control::save_account_token,version_control::get_account_token,version_control::delete_account_token,acp_commands::acp_preflight,acp_commands::acp_cursor_auth_status,acp_commands::acp_cursor_list_models,acp_commands::acp_qoder_auth_status,acp_commands::acp_connect,acp_commands::acp_prompt,acp_commands::acp_set_mode,acp_commands::acp_set_config_option,acp_commands::acp_goal_control,acp_commands::acp_describe_agent_options,acp_commands::acp_cancel,acp_commands::acp_fork,acp_commands::acp_stop_async_task,acp_commands::acp_respond_permission,acp_commands::acp_answer_question,acp_commands::acp_answer_plan_approval,acp_commands::acp_disconnect,acp_commands::acp_touch_connection,acp_commands::acp_list_connections,acp_commands::acp_get_session_snapshot,acp_commands::acp_get_session_snapshot_by_conversation,acp_commands::acp_find_connection_for_conversation,acp_commands::acp_list_agents,acp_commands::acp_get_agent_status,acp_commands::acp_env_diagnostics,acp_commands::acp_clear_binary_cache,acp_commands::acp_scan_leaked_temp,acp_commands::acp_reclaim_leaked_temp,acp_commands::acp_download_agent_binary,acp_commands::acp_update_system_agent,acp_commands::acp_install_uv_tool,acp_commands::acp_detect_agent_local_version,acp_commands::acp_fetch_agent_latest_release,acp_commands::acp_prepare_npx_agent,acp_commands::acp_uninstall_agent,acp_commands::acp_update_agent_preferences,acp_commands::acp_update_agent_env,acp_commands::acp_update_agent_config,acp_commands::acp_update_hermes_config,acp_commands::acp_update_claude_model_picker,acp_commands::acp_update_kimi_code_config,deepseek_settings_commands::acp_load_deepseek_model_catalog,deepseek_settings_commands::acp_update_deepseek_model_catalog,acp_commands::acp_update_pi_config,acp_commands::acp_load_pi_config,acp_commands::acp_list_pi_model_capabilities,acp_commands::acp_validate_pi_command,acp_commands::acp_sync_antigravity_settings,acp_commands::acp_antigravity_login_start,acp_commands::acp_antigravity_login_finish,acp_commands::acp_antigravity_login_cancel,acp_commands::acp_antigravity_sign_out,acp_commands::acp_pi_project_trust_state,acp_commands::acp_pi_set_project_trust,acp_commands::acp_pi_acknowledge_project_trust,acp_commands::acp_pi_list_trust_entries,acp_commands::acp_install_pi_binary,acp_commands::acp_uninstall_pi_binary,acp_commands::acp_open_hermes_setup_terminal,acp_commands::acp_reveal_hermes_home,acp_commands::acp_reorder_agents,crate::commands::custom_agents::acp_list_custom_agents,crate::commands::custom_agents::acp_save_custom_agent,crate::commands::custom_agents::acp_delete_custom_agent,crate::commands::custom_agents::acp_fetch_registry_catalog,crate::commands::custom_agents::acp_add_registry_agent,crate::commands::custom_agents::acp_current_platform,acp_commands::acp_list_agent_skills,acp_commands::acp_list_agent_runtime_skills,acp_commands::acp_read_agent_skill,acp_commands::acp_save_agent_skill,acp_commands::acp_delete_agent_skill,acp_commands::opencode_list_plugins,acp_commands::opencode_provider_catalog,acp_commands::codex_bundled_catalog,crate::commands::opencode_credentials::opencode_list_integrations,crate::commands::opencode_credentials::opencode_connect_key,crate::commands::opencode_credentials::opencode_disconnect_provider,crate::commands::codex_catalog::codex_catalog_plan_preview,crate::commands::codex_catalog::codex_fetch_endpoint_catalog,crate::commands::codex_catalog::codex_endpoint_catalog_published,crate::commands::codex_catalog::codex_endpoint_catalog_cached,crate::commands::codex_catalog::codex_endpoint_catalog_status,crate::commands::codex_catalog::codex_refresh_endpoint_catalog,acp_commands::opencode_add_plugin,acp_commands::opencode_remove_plugin,acp_commands::codex_request_device_code,acp_commands::codex_poll_device_code,experts_commands::experts_list,experts_commands::experts_get_install_status,experts_commands::experts_list_all_install_statuses,experts_commands::experts_link_to_agent,experts_commands::experts_unlink_from_agent,experts_commands::experts_apply_links,experts_commands::experts_read_content,experts_commands::experts_open_central_dir,science_commands::science_list,science_commands::science_get_install_status,science_commands::science_list_all_install_statuses,science_commands::science_link_to_agent,science_commands::science_unlink_from_agent,science_commands::science_apply_links,science_commands::science_read_content,science_commands::science_open_central_dir,crate::commands::generative_ui::generative_ui_skill_info,crate::commands::generative_ui::generative_ui_list_all_install_statuses,crate::commands::generative_ui::generative_ui_apply_links,crate::commands::generative_ui::generative_ui_read_content,custom_skills_commands::custom_list,custom_skills_commands::custom_list_all_install_statuses,custom_skills_commands::custom_apply_links,custom_skills_commands::custom_read_skill,custom_skills_commands::custom_create_skill,custom_skills_commands::custom_save_skill,custom_skills_commands::custom_duplicate_skill,custom_skills_commands::custom_import_skill,custom_skills_commands::custom_import_from_agent,custom_skills_commands::custom_delete_skills,office_tools_commands::officecli_detect,office_tools_commands::officecli_install,office_tools_commands::officecli_uninstall,office_tools_commands::officecli_list_skills,office_tools_commands::officecli_sync_skills,office_tools_commands::officecli_skill_link_to_agent,office_tools_commands::officecli_skill_unlink_from_agent,office_tools_commands::officecli_skill_get_install_status,office_tools_commands::officecli_skill_list_all_install_statuses,office_tools_commands::officecli_skill_apply_links,office_tools_commands::officecli_skill_read_content,office_tools_commands::officecli_render_html,office_tools_commands::start_office_watch,office_tools_commands::stop_office_watch,office_tools_commands::renew_office_watch,folder_commands::list_folder_commands,folder_commands::create_folder_command,folder_commands::update_folder_command,folder_commands::delete_folder_command,folder_commands::reorder_folder_commands,folder_commands::bootstrap_folder_commands_from_package_json,local_command::run_local_command,quick_messages_commands::quick_messages_list,quick_messages_commands::quick_messages_create,quick_messages_commands::quick_messages_update,quick_messages_commands::quick_messages_delete,quick_messages_commands::quick_messages_reorder,automation_commands::automation_list,automation_commands::automation_get,automation_commands::automation_runs,automation_commands::automation_create,automation_commands::automation_update,automation_commands::automation_set_enabled,automation_commands::automation_delete,automation_commands::automation_mark_seen,automation_commands::automation_compute_next_run,automation_commands::automation_run_now,automation_commands::automation_cancel_run,token_usage_commands::token_usage_report,token_usage_commands::token_usage_facets,token_usage_commands::token_usage_status,token_usage_commands::token_usage_sync,work_task_commands::work_task_list,work_task_commands::work_task_get,work_task_commands::work_task_events,work_task_commands::work_task_attention_count,work_task_commands::work_task_create,work_task_commands::work_task_update,work_task_commands::work_task_reorder,work_task_commands::work_task_delete,work_task_commands::work_task_start,work_task_commands::work_task_start_all,work_task_commands::work_task_retry,work_task_commands::work_task_requeue,work_task_commands::work_task_schedule,work_task_commands::work_task_return,work_task_commands::work_task_cancel,work_task_commands::work_task_stop_background_wait,work_task_commands::work_task_merge,work_task_commands::work_task_merge_unqueue,work_task_commands::work_task_deliver_pr,work_task_commands::work_task_complete,work_task_commands::work_task_archive,work_task_commands::work_task_defer,work_task_commands::work_task_set_writeback,work_task_commands::work_task_cleanup,work_task_commands::work_task_diff,work_task_commands::work_task_changed_files,work_task_commands::work_task_uncommitted_files,work_task_commands::work_task_settings_get,work_task_commands::work_task_settings_get_own,work_task_commands::work_task_settings_effective,work_task_commands::work_task_settings_set,work_task_commands::work_task_settings_delete,work_task_commands::work_task_template_list,work_task_commands::work_task_template_save,work_task_commands::work_task_template_delete,forge_commands::folder_forge_remote,forge_commands::forge_list_issues,forge_commands::forge_issue_detail,forge_commands::forge_read_image,forge_commands::forge_tab_count,forge_commands::forge_list_labels,forge_commands::forge_list_comments,forge_commands::forge_create_comment,forge_commands::forge_set_item_state,forge_commands::forge_create_issue,forge_commands::forge_change_detail,forge_commands::forge_check_summaries,forge_commands::forge_approve_workflows,forge_commands::forge_change_files,forge_commands::forge_identity,forge_commands::forge_merge_options,forge_commands::forge_merge_change,forge_commands::work_task_create_from_forge,forge_commands::work_task_create_from_forge_issues,forge_commands::work_task_lookup_by_source,forge_commands::forge_settings_get,forge_commands::forge_settings_set,forge_commands::forge_auto_status,forge_commands::forge_auto_scan_now,terminal_commands::terminal_spawn,terminal_commands::terminal_write,terminal_commands::terminal_resize,terminal_commands::terminal_snapshot,terminal_commands::terminal_kill,terminal_commands::terminal_list,mcp_commands::mcp_scan_local,mcp_commands::mcp_list_marketplaces,mcp_commands::mcp_search_marketplace,mcp_commands::mcp_get_marketplace_server_detail,mcp_commands::mcp_install_from_marketplace,mcp_commands::mcp_upsert_local_server,mcp_commands::mcp_set_server_apps,mcp_commands::mcp_remove_server,notification::send_notification,notification::notification_identity,notification::open_system_notification_settings,file_io::save_binary_file,file_io::save_text_file,file_io::save_pasted_attachment,clipboard_commands::copy_files_to_clipboard,clipboard_commands::read_clipboard_files,config_sync::config_sync_export_file,config_sync::config_sync_peek_file,config_sync::config_sync_import_file,config_sync::config_sync_get_settings,config_sync::config_sync_update_settings,config_sync::config_sync_get_state,config_sync::config_sync_test_connection,config_sync::config_sync_upload_now,config_sync::config_sync_peek_remote,config_sync::config_sync_download_apply,config_sync::config_sync_export_content,config_sync::config_sync_peek_content,config_sync::config_sync_import_content,config_sync::config_sync_list_rollbacks,config_sync::config_sync_apply_rollback,config_sync::config_sync_mirror_appearance,backup::backup_create,backup::backup_prepare_source,backup::backup_release_source,backup::backup_scan_external_conflicts,backup::backup_restore_stage,backup::backup_cancel,backup::backup_list_safety_snapshots,backup::backup_rollback,backup::backup_discard_pending,backup::backup_active_agents,chat_channel_commands::list_chat_channels,chat_channel_commands::create_chat_channel,chat_channel_commands::update_chat_channel,chat_channel_commands::delete_chat_channel,chat_channel_commands::save_chat_channel_token,chat_channel_commands::get_chat_channel_has_token,chat_channel_commands::delete_chat_channel_token,chat_channel_commands::connect_chat_channel,chat_channel_commands::disconnect_chat_channel,chat_channel_commands::test_chat_channel,chat_channel_commands::get_chat_channel_status,chat_channel_commands::list_chat_channel_messages,chat_channel_commands::get_chat_command_prefix,chat_channel_commands::set_chat_command_prefix,chat_channel_commands::get_chat_event_filter,chat_channel_commands::set_chat_event_filter,chat_channel_commands::get_chat_event_webhooks,chat_channel_commands::set_chat_event_webhooks,chat_channel_commands::get_chat_event_top_level_only,chat_channel_commands::set_chat_event_top_level_only,chat_channel_commands::get_chat_message_language,chat_channel_commands::set_chat_message_language,chat_channel_commands::weixin_get_qrcode,chat_channel_commands::weixin_check_qrcode,model_provider_commands::list_model_providers,model_provider_commands::create_model_provider,model_provider_commands::update_model_provider,model_provider_commands::delete_model_provider,model_provider_commands::list_provider_models,web::start_web_server,web::stop_web_server,web::get_web_server_status,crate::commands::cli_access::cli_access_status,crate::commands::cli_access::cli_access_set_enabled,crate::commands::cli_access::cli_tool_status,crate::commands::cli_access::cli_tool_install,web::get_web_service_config,web::update_web_service_config,web::probe_web_service_port,]).build(context)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/process.rs:221— `Command::new("/bin/sh").args(["-c","printf '%s' \"$2\" > \"$1\"","sh"]).arg(path).arg(content).stdin(std::process::Stdio::null()).status()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `write_test_script` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/process.rs:228— `std::fs::set_permissions(path,std::fs::Permissions::from_mode(0o755))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `write_test_script` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/work_task/engine.rs:1477— `task.conversation_id` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `launch` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/web/ws_attach.rs:167— `events.last()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handle_attach` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/terminal/manager.rs:1082— `terminals.remove(terminal_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `finish_terminal_reader` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:33— `Regex::new(concat!(r"(?s)",r"<system-reminder>.*?</system-reminder>",r"|<local-command-caveat>.*?</local-command-caveat>",r"|<command-name>.*?</command-name>",r"|<command-message>.*?</command-message>",r"|<command-args>.*?</command-args>",r"|<local-command-stdout>.*?</local-command-stdout>",r"|<user-prompt-submit-hook>.*?</user-prompt-submit-hook>",r"|<task-notification>.*?</task-notification>",r"|<fast_mode_info>.*?</fast_mode_info>",))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `system_tag_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:130— `Regex::new(r"(?s)<note>(.*?)</note>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_note_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:184— `Regex::new(r"(?s)<task-id>(.*?)</task-id>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_task_id_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:189— `Regex::new(r"(?s)<status>(.*?)</status>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_status_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:194— `Regex::new(r"(?s)<summary>(.*?)</summary>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_summary_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:205— `Regex::new(r"(?s)<tool-use-id>(.*?)</tool-use-id>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_tool_use_id_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:210— `Regex::new(r"(?s)<result>(.*?)</result>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `task_notification_result_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:236— `Regex::new(r"(?s)<command-name>(.*?)</command-name>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `command_name_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:242— `Regex::new(r"(?s)<command-args>(.*?)</command-args>")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `command_args_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:580— `snapshot.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `goal_status_transition` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:947— `Regex::new(&format!(r"\A\s*{}[^\n]*\n(?:[ \t]*\r?\n)*(?:[ \t]*<system-reminder>[\s\S]*?</system-reminder>[ \t]*\r?\n(?:[ \t]*\r?\n)*)*(?:[ \t]*Summary:[ \t]*\r?\n)?",regex::escape(CONTEXT_CONTINUATION_PREFIX)))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `continuation_preamble_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:2444— `messages.last_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `feed_value` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/claude.rs:2446— `content.into_iter().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `feed_value` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/codex.rs:1731— `Regex::new(r"…\d+ chars truncated…")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `codex_truncated_mcp_result_preview` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/codex.rs:3932— `pending_exec_scripts.keys().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_conversation_detail` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/codex.rs:6013— `Regex::new(r"(?s)\A# AGENTS\.md instructions for [^\n]+\n\s*\n<INSTRUCTIONS>.*?</INSTRUCTIONS>\s*",)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `agents_instructions_regex` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded src-tauri/src/parsers/codex.rs:7150— `Regex::new(r"@([^\s@]+)\s*\[blocked[^\]]*\]")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `strip_blocked_resource_mentions` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Duplicated block (10 lines × 2) src-tauri/src/acp/connection.rs:9466— src-tauri/src/acp/connection.rs:9466-9475 | src-tauri/src/acp/connection.rs:9634-9643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/acp/connection.rs:14909— src-tauri/src/acp/connection.rs:14909-14918 | src-tauri/src/acp/connection.rs:15283-15292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:14909` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src-tauri/src/acp/connection.rs:24904— src-tauri/src/acp/connection.rs:24904-24913 | src-tauri/src/acp/connection.rs:24980-24989 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/acp/lifecycle.rs:1608— src-tauri/src/acp/lifecycle.rs:1608-1617 | src-tauri/src/parsers/codex_code_mode.rs:2325-2334 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/lifecycle.rs:1608` it does not close everything it opens, so those 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) src-tauri/src/chat_channel/backends/telegram.rs:28— src-tauri/src/chat_channel/backends/telegram.rs:28-37 | src-tauri/src/chat_channel/backends/weixin.rs:267-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) src-tauri/src/chat_channel/session_commands.rs:917— src-tauri/src/chat_channel/session_commands.rs:917-926 | src-tauri/src/chat_channel/session_commands.rs:1311-1320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/session_commands.rs:917` 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) src-tauri/src/commands/experts.rs:321— src-tauri/src/commands/experts.rs:321-330 | src-tauri/src/commands/science.rs:289-298 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) src-tauri/src/commands/experts.rs:946— src-tauri/src/commands/experts.rs:946-955 | src-tauri/src/commands/science.rs:767-776 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:946` 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) src-tauri/src/commands/folders.rs:5365— src-tauri/src/commands/folders.rs:5365-5374 | src-tauri/src/commands/folders.rs:5467-5477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:5365` 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) src-tauri/src/commands/system_settings.rs:708— src-tauri/src/commands/system_settings.rs:708-717 | src-tauri/src/web/handlers/system_settings.rs:99-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) src-tauri/src/computer/helper/driver_proc.rs:616— src-tauri/src/computer/helper/driver_proc.rs:616-625 | src-tauri/src/computer/helper/driver_proc.rs:641-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/computer/helper/driver_proc.rs:616` 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) src-tauri/src/computer/helper/driver_proc.rs:632— src-tauri/src/computer/helper/driver_proc.rs:632-641 | src-tauri/src/computer/local.rs:311-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) src-tauri/src/db/service/app_metadata_service.rs:21— src-tauri/src/db/service/app_metadata_service.rs:21-30 | src-tauri/src/db/service/app_metadata_service.rs:73-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/app_metadata_service.rs:21` 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) src-tauri/src/db/service/folder_service.rs:160— src-tauri/src/db/service/folder_service.rs:160-169 | src-tauri/src/db/service/folder_service.rs:323-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.
Duplicated block (10 lines × 2) src-tauri/src/db/service/folder_service.rs:349— src-tauri/src/db/service/folder_service.rs:349-358 | src-tauri/src/db/service/folder_service.rs:372-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/db/service/work_task_service.rs:1316— src-tauri/src/db/service/work_task_service.rs:1316-1325 | src-tauri/src/db/service/work_task_service.rs:1446-1455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/db/service/work_task_service.rs:2970— src-tauri/src/db/service/work_task_service.rs:2970-2979 | src-tauri/src/db/service/work_task_service.rs:3030-3039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2970` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src-tauri/src/forge/cnb.rs:396— src-tauri/src/forge/cnb.rs:396-405 | src-tauri/src/forge/gitea.rs:412-421 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/gitea.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/cnb.rs:396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src-tauri/src/forge/github.rs:653— src-tauri/src/forge/github.rs:653-662 | src-tauri/src/forge/github.rs:1420-1429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/github.rs:653` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src-tauri/src/parsers/codebuddy.rs:467— src-tauri/src/parsers/codebuddy.rs:467-476 | src-tauri/src/parsers/pi.rs:456-465 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/pi.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:467` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src-tauri/src/parsers/codex.rs:1503— src-tauri/src/parsers/codex.rs:1503-1512 | src-tauri/src/parsers/codex.rs:1549-1559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codex.rs:1503` it does not close everything it opens, so those 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) REDACTED:2638— REDACTED:2638-2647 | REDACTED:2692-2701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2638` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src-tauri/src/web/handlers/files.rs:1056— src-tauri/src/web/handlers/files.rs:1056-1065 | src-tauri/src/web/handlers/workspace_files.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 `src-tauri/src/web/handlers/files.rs:1056` 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, `src-tauri/src/web/handlers/files.rs:1054` calls `Err`, `upload_too_large` and `src-tauri/src/web/handlers/workspace_files.rs:396` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) src-tauri/src/commands/acp.rs:10330— src-tauri/src/commands/acp.rs:10330-10339 | src-tauri/src/commands/custom_skills.rs:206-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. 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) src-tauri/src/parsers/mod.rs:1702— src-tauri/src/parsers/mod.rs:1702-1711 | src-tauri/src/parsers/mod.rs:1712-1721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/mod.rs:1702` it begins part-way through the construct above it, so those 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: ClaudeRecordAccumulator.feed_value src-tauri/src/parsers/claude.rs:2020— MethodTooLong — feed_value runs 475 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 375 over it, 4.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: DelegationBroker.start_delegation_inner src-tauri/src/acp/delegation/broker.rs:2484— MethodTooLong — start_delegation_inner runs 373 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 273 over it, 3.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionState.apply_event_inner src-tauri/src/acp/session_state.rs:1206— MethodTooLong — apply_event_inner runs 361 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 261 over it, 3.61× 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: DelegationBroker.resume_with_context src-tauri/src/acp/delegation/broker.rs:4281— MethodTooLong — resume_with_context runs 357 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 257 over it, 3.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TaskEngine.launch src-tauri/src/work_task/engine.rs:1279— MethodTooLong — launch runs 268 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 168 over it, 2.68× 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: ConnectionManager.send_prompt_linked_full src-tauri/src/acp/manager.rs:1511— MethodTooLong — send_prompt_linked_full 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: Migration.up src-tauri/src/db/migration/m20260211_000001_init.rs:8— MethodTooLong — up runs 238 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 138 over it, 2.38× 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: CliRunService.launch_steps src-tauri/src/cli_run/service.rs:730— MethodTooLong — launch_steps runs 218 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 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WeixinBackend.start src-tauri/src/chat_channel/backends/weixin.rs:438— MethodTooLong — start runs 192 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 92 over it, 1.92× 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: OpenCodeParser.load_sqlite_parts REDACTED:478— MethodTooLong — load_sqlite_parts runs 187 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 87 over it, 1.87× 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: Migration.up src-tauri/src/db/migration/m20260621_000001_automation.rs:9— MethodTooLong — up runs 176 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 76 over it, 1.76× 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: CodeBuddyParser.parse_detail src-tauri/src/parsers/codebuddy.rs:187— MethodTooLong — parse_detail runs 170 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 70 over it, 1.70× 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: TelegramBackend.start src-tauri/src/chat_channel/backends/telegram.rs:204— MethodTooLong — start runs 167 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Migration.up src-tauri/src/db/migration/m20260801_000001_work_task.rs:8— MethodTooLong — up runs 158 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 58 over it, 1.58× 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: OpenClawParser.parse_conversation_detail src-tauri/src/parsers/openclaw.rs:509— MethodTooLong — parse_conversation_detail runs 151 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 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenCodeParser.load_v2_messages REDACTED:798— MethodTooLong — load_v2_messages runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TaskEngine.merge_task_inner src-tauri/src/work_task/engine.rs:4200— MethodTooLong — merge_task_inner runs 129 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 29 over it, 1.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: AutoProcessor.scan_into src-tauri/src/forge/auto/mod.rs:476— MethodTooLong — scan_into runs 127 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 27 over it, 1.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: DelegationListener.serve_one src-tauri/src/acp/delegation/listener.rs:444— MethodTooLong — serve_one runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TerminalManager.spawn_with_id src-tauri/src/terminal/manager.rs:438— MethodTooLong — spawn_with_id runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LarkBackend.start_ws_receiver src-tauri/src/chat_channel/backends/lark.rs:257— MethodTooLong — start_ws_receiver runs 121 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 21 over it, 1.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: TaskEngine.deliver_pr_closing src-tauri/src/work_task/engine.rs:4739— MethodTooLong — deliver_pr_closing runs 121 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 21 over it, 1.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: ClineParser.legacy_conversation src-tauri/src/parsers/cline.rs:755— MethodTooLong — legacy_conversation runs 120 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WatchState.tick src-tauri/src/acp/background_watch.rs:1130— MethodTooLong — tick runs 115 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WatchState.account src-tauri/src/acp/background_watch.rs:1563— MethodTooLong — account runs 113 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (5 lines × 2) src-tauri/src/acp/manager.rs:2225— src-tauri/src/acp/manager.rs:2225-2229 | src-tauri/src/acp/manager.rs:2302-2308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/manager.rs:2225` it does not close everything it opens, so those 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) src-tauri/src/cli/commands.rs:29— src-tauri/src/cli/commands.rs:29-33 | src-tauri/src/cli/commands.rs:83-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 (5 lines × 2) src-tauri/src/commands/acp.rs:6029— src-tauri/src/commands/acp.rs:6029-6033 | src-tauri/src/commands/acp.rs:14595-14599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:6029` 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) src-tauri/src/commands/mcp.rs:1173— src-tauri/src/commands/mcp.rs:1173-1178 | src-tauri/src/commands/mcp.rs:1360-1364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1173` 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) src-tauri/src/commands/mcp.rs:1605— src-tauri/src/commands/mcp.rs:1605-1617 | src-tauri/src/commands/mcp.rs:4153-4157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1605` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/parsers/acp_native.rs:853— src-tauri/src/parsers/acp_native.rs:853-857 | src-tauri/src/parsers/acp_native.rs:869-873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/acp_native.rs:853` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/parsers/claude.rs:2924— src-tauri/src/parsers/claude.rs:2924-2929 | src-tauri/src/parsers/openclaw.rs:669-673 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/openclaw.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 79 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) src-tauri/src/parsers/hermes.rs:210— src-tauri/src/parsers/hermes.rs:210-214 | REDACTED:234-240 — before extracting anything, compare `src-tauri/src/parsers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 167 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) src-tauri/src/automation/engine.rs:917— src-tauri/src/automation/engine.rs:917-921 | src-tauri/src/work_task/engine.rs:3936-3940 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) src-tauri/src/commands/experts.rs:1062— src-tauri/src/commands/experts.rs:1062-1066 | src-tauri/src/commands/science.rs:877-881 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 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) src-tauri/src/commands/acp.rs:10862— src-tauri/src/commands/acp.rs:10862-10866 | src-tauri/src/commands/acp.rs:11020-11028 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:10862` 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) src-tauri/src/acp/file_system_runtime.rs:1181— src-tauri/src/acp/file_system_runtime.rs:1181-1185 | src-tauri/src/commands/folders.rs:4543-4550 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:4543` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/commands/acp.rs:6110— src-tauri/src/commands/acp.rs:6110-6114 | src-tauri/src/commands/acp.rs:15207-15212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:6110` it begins part-way through the construct above it, so those exact lines 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) REDACTED:318— REDACTED:318-323 | REDACTED:502-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/parsers/codex.rs:3554— src-tauri/src/parsers/codex.rs:3554-3559 | src-tauri/src/parsers/codex.rs:4209-4213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codex.rs:3554` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/acp/cursor_ext.rs:115— src-tauri/src/acp/cursor_ext.rs:115-119 | src-tauri/src/acp/question.rs:519-523 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/cursor_ext.rs:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/db/service/work_task_service.rs:2211— src-tauri/src/db/service/work_task_service.rs:2211-2215 | src-tauri/src/db/service/work_task_service.rs:2336-2340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/commands/acp.rs:5437— src-tauri/src/commands/acp.rs:5437-5441 | src-tauri/src/commands/acp.rs:5473-5477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:5437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/commands/acp.rs:13217— src-tauri/src/commands/acp.rs:13217-13221 | src-tauri/src/commands/acp.rs:13586-13590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:13217` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/acp/delegation/companion.rs:2009— src-tauri/src/acp/delegation/companion.rs:2009-2013 | src-tauri/src/acp/delegation/companion.rs:4440-4444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/commands/acp.rs:10761— src-tauri/src/commands/acp.rs:10761-10765 | src-tauri/src/commands/acp.rs:10792-10796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/commands/acp.rs:5587— src-tauri/src/commands/acp.rs:5587-5591 | src-tauri/src/commands/acp.rs:9790-9794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/acp/codex_endpoint_catalog.rs:796— src-tauri/src/acp/codex_endpoint_catalog.rs:796-800 | src-tauri/src/cli_run/shim.rs:298-302 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) src-tauri/src/acp/delegation/companion.rs:2424— src-tauri/src/acp/delegation/companion.rs:2424-2428 | src-tauri/src/acp/delegation/companion.rs:3095-3099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/companion.rs:2424` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src-tauri/src/db/service/token_usage_service.rs:617— src-tauri/src/db/service/token_usage_service.rs:617-621 | src-tauri/src/db/service/token_usage_service.rs:714-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/db/service/token_usage_service.rs:613` calls `is_empty`, `Ok` and `src-tauri/src/db/service/token_usage_service.rs:713` 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.
Focus outline removed inline src/app/pet/_components/PetBadge.tsx:44— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/automations/automation-editor.tsx:346— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/browser/browser-toolbar.tsx:368— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/canvas/nodes/note-node.tsx:122— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/chat/chat-width-handles.tsx:310— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/chat/composer-connection-status.tsx:207— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/chat/composer/composer-add-menu.tsx:240— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/chat/conversation-context-bar.tsx:515— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/chat/model-option-list.tsx:232— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/chat/session-settings-picker.tsx:399— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/conversations/session-details-content.tsx:299— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/conversations/sidebar-conversation-card.tsx:393— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/conversations/sidebar-conversation-card.tsx:521— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/conversations/sidebar-conversation-list.tsx:617— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/conversations/sidebar-conversation-list.tsx:652— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/conversations/sidebar-conversation-list.tsx:808— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/conversations/sidebar-folder-group-header.tsx:370— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/diff/image-diff-view.tsx:324— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/files/pdf-viewer.tsx:538— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/forge/pattern-list-input.tsx:99— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/layout/branch-dropdown.tsx:656— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/layout/branch-selector-list.tsx:742— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/layout/command-dropdown.tsx:348— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/layout/command-dropdown.tsx:398— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/components/layout/git-log-branch-filter-list.tsx:531— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
+ 1 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×23
Edited copy of a member (10 corresponding lines) src-tauri/src/acp/delegation/broker.rs:2129— src-tauri/src/acp/delegation/broker.rs:2129-2138 | src-tauri/src/acp/delegation/broker.rs:2173-2191 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/acp.rs:3780— src-tauri/src/commands/acp.rs:3780-3789 | src-tauri/src/commands/acp.rs:7206-7217 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/mcp.rs:4838— src-tauri/src/commands/mcp.rs:4838-4847 | src-tauri/src/commands/mcp.rs:4851-4862 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/db/service/conversation_service.rs:168— src-tauri/src/db/service/conversation_service.rs:168-178 | src-tauri/src/db/service/work_task_service.rs:2419-2428 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/acp/delegation/transport.rs:530— src-tauri/src/acp/delegation/transport.rs:530-541 | src-tauri/src/bin/codeg_mcp.rs:170-179 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/db/service/thread_binding_service.rs:102— src-tauri/src/db/service/thread_binding_service.rs:102-111 | src-tauri/src/db/service/thread_binding_service.rs:116-125 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/computer/codesign.rs:355— src-tauri/src/computer/codesign.rs:355-364 | src-tauri/src/computer/codesign.rs:368-384 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/backup/core.rs:265— src-tauri/src/commands/backup/core.rs:265-274 | src-tauri/src/commands/backup/source.rs:253-262 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/acp/connection.rs:1890— src-tauri/src/acp/connection.rs:1890-1904 | src-tauri/src/acp/connection.rs:1915-1924 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/experts.rs:392— src-tauri/src/commands/experts.rs:392-401 | src-tauri/src/commands/science.rs:356-365 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/db/service/work_task_service.rs:381— src-tauri/src/db/service/work_task_service.rs:381-390 | src-tauri/src/db/service/work_task_service.rs:412-421 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/acp.rs:6655— src-tauri/src/commands/acp.rs:6655-6667 | src-tauri/src/parsers/codex.rs:6964-6973 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/mcp.rs:6242— src-tauri/src/commands/mcp.rs:6242-6251 | src-tauri/src/commands/mcp.rs:7163-7172 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/db/service/automation_service.rs:238— src-tauri/src/db/service/automation_service.rs:238-247 | src-tauri/src/db/service/work_task_service.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) src-tauri/src/commands/custom_agents.rs:263— src-tauri/src/commands/custom_agents.rs:263-272 | src-tauri/src/parsers/mod.rs:581-592 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/generative_ui.rs:623— src-tauri/src/commands/generative_ui.rs:623-632 | src-tauri/src/commands/generative_ui.rs:634-643 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/parsers/codex.rs:962— src-tauri/src/parsers/codex.rs:962-971 | src-tauri/src/parsers/codex.rs:973-982 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/backup/mod.rs:244— src-tauri/src/commands/backup/mod.rs:244-253 | src-tauri/src/commands/backup/mod.rs:257-267 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/parsers/cursor.rs:1954— src-tauri/src/parsers/cursor.rs:1954-1963 | src-tauri/src/parsers/grok.rs:1936-1945 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/science/skills/hypothesis-generation/scripts/generate_preregistration_scaffold.py:370— src-tauri/science/skills/hypothesis-generation/scripts/generate_preregistration_scaffold.py:370-379 | src-tauri/science/skills/peer-review/scripts/generate_review_scaffold.py:68-77 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/experts.rs:245— src-tauri/src/commands/experts.rs:245-254 | src-tauri/src/commands/science.rs:210-219 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/commands/office_tools.rs:672— src-tauri/src/commands/office_tools.rs:672-681 | src-tauri/src/acp/connection.rs:12815-12824 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src-tauri/src/parsers/cursor.rs:1921— src-tauri/src/parsers/cursor.rs:1921-1933 | src-tauri/src/parsers/grok.rs:1419-1428 — 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.
Duplicated block (12 lines × 2) src-tauri/src/acp/delegation/listener.rs:772— src-tauri/src/acp/delegation/listener.rs:772-783 | src-tauri/src/acp/delegation/listener.rs:812-823 — both copies are in the same file, so extract the 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 `req` to `BrokerCancelTaskRequest` in one and `BrokerResumeTaskRequest` 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) src-tauri/src/acp/manager.rs:228— src-tauri/src/acp/manager.rs:228-239 | src-tauri/src/acp/manager.rs:264-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src-tauri/src/cli/commands.rs:36— src-tauri/src/cli/commands.rs:36-47 | src-tauri/src/cli/commands.rs:90-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/cli/commands.rs:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/commands/acp.rs:11532— src-tauri/src/commands/acp.rs:11532-11543 | src-tauri/src/commands/acp.rs:12894-12905 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src-tauri/src/commands/experts.rs:360— src-tauri/src/commands/experts.rs:360-371 | src-tauri/src/commands/science.rs:324-335 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:360` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/commands/experts.rs:644— src-tauri/src/commands/experts.rs:644-655 | src-tauri/src/commands/science.rs:463-474 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:644` it begins part-way through the construct above it, so those 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 `meta` to `&ExpertMetadata` in one and `&ScienceMetadata` 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) src-tauri/src/commands/folders.rs:5345— src-tauri/src/commands/folders.rs:5345-5356 | src-tauri/src/commands/folders.rs:5424-5435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:5345` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/commands/folders.rs:5773— src-tauri/src/commands/folders.rs:5773-5784 | src-tauri/src/commands/folders.rs:5869-5880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:5773` 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) src-tauri/src/commands/mcp.rs:1510— src-tauri/src/commands/mcp.rs:1510-1521 | src-tauri/src/commands/mcp.rs:1551-1562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1510` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/forge/gitea.rs:1325— src-tauri/src/forge/gitea.rs:1325-1336 | src-tauri/src/forge/github.rs:127-138 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:1325` 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) src-tauri/src/pet_state_mapper.rs:144— src-tauri/src/pet_state_mapper.rs:144-155 | src-tauri/src/pet_state_mapper.rs:192-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/pet_state_mapper.rs:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/pet_state_mapper.rs:208` calls `remove` and `src-tauri/src/pet_state_mapper.rs:156` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) src-tauri/src/update/install.rs:642— src-tauri/src/update/install.rs:642-653 | src-tauri/src/update/install.rs:700-711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/update/install.rs:700` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/web/handlers/files.rs:650— src-tauri/src/web/handlers/files.rs:650-661 | src-tauri/src/web/handlers/files.rs:665-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/web/handlers/files.rs:650` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/commands/experts.rs:307— src-tauri/src/commands/experts.rs:307-318 | src-tauri/src/commands/science.rs:275-286 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:307` 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) src-tauri/src/parsers/cursor.rs:1670— src-tauri/src/parsers/cursor.rs:1670-1681 | src-tauri/src/parsers/cursor.rs:1820-1831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/cursor.rs:1670` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/work_task/engine.rs:5259— src-tauri/src/work_task/engine.rs:5259-5270 | src-tauri/src/work_task/engine.rs:6006-6020 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/work_task/engine.rs:5259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/src/acp/delegation/companion.rs:2795— src-tauri/src/acp/delegation/companion.rs:2795-2806 | src-tauri/src/acp/delegation/companion.rs:3228-3239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/companion.rs:2795` 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) src-tauri/src/commands/folders.rs:409— src-tauri/src/commands/folders.rs:409-420 | src-tauri/src/commands/folders.rs:431-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 `src-tauri/src/commands/folders.rs:409` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:257— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:257-268 | src-tauri/science/skills/peer-review/scripts/_common.py:230-241 — before extracting anything, compare `src-tauri/science/skills/hypothesis-generation/scripts/_common.py` and `src-tauri/science/skills/peer-review/scripts/_common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) src-tauri/science/skills/hypothesis-generation/scripts/generate_preregistration_scaffold.py:355— src-tauri/science/skills/hypothesis-generation/scripts/generate_preregistration_scaffold.py:355-366 | src-tauri/science/skills/peer-review/scripts/generate_review_scaffold.py:53-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) src-tauri/src/db/test_helpers.rs:29— src-tauri/src/db/test_helpers.rs:29-40 | src-tauri/src/db/test_helpers.rs:47-58 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/test_helpers.rs:29` 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.
IC1 · Incompleteness & stubs· Empty method body · ×21
Empty method body — does nothing with its inputs src-tauri/src/acp/connection.rs:11080— `handle_cursor_update_todos` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/acp/connection.rs:11093— `handle_cursor_task` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/acp/connection.rs:11101— `handle_cursor_generate_image` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/acp/delegation/companion.rs:97— `send_broker_cancel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/acp/event_stream.rs:81— `send` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/acp/manager.rs:724— `install_delegation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/acp/manager.rs:731— `install_chat_channel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/browser/shim/linux_child.rs:201— `refresh_user_agent` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/browser/surface_window.rs:666— `navigating_to` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/browser/surface_window.rs:823— `adopt` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/browser/surface_window.rs:825— `forget` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/browser/surface_window.rs:827— `navigating_to` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/cli/run.rs:722— `cancel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/cli_run/service.rs:512— `set_opener` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/commands/backup/source.rs:206— `cleanup_prepared_sources` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/commands/remote_proxy.rs:1219— `emit_workspace_transfer_progress` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/lib.rs:201— `persist_pet_closed` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/logging/hub.rs:199— `apply_settings` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/logging/panic_hook.rs:178— `set_log_file` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/network/webdav.rs:307— `log_status` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs src-tauri/src/work_task/git.rs:367— `delete_ref` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Duplicated block (11 lines × 2) src-tauri/src/acp/connection.rs:2586— src-tauri/src/acp/connection.rs:2586-2596 | src-tauri/src/acp/connection.rs:2719-2729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:2586` 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) src-tauri/src/acp/connection.rs:8914— src-tauri/src/acp/connection.rs:8914-8924 | src-tauri/src/acp/connection.rs:8982-8992 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:8914` 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) src-tauri/src/acp/connection.rs:12002— src-tauri/src/acp/connection.rs:12002-12012 | src-tauri/src/acp/connection.rs:12150-12160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src-tauri/src/acp/delegation/broker.rs:2889— src-tauri/src/acp/delegation/broker.rs:2889-2899 | src-tauri/src/acp/delegation/broker.rs:4573-4583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:2889` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/acp/delegation/broker.rs:4572` calls `remove_completed` and `src-tauri/src/acp/delegation/broker.rs:2887` 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) src-tauri/src/acp/delegation/listener.rs:1488— src-tauri/src/acp/delegation/listener.rs:1488-1498 | src-tauri/src/acp/delegation/listener.rs:1532-1542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/listener.rs:1488` 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 `outcome` to `BrowserCaptureOutcome` in one and `ComputerCaptureOutcome` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) src-tauri/src/acp/file_system_runtime.rs:993— src-tauri/src/acp/file_system_runtime.rs:993-1006 | src-tauri/src/acp/file_system_runtime.rs:1038-1048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/file_system_runtime.rs:993` it begins part-way through the construct above it, so those 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 `request` to `ReadTextFileRequest` in one and `WriteTextFileRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) src-tauri/src/browser/shim/macos.rs:251— src-tauri/src/browser/shim/macos.rs:251-261 | src-tauri/src/browser/shim/macos.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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/browser/shim/macos.rs:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src-tauri/src/commands/computer.rs:1524— src-tauri/src/commands/computer.rs:1524-1534 | src-tauri/src/commands/computer.rs:1609-1619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src-tauri/src/commands/folders.rs:3316— src-tauri/src/commands/folders.rs:3316-3326 | src-tauri/src/commands/folders.rs:3411-3421 — both copies are in the same file, so extract the 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 (11 lines × 2) src-tauri/src/commands/remote_proxy.rs:880— src-tauri/src/commands/remote_proxy.rs:880-890 | src-tauri/src/commands/remote_proxy.rs:1295-1305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/remote_proxy.rs:880` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src-tauri/src/computer/helper/driver_proc.rs:530— src-tauri/src/computer/helper/driver_proc.rs:530-540 | src-tauri/src/computer/local.rs:1218-1228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/computer/helper/driver_proc.rs:530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src-tauri/src/forge/gitea.rs:161— src-tauri/src/forge/gitea.rs:161-171 | src-tauri/src/forge/github.rs:338-348 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:161` 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) src-tauri/src/parsers/grok.rs:944— src-tauri/src/parsers/grok.rs:944-954 | src-tauri/src/parsers/grok.rs:972-982 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/grok.rs:944` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src-tauri/src/parsers/hermes.rs:523— src-tauri/src/parsers/hermes.rs:523-533 | REDACTED:112-122 — before extracting anything, compare `src-tauri/src/parsers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/hermes.rs:523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src-tauri/src/db/service/work_task_service.rs:1860— src-tauri/src/db/service/work_task_service.rs:1860-1870 | src-tauri/src/db/service/work_task_service.rs:3122-3132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:1860` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) src-tauri/src/acp/binary_cache.rs:221— src-tauri/src/acp/binary_cache.rs:221-231 | src-tauri/src/acp/cursor_acp_retry_compat.rs:991-1001 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) src-tauri/src/commands/acp.rs:80— src-tauri/src/commands/acp.rs:80-90 | src-tauri/src/commands/office_tools.rs:492-502 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.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.
Duplicated block (11 lines × 2) src-tauri/src/forge/gitea.rs:153— src-tauri/src/forge/gitea.rs:153-163 | src-tauri/src/forge/gitlab.rs:271-282 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/gitlab.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src-tauri/src/computer/helper/mod.rs:720— src-tauri/src/computer/helper/mod.rs:720-731 | src-tauri/src/computer/helper/mod.rs:1035-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/computer/helper/mod.rs:720` 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) src-tauri/src/work_task/engine.rs:819— src-tauri/src/work_task/engine.rs:819-829 | src-tauri/src/work_task/engine.rs:914-925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/work_task/engine.rs:819` it begins part-way through the construct above it, so those 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· Edited copy of a member (9 corresponding lines) · ×19
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/forge.rs:1229— src-tauri/src/commands/forge.rs:1229-1237 | src-tauri/src/commands/forge.rs:1283-1291 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/forge.rs:870— src-tauri/src/commands/forge.rs:870-882 | src-tauri/src/commands/forge.rs:889-897 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/experts.rs:681— src-tauri/src/commands/experts.rs:681-689 | src-tauri/src/commands/science.rs:500-508 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/acp/delegation/transport.rs:1008— src-tauri/src/acp/delegation/transport.rs:1008-1017 | src-tauri/src/acp/delegation/transport.rs:1020-1028 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/acp/connection.rs:18772— src-tauri/src/acp/connection.rs:18772-18780 | src-tauri/src/parsers/grok.rs:1312-1320 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/backup/archive.rs:329— src-tauri/src/commands/backup/archive.rs:329-337 | src-tauri/src/commands/backup/external.rs:1047-1055 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/computer_tools.rs:215— src-tauri/src/commands/computer_tools.rs:215-224 | src-tauri/src/network/proxy.rs:138-146 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/acp/delegation/listener.rs:1133— src-tauri/src/acp/delegation/listener.rs:1133-1141 | src-tauri/src/acp/delegation/listener.rs:1148-1156 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/update/install.rs:1051— src-tauri/src/update/install.rs:1051-1063 | src-tauri/src/update/install.rs:1714-1722 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/conversations.rs:2788— src-tauri/src/commands/conversations.rs:2788-2797 | src-tauri/src/commands/model_provider.rs:609-617 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/parsers/codebuddy.rs:671— src-tauri/src/parsers/codebuddy.rs:671-681 | REDACTED:1533-1541 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/science/skills/scientific-visualization/scripts/palette_audit.py:83— src-tauri/science/skills/scientific-visualization/scripts/palette_audit.py:83-91 | src-tauri/science/skills/scientific-visualization/scripts/style_presets.py:144-152 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/db/service/work_task_service.rs:3309— src-tauri/src/db/service/work_task_service.rs:3309-3317 | src-tauri/src/db/service/work_task_service.rs:3359-3369 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/acp/connection.rs:265— src-tauri/src/acp/connection.rs:265-273 | src-tauri/src/acp/connection.rs:805-817 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/folders.rs:682— src-tauri/src/commands/folders.rs:682-690 | src-tauri/src/commands/folders.rs:825-833 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/commands/config_sync/appearance.rs:126— src-tauri/src/commands/config_sync/appearance.rs:126-134 | src-tauri/src/commands/config_sync/webdav_sync.rs:653-661 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/web/handlers/backup.rs:333— src-tauri/src/web/handlers/backup.rs:333-343 | src-tauri/src/web/handlers/config_sync.rs:183-191 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/acp/lifecycle.rs:86— src-tauri/src/acp/lifecycle.rs:86-96 | src-tauri/src/cli_run/service.rs:2913-2921 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src-tauri/src/cli/mod.rs:44— src-tauri/src/cli/mod.rs:44-52 | src-tauri/src/cli_run/service.rs:226-238 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×19
Edited copy of a member (13 corresponding lines) src-tauri/src/acp/delegation/companion.rs:2194— src-tauri/src/acp/delegation/companion.rs:2194-2213 | src-tauri/src/acp/delegation/companion.rs:2248-2260 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/db/service/work_task_service.rs:485— src-tauri/src/db/service/work_task_service.rs:485-499 | src-tauri/src/db/service/work_task_service.rs:503-515 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/acp/connection.rs:318— src-tauri/src/acp/connection.rs:318-331 | src-tauri/src/acp/connection.rs:342-354 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/acp/codex_runtime.rs:491— src-tauri/src/acp/codex_runtime.rs:491-507 | src-tauri/src/commands/acp.rs:623-635 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/commands/acp.rs:2408— src-tauri/src/commands/acp.rs:2408-2420 | src-tauri/src/commands/acp.rs:2505-2520 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/chat_channel/session_commands.rs:238— src-tauri/src/chat_channel/session_commands.rs:238-250 | src-tauri/src/chat_channel/session_commands.rs:258-270 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/commands/chat_channel.rs:289— src-tauri/src/commands/chat_channel.rs:289-302 | src-tauri/src/commands/chat_channel.rs:341-353 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/acp/session_state.rs:2325— src-tauri/src/acp/session_state.rs:2325-2358 | src-tauri/src/acp/session_state.rs:2360-2372 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/commands/folders.rs:3738— src-tauri/src/commands/folders.rs:3738-3750 | src-tauri/src/commands/folders.rs:3772-3784 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/commands/version_control.rs:128— src-tauri/src/commands/version_control.rs:128-140 | src-tauri/src/commands/version_control.rs:173-185 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/chat_channel/session_commands.rs:99— src-tauri/src/chat_channel/session_commands.rs:99-111 | src-tauri/src/chat_channel/session_commands.rs:281-293 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/commands/backup/source.rs:190— src-tauri/src/commands/backup/source.rs:190-202 | src-tauri/src/web/handlers/backup.rs:406-418 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/web/browser_bridge.rs:1368— src-tauri/src/web/browser_bridge.rs:1368-1380 | src-tauri/src/web/handlers/office_watch_proxy.rs:158-171 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/commands/folders.rs:922— src-tauri/src/commands/folders.rs:922-934 | src-tauri/src/commands/folders.rs:942-955 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/acp/question.rs:2088— src-tauri/src/acp/question.rs:2088-2102 | src-tauri/src/parsers/qoder.rs:1199-1211 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/web/handlers/opencode_credentials.rs:34— src-tauri/src/web/handlers/opencode_credentials.rs:34-46 | src-tauri/src/web/handlers/opencode_credentials.rs:57-69 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/acp/agent_process.rs:547— src-tauri/src/acp/agent_process.rs:547-560 | src-tauri/src/acp/terminal_runtime.rs:1021-1033 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/acp/codex_catalog_commit/mod.rs:384— src-tauri/src/acp/codex_catalog_commit/mod.rs:384-397 | src-tauri/src/acp/opencode_plugins.rs:311-323 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src-tauri/src/parsers/codebuddy.rs:1300— src-tauri/src/parsers/codebuddy.rs:1300-1312 | src-tauri/src/parsers/pi.rs:1429-1441 — 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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×19
Recursive walk over a caller-supplied document has no depth cap src-tauri/src/parsers/grok.rs:1471— `cap_json_to_budget` is public, takes a document from its caller (line 1419) and hands it to `cap_json_string_values`, which calls itself at line 1471 with a piece of the document (and at line 1476) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `cap_json_string_values` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src-tauri/src/agent_turn_files/extract.rs:147— `extract_tool_call_paths` is public, takes a document from its caller (line 65) and hands it to `walk_input`, which calls itself at line 147 with a piece of the document (and at line 152) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `walk_input` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src-tauri/src/acp/event_stream.rs:275— `json_value_size` is public and takes `value: &serde_json::Value` from its caller, and it calls itself at line 275 with a piece of the document (and at line 282) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `json_value_size` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src-tauri/src/acp/opencode_config.rs:114— `cst_value` is public and takes `value: &Value` from its caller, and it calls itself at line 114 with a piece of the document (and at line 117) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `cst_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src-tauri/science/skills/paper-lookup/scripts/jats_to_text.py:115— `element_text` is public, takes a document from its caller (line 99) and hands it to `walk`, which calls itself at line 115 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:55— `leafIds` is exported and takes `tree: LayoutNode` from its caller, and it calls itself at line 55 (`leafIds`) with a piece of `tree` — and nowhere in `leafIds` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `leafIds` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:59— `firstLeafId` is exported and takes `tree: LayoutNode` from its caller, and it calls itself at line 59 (`firstLeafId`) with a piece of `tree` — and nowhere in `firstLeafId` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `firstLeafId` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:72— `parentSplitOf` is exported and takes `tree: LayoutNode` from its caller, and it calls itself at line 72 (`parentSplitOf`) with a piece of `tree` — and nowhere in `parentSplitOf` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `parentSplitOf` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:107— `splitGroup` is exported, takes a document from its caller (line 129) and hands it to `collapse`, which calls itself at line 107 (`collapse`) with a piece of `node` — and nowhere in `collapse` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `collapse` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:165— `splitGroup` is exported, takes a document from its caller (line 129) and hands it to `walk`, which calls itself at line 165 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:184— `removeGroup` is exported, takes a document from its caller (line 178) and hands it to `prune`, which calls itself at line 184 (`prune`) with a piece of `node` — and nowhere in `prune` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `prune` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:215— `removeGroup` is exported, takes a document from its caller (line 178) and hands it to `prune`, which calls itself at line 215 (`prune`) with a piece of `node` — and nowhere in `prune` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `prune` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:242— `normalizeTree` is exported, takes a document from its caller (line 206) and hands it to `sameTree`, which calls itself at line 242 (`sameTree`) with a piece of `a` — and nowhere in `sameTree` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sameTree` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:266— `toggleOrientation` is exported, takes a document from its caller (line 249) and hands it to `flipWalk`, which calls itself at line 266 (`flipWalk`) with a piece of `node` — and nowhere in `flipWalk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `flipWalk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:313— `splitGroup` is exported, takes a document from its caller (line 129) and hands it to `walk`, which calls itself at line 313 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:387— `splitGroup` is exported, takes a document from its caller (line 129) and hands it to `walk`, which calls itself at line 387 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/tab-group-layout.ts:421— `isLayoutNode` is exported and takes `value: unknown` from its caller, and it calls itself at line 421 (`isLayoutNode`) with a piece of `value` — and nowhere in `isLayoutNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `isLayoutNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lib/activity/command.ts:121— `commandFromUnknownValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 121 (`commandFromUnknownValue`) with a piece of `value` (and at line 127) — and nowhere in `commandFromUnknownValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `commandFromUnknownValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/components/ai-elements/json-tree.tsx:65— `countJsonNodes` is exported, takes a document from its caller (line 57) and hands it to `walk`, which calls itself at line 65 (`walk`) with a piece of `node` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×17
Edited copy of a member (12 corresponding lines) src-tauri/src/parsers/claude.rs:3574— src-tauri/src/parsers/claude.rs:3574-3594 | src-tauri/src/parsers/openclaw.rs:1088-1099 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/web/browser_bridge.rs:1339— src-tauri/src/web/browser_bridge.rs:1339-1350 | src-tauri/src/web/browser_bridge.rs:1352-1364 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/update/mod.rs:54— src-tauri/src/update/mod.rs:54-65 | src-tauri/src/update/mod.rs:68-79 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/acp/connection.rs:6308— src-tauri/src/acp/connection.rs:6308-6319 | src-tauri/src/acp/connection.rs:6350-6367 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/db/service/chat_channel_message_log_service.rs:19— src-tauri/src/db/service/chat_channel_message_log_service.rs:19-32 | src-tauri/src/db/service/work_task_service.rs:147-158 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/forge/settings.rs:368— src-tauri/src/forge/settings.rs:368-379 | src-tauri/src/work_task/engine.rs:7993-8006 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/parsers/codex.rs:6364— src-tauri/src/parsers/codex.rs:6364-6378 | src-tauri/src/parsers/openclaw.rs:918-929 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/chat_channel/session_commands.rs:370— src-tauri/src/chat_channel/session_commands.rs:370-381 | src-tauri/src/chat_channel/session_commands.rs:389-401 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/db/service/folder_group_service.rs:92— src-tauri/src/db/service/folder_group_service.rs:92-104 | src-tauri/src/db/service/folder_link_service.rs:62-73 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/computer/helper/mod.rs:193— src-tauri/src/computer/helper/mod.rs:193-204 | src-tauri/src/computer/local.rs:1253-1264 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/computer/launch_req.rs:169— src-tauri/src/computer/launch_req.rs:169-181 | src-tauri/src/computer/spawn.rs:56-67 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/acp/manager.rs:2095— src-tauri/src/acp/manager.rs:2095-2106 | src-tauri/src/acp/manager.rs:2138-2150 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/commands/version_control.rs:153— src-tauri/src/commands/version_control.rs:153-164 | src-tauri/src/commands/version_control.rs:200-211 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/computer/targets.rs:904— src-tauri/src/computer/targets.rs:904-915 | src-tauri/src/computer/targets.rs:999-1014 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/science/skills/scholar-evaluation/scripts/check_process.py:202— src-tauri/science/skills/scholar-evaluation/scripts/check_process.py:202-216 | src-tauri/science/skills/scholar-evaluation/scripts/validate_rubric.py:28-39 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/acp/delegation/assistants.rs:135— src-tauri/src/acp/delegation/assistants.rs:135-147 | src-tauri/src/acp/delegation/assistants.rs:153-164 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src-tauri/src/pet_state_mapper.rs:277— src-tauri/src/pet_state_mapper.rs:277-292 | src-tauri/src/pet_sessions.rs:40-51 — 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×16
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×15
Edited copy of a member (6 corresponding lines) src-tauri/src/commands/conversations.rs:334— src-tauri/src/commands/conversations.rs:334-344 | src-tauri/src/commands/conversations.rs:394-399 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/forge/cnb.rs:643— src-tauri/src/forge/cnb.rs:643-650 | src-tauri/src/forge/gitea.rs:1082-1087 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/computer/helper/driver_proc.rs:798— src-tauri/src/computer/helper/driver_proc.rs:798-803 | src-tauri/src/computer/local.rs:1298-1303 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/acp/qoder.rs:424— src-tauri/src/acp/qoder.rs:424-429 | src-tauri/src/acp/scratch_dir.rs:845-853 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/acp/trae.rs:100— src-tauri/src/acp/trae.rs:100-105 | src-tauri/src/parsers/kiro.rs:65-70 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/parsers/kiro.rs:130— src-tauri/src/parsers/kiro.rs:130-135 | src-tauri/src/parsers/qoder.rs:392-398 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/web/handlers/office_tools.rs:100— src-tauri/src/web/handlers/office_tools.rs:100-105 | src-tauri/src/web/handlers/science.rs:38-43 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/web/handlers/office_tools.rs:126— src-tauri/src/web/handlers/office_tools.rs:126-131 | src-tauri/src/web/handlers/science.rs:82-87 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/parsers/cursor.rs:292— src-tauri/src/parsers/cursor.rs:292-298 | src-tauri/src/parsers/grok.rs:563-568 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/web/handlers/automation.rs:138— src-tauri/src/web/handlers/automation.rs:138-143 | src-tauri/src/web/handlers/work_task.rs:421-426 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/commands/acp.rs:10314— src-tauri/src/commands/acp.rs:10314-10319 | src-tauri/src/commands/custom_skills.rs:758-763 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/parsers/claude.rs:912— src-tauri/src/parsers/claude.rs:912-919 | src-tauri/src/parsers/codex.rs:6411-6416 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/folder_links.rs:34— src-tauri/src/folder_links.rs:34-39 | src-tauri/src/update/state.rs:143-148 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/parsers/hermes.rs:419— src-tauri/src/parsers/hermes.rs:419-424 | REDACTED:997-1003 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src-tauri/src/web/handlers/quick_messages.rs:71— src-tauri/src/web/handlers/quick_messages.rs:71-76 | src-tauri/src/web/handlers/work_task.rs:603-608 — 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.
ClassTooLong: TaskEngine src-tauri/src/work_task/engine.rs:236— ClassTooLong — 3416 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 116 methods, 2 blocks, lines 236-6895. The bar is 400 significant lines; this is 3016 over it, 8.54× 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: ConnectionManager src-tauri/src/acp/manager.rs:403— ClassTooLong — 2039 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 79 methods, 3 blocks, lines 403-4719. The bar is 400 significant lines; this is 1639 over it, 5.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.
ClassTooLong: DelegationBroker src-tauri/src/acp/delegation/broker.rs:1503— ClassTooLong — 1782 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 60 methods, 2 blocks, lines 1503-4905. The bar is 400 significant lines; this is 1382 over it, 4.46× 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: CliRunService src-tauri/src/cli_run/service.rs:441— ClassTooLong — 1595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 60 methods, 2 blocks, lines 441-2766. The bar is 400 significant lines; this is 1195 over it, 3.99× 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: ComputerService src-tauri/src/commands/computer.rs:441— ClassTooLong — 1084 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 2 blocks, lines 441-2167. The bar is 400 significant lines; this is 684 over it, 2.71× 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: SessionState src-tauri/src/acp/session_state.rs:256— ClassTooLong — 1005 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 2 blocks, lines 256-2684. The bar is 400 significant lines; this is 605 over it, 2.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TargetTable src-tauri/src/computer/targets.rs:549— ClassTooLong — 776 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, 2 blocks, lines 549-1668. The bar is 400 significant lines; this is 376 over it, 1.94× 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: OpenCodeParser REDACTED:16— ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 4 blocks, lines 16-1014. The bar is 400 significant lines; this is 222 over it, 1.56× 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: GeminiParser src-tauri/src/parsers/gemini.rs:14— ClassTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 4 blocks, lines 14-998. The bar is 400 significant lines; this is 210 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.
ClassTooLong: DelegationListener src-tauri/src/acp/delegation/listener.rs:148— ClassTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 2 blocks, lines 148-1337. The bar is 400 significant lines; this is 197 over it, 1.49× 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: ClaudeRecordAccumulator src-tauri/src/parsers/claude.rs:1803— ClassTooLong — 596 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 1803-2882. The bar is 400 significant lines; this is 196 over it, 1.49× 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: WatchState src-tauri/src/acp/background_watch.rs:818— ClassTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 818-2011. The bar is 400 significant lines; this is 141 over it, 1.35× 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: AutomationEngine src-tauri/src/automation/engine.rs:94— ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 94-1160. The bar is 400 significant lines; this is 98 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TelegramBackend src-tauri/src/chat_channel/backends/telegram.rs:11— ClassTooLong — 445 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, 3 blocks, lines 11-619. The bar is 400 significant lines; this is 45 over it, 1.11× 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.
Change coupling: use-appearance.ts ↔ appearance-script.ts src/hooks/use-appearance.ts:1— `src/hooks/use-appearance.ts` and `src/lib/appearance-script.ts` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `d595d8ee` fix(chat): keep the chat width in step with zoom and with what the co…; `22c65780` feat(chat): let the chat column width be dragged and set in Settings; `b8e8dea0` feat(chat): add a setting to turn off chat-area animations — run `git show` on any of them.
Change coupling: aux-panel-file-tree-tab.tsx ↔ aux-panel-git-changes-tab.tsx src/components/layout/aux-panel-file-tree-tab.tsx:1— `src/components/layout/aux-panel-file-tree-tab.tsx` and `src/components/layout/aux-panel-git-changes-tab.tsx` change together 66% of the time (19 of the 29 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 19 shared commits counted here, the most recent 3 are `cde93fb6` fix(file-tree): line every file row up with its sibling directory; `f16e71c6` perf(state): migrate tab context to a zustand tab store; `60ab7d68` refactor(workspace): split workspace context into actions/view/fileTa… — run `git show` on any of them.
Change coupling: canvas-conversation-surface.tsx ↔ conversation-detail-panel.tsx src/components/canvas/canvas-conversation-surface.tsx:1— `src/components/canvas/canvas-conversation-surface.tsx` and `src/components/conversations/conversation-detail-panel.tsx` change together 64% of the time (9 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 9 shared commits counted here, the most recent 3 are `e7679785` feat(session-details): show the plan, sub-agents and message navigato…; `c9e6329c` feat(acp): pin claude-agent-acp 0.93.0 and show Claude Code's Remote …; `47970b14` fix: allow switching harnesses during draft startup — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED REDACTED:1— `REDACTED` and `REDACTED` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `e15d37b6` docs(chat): describe custom agents' declared disk skills in the compo…; `466c3df2` fix(chat): list OpenCode's skills in its slash menu (#1089); `09777a18` feat(acp): adapt to claude-agent-acp 0.99.1 — run `git show` on any of them.
Change coupling: appearance-provider.tsx ↔ appearance-settings.tsx src/components/appearance-provider.tsx:1— `src/components/appearance-provider.tsx` and `src/components/settings/appearance-settings.tsx` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `d595d8ee` fix(chat): keep the chat width in step with zoom and with what the co…; `22c65780` feat(chat): let the chat column width be dragged and set in Settings; `b8e8dea0` feat(chat): add a setting to turn off chat-area animations — run `git show` on any of them.
Change coupling: appearance-settings.tsx ↔ appearance-script.ts src/components/settings/appearance-settings.tsx:1— `src/components/settings/appearance-settings.tsx` and `src/lib/appearance-script.ts` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `d595d8ee` fix(chat): keep the chat width in step with zoom and with what the co…; `22c65780` feat(chat): let the chat column width be dragged and set in Settings; `b8e8dea0` feat(chat): add a setting to turn off chat-area animations — run `git show` on any of them.
Change coupling: work_task.rs ↔ task-detail-sheet.tsx src-tauri/src/commands/work_task.rs:1— `src-tauri/src/commands/work_task.rs` and `src/components/tasks/task-detail-sheet.tsx` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `a71be92f` feat(tasks): let an abandon take its worktree, and offer the removal …; `d69c4002` fix(tasks): measure a task's own work, not the material it was given; `8d9bd04d` feat(tasks): show the agent's mark beside the work-task title — run `git show` on any of them.
Change coupling: file-workspace-tab-bar.tsx ↔ tab-item.tsx src/components/files/file-workspace-tab-bar.tsx:1— `src/components/files/file-workspace-tab-bar.tsx` and `src/components/tabs/tab-item.tsx` 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 — 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 `de53f8c2` feat(workspace): polish the background-image appearance and titlebar …; `6b2006df` feat(workspace): host tabs in the title bar and add conversation/file…; `5b552dcf` feat(tabs): close tab on middle-click in session, file, and terminal … — run `git show` on any of them.
Change coupling: git.rs ↔ aux-panel-git-log-tab.tsx src-tauri/src/web/handlers/git.rs:1— `src-tauri/src/web/handlers/git.rs` and `src/components/layout/aux-panel-git-log-tab.tsx` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `66a911b0` feat(git): remove a worktree from the branch selector instead of failing; `5dafe50a` feat(git): push any branch and rework the side panel git menus; `ae2750ba` feat(git): commit, update and stash from the side panel — run `git show` on any of them.
Change coupling: mod.rs ↔ api.ts src-tauri/src/models/mod.rs:1— `src-tauri/src/models/mod.rs` and `src/lib/api.ts` change together 53% of the time (9 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `9cc351ad` feat(tasks): commit a worktree's leftover changes when delivering a p…; `e09b4916` feat(window): let the close button be a choice, not a guess; `965697a4` feat(settings): add a launch-at-login toggle to the desktop app — run `git show` on any of them.
Change coupling: mod.rs ↔ types.ts src-tauri/src/db/migration/mod.rs:1— `src-tauri/src/db/migration/mod.rs` and `src/lib/types.ts` change together 50% of the time (10 of the 20 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `b3ba997d` feat(acp): offer the unreviewed latest release instead of a version c…; `9e0cc74d` feat(remote-workspace): add custom HTTP headers to connections; `e7dd6f4c` feat(conversations): keep conversation titles in sync with session files — run `git show` on any of them.
Change coupling: work_task_service.rs ↔ task-card.tsx src-tauri/src/db/service/work_task_service.rs:1— `src-tauri/src/db/service/work_task_service.rs` and `src/components/tasks/task-card.tsx` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `bb952802` fix(tasks): don't let a context compaction block the merge click or m…; `8d9bd04d` feat(tasks): show the agent's mark beside the work-task title; `2aeb22f2` feat(tasks): unstick tasks whose worktree was deleted — run `git show` on any of them.
Change coupling: surface_child.rs ↔ browser-events-bridge.tsx src-tauri/src/browser/surface_child.rs:1— `src-tauri/src/browser/surface_child.rs` and `src/components/browser/browser-events-bridge.tsx` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `076b7613` fix(browser): let a tab's web inspector open in its own window; `ffd5ba46` fix(browser): close the gaps review found in site rules, load state a…; `8e024418` feat(browser): find in page with ⌘F — run `git show` on any of them.
Change coupling: lib.rs ↔ browser-api.ts src-tauri/src/lib.rs:1— `src-tauri/src/lib.rs` and `src/lib/browser/browser-api.ts` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `70255f6a` fix(browser): give the empty tab a page of its own, in the app's colours; `076b7613` fix(browser): let a tab's web inspector open in its own window; `7c5a39d8` fix(browser): show a download that landed on a network path — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×14
Edited copy of a member (16 corresponding lines) src-tauri/src/commands/acp.rs:10752— src-tauri/src/commands/acp.rs:10752-10767 | src-tauri/src/commands/acp.rs:10783-10798 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/acp/connection.rs:18787— src-tauri/src/acp/connection.rs:18787-18803 | src-tauri/src/parsers/grok.rs:1326-1341 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/db/service/folder_service.rs:348— src-tauri/src/db/service/folder_service.rs:348-363 | src-tauri/src/db/service/folder_service.rs:371-386 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/forge/github.rs:1754— src-tauri/src/forge/github.rs:1754-1769 | src-tauri/src/forge/github.rs:1810-1825 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/db/service/conversation_tag_service.rs:478— src-tauri/src/db/service/conversation_tag_service.rs:478-495 | src-tauri/src/db/service/work_task_service.rs:849-864 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/acp/cursor_acp_retry_compat.rs:398— src-tauri/src/acp/cursor_acp_retry_compat.rs:398-419 | src-tauri/src/acp/cursor_acp_retry_compat.rs:567-582 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/commands/folders.rs:51— src-tauri/src/commands/folders.rs:51-75 | src-tauri/src/commands/folders.rs:84-99 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/commands/folders.rs:386— src-tauri/src/commands/folders.rs:386-403 | src-tauri/src/commands/folders.rs:6239-6254 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/db/service/chat_channel_service.rs:18— src-tauri/src/db/service/chat_channel_service.rs:18-33 | src-tauri/src/db/service/model_provider_service.rs:17-33 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/browser/surface_child.rs:1217— src-tauri/src/browser/surface_child.rs:1217-1232 | src-tauri/src/browser/surface_window.rs:641-658 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/commands/folders.rs:405— src-tauri/src/commands/folders.rs:405-420 | src-tauri/src/commands/folders.rs:426-442 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/chat_channel/backends/lark.rs:150— src-tauri/src/chat_channel/backends/lark.rs:150-165 | src-tauri/src/chat_channel/backends/telegram.rs:25-40 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/acp/delegation/broker.rs:1153— src-tauri/src/acp/delegation/broker.rs:1153-1172 | src-tauri/src/acp/delegation/listener.rs:1615-1630 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src-tauri/src/acp/delegation/listener.rs:1578— src-tauri/src/acp/delegation/listener.rs:1578-1593 | src-tauri/src/acp/delegation/listener.rs:1596-1611 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×14
Edited copy of a member (11 corresponding lines) src-tauri/src/commands/forge.rs:841— src-tauri/src/commands/forge.rs:841-855 | src-tauri/src/commands/forge.rs:922-932 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/browser/listener.rs:488— src-tauri/src/browser/listener.rs:488-500 | src-tauri/src/browser/listener.rs:502-512 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/commands/custom_skills.rs:488— src-tauri/src/commands/custom_skills.rs:488-498 | src-tauri/src/commands/custom_skills.rs:504-519 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/forge/cnb.rs:598— src-tauri/src/forge/cnb.rs:598-608 | src-tauri/src/forge/gitea.rs:1032-1042 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/parsers/antigravity.rs:728— src-tauri/src/parsers/antigravity.rs:728-738 | src-tauri/src/parsers/cursor.rs:388-398 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/terminal/manager.rs:620— src-tauri/src/terminal/manager.rs:620-630 | src-tauri/src/terminal/manager.rs:632-647 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/commands/acp.rs:6211— src-tauri/src/commands/acp.rs:6211-6221 | src-tauri/src/parsers/agent_env.rs:86-96 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/commands/computer.rs:562— src-tauri/src/commands/computer.rs:562-572 | src-tauri/src/computer/helper/act.rs:958-971 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/acp/scratch_dir.rs:622— src-tauri/src/acp/scratch_dir.rs:622-636 | src-tauri/src/acp/scratch_dir.rs:691-701 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/parsers/gemini.rs:620— src-tauri/src/parsers/gemini.rs:620-630 | REDACTED:1409-1425 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/parsers/kiro.rs:226— src-tauri/src/parsers/kiro.rs:226-236 | src-tauri/src/parsers/mod.rs:874-886 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/parsers/mod.rs:1209— src-tauri/src/parsers/mod.rs:1209-1219 | src-tauri/src/parsers/mod.rs:1230-1240 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src-tauri/src/acp/codex_endpoint_catalog.rs:319— src-tauri/src/acp/codex_endpoint_catalog.rs:319-329 | src-tauri/src/acp/provider_models.rs:520-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) src-tauri/src/web/handlers/delegation.rs:33— src-tauri/src/web/handlers/delegation.rs:33-43 | src-tauri/src/web/handlers/system_settings.rs:144-154 — 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.
Duplicated block (13 lines × 2) src-tauri/src/acp/delegation/companion.rs:2846— src-tauri/src/acp/delegation/companion.rs:2846-2858 | src-tauri/src/acp/delegation/companion.rs:3419-3431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/companion.rs:2846` 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) src-tauri/src/acp/file_system_runtime.rs:1167— src-tauri/src/acp/file_system_runtime.rs:1167-1179 | src-tauri/src/acp/file_system_runtime.rs:1311-1323 — both copies are in the same file, so extract the 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 (13 lines × 2) src-tauri/src/commands/folders.rs:4692— src-tauri/src/commands/folders.rs:4692-4704 | src-tauri/src/commands/folders.rs:4768-4780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:4692` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/commands/folders.rs:4706` calls `entry_presents_as_dir`, `path` and `src-tauri/src/commands/folders.rs:4781` 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) src-tauri/src/commands/mcp.rs:5120— src-tauri/src/commands/mcp.rs:5120-5132 | src-tauri/src/commands/mcp.rs:5401-5413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:5120` 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) src-tauri/src/commands/mcp.rs:6348— src-tauri/src/commands/mcp.rs:6348-6360 | src-tauri/src/commands/mcp.rs:6729-6741 — both copies are in the same file, so extract the 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) src-tauri/src/commands/windows.rs:375— src-tauri/src/commands/windows.rs:375-387 | src-tauri/src/web/handlers/folders.rs:480-492 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) src-tauri/src/parsers/claude.rs:3725— src-tauri/src/parsers/claude.rs:3725-3737 | src-tauri/src/parsers/qoder.rs:1684-1696 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/qoder.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:3725` 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) src-tauri/src/parsers/codex.rs:4037— src-tauri/src/parsers/codex.rs:4037-4049 | src-tauri/src/parsers/codex.rs:5201-5213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codex.rs:4037` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src-tauri/src/workspace_state/mod.rs:1056— src-tauri/src/workspace_state/mod.rs:1056-1068 | src-tauri/src/workspace_state/mod.rs:1690-1702 — both copies are in the same file, so extract the block into 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) src-tauri/src/acp/codex_endpoint_catalog.rs:497— src-tauri/src/acp/codex_endpoint_catalog.rs:497-509 | src-tauri/src/acp/codex_model_catalog.rs:466-478 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/codex_endpoint_catalog.rs:497` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src-tauri/src/cli/commands.rs:99— src-tauri/src/cli/commands.rs:99-111 | src-tauri/src/cli/manage.rs:205-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/cli/commands.rs:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src-tauri/src/forge/gitea.rs:1231— src-tauri/src/forge/gitea.rs:1231-1243 | src-tauri/src/forge/gitlab.rs:1205-1217 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/gitlab.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:1231` 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) src-tauri/src/db/service/work_task_service.rs:1081— src-tauri/src/db/service/work_task_service.rs:1081-1093 | src-tauri/src/db/service/work_task_service.rs:2390-2402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:1081` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src-tauri/src/acp/delegation/broker.rs:4072— src-tauri/src/acp/delegation/broker.rs:4072-4084 | src-tauri/src/acp/delegation/broker.rs:4090-4102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:4072` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×13
Edited copy of a member (15 corresponding lines) src-tauri/src/commands/backup/crypto.rs:106— src-tauri/src/commands/backup/crypto.rs:106-120 | src-tauri/src/commands/config_sync/crypto.rs:144-161 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/acp/background_watch.rs:2025— src-tauri/src/acp/background_watch.rs:2025-2039 | src-tauri/src/parsers/claude.rs:1427-1446 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/update/install.rs:583— src-tauri/src/update/install.rs:583-597 | src-tauri/src/update/version.rs:73-89 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/commands/mcp.rs:933— src-tauri/src/commands/mcp.rs:933-950 | src-tauri/src/commands/mcp.rs:4119-4133 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/db/service/agent_setting_service.rs:235— src-tauri/src/db/service/agent_setting_service.rs:235-249 | src-tauri/src/db/service/agent_setting_service.rs:271-293 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/commands/custom_skills.rs:767— src-tauri/src/commands/custom_skills.rs:767-781 | src-tauri/src/commands/experts.rs:430-444 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/web/handlers/version_control.rs:80— src-tauri/src/web/handlers/version_control.rs:80-94 | src-tauri/src/web/handlers/version_control.rs:120-134 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/parsers/pi.rs:218— src-tauri/src/parsers/pi.rs:218-232 | src-tauri/src/work_task/engine.rs:8702-8716 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/browser/confirm.rs:167— src-tauri/src/browser/confirm.rs:167-186 | src-tauri/src/browser/confirm.rs:195-209 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/science/skills/citation-management/scripts/extract_metadata.py:432— src-tauri/science/skills/citation-management/scripts/extract_metadata.py:432-446 | src-tauri/science/skills/citation-management/scripts/validate_citations.py:576-590 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/commands/work_task.rs:774— src-tauri/src/commands/work_task.rs:774-788 | src-tauri/src/commands/work_task.rs:799-815 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/db/migration/m20260728_000001_custom_agent_skills_dir.rs:8— src-tauri/src/db/migration/m20260728_000001_custom_agent_skills_dir.rs:8-22 | src-tauri/src/db/migration/m20260808_000001_custom_agent_supports_mcp.rs:8-29 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src-tauri/src/db/migration/m20260610_000001_conversation_pinned_at.rs:8— src-tauri/src/db/migration/m20260610_000001_conversation_pinned_at.rs:8-22 | src-tauri/src/db/migration/m20261017_000002_conversation_source.rs:8-23 — 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 (7 corresponding lines) · ×13
Edited copy of a member (7 corresponding lines) src-tauri/src/acp/codex_catalog_commit/mod.rs:264— src-tauri/src/acp/codex_catalog_commit/mod.rs:264-270 | src-tauri/src/commands/mcp.rs:877-890 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/commands/browser.rs:157— src-tauri/src/commands/browser.rs:157-163 | src-tauri/src/commands/remote_proxy.rs:174-180 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/commands/config_sync/snapshot.rs:319— src-tauri/src/commands/config_sync/snapshot.rs:319-330 | src-tauri/src/commands/backup/mod.rs:57-63 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/acp/idle_sweep.rs:28— src-tauri/src/acp/idle_sweep.rs:28-37 | src-tauri/src/office_watch/mod.rs:1041-1047 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/web/handlers/acp.rs:1230— src-tauri/src/web/handlers/acp.rs:1230-1238 | src-tauri/src/web/handlers/office_tools.rs:53-59 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/process.rs:140— src-tauri/src/process.rs:140-146 | src-tauri/src/runtime_lock.rs:52-58 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/parsers/deepseek.rs:804— src-tauri/src/parsers/deepseek.rs:804-810 | src-tauri/src/parsers/pi.rs:655-662 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/computer/helper/act.rs:1088— src-tauri/src/computer/helper/act.rs:1088-1094 | src-tauri/src/computer/helper/ops.rs:78-84 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/browser/egress.rs:304— src-tauri/src/browser/egress.rs:304-310 | src-tauri/src/forge/auto/mod.rs:315-321 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/acp/opencode_plugins.rs:88— src-tauri/src/acp/opencode_plugins.rs:88-95 | src-tauri/src/parsers/qoder.rs:90-96 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/acp/background_watch.rs:2145— src-tauri/src/acp/background_watch.rs:2145-2151 | src-tauri/src/parsers/codebuddy.rs:533-539 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/db/service/app_metadata_service.rs:40— src-tauri/src/db/service/app_metadata_service.rs:40-46 | src-tauri/src/db/service/work_task_service.rs:3339-3345 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src-tauri/src/browser/doc_guest.rs:953— src-tauri/src/browser/doc_guest.rs:953-959 | src-tauri/src/browser/egress.rs:312-319 — 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) src-tauri/src/acp/delegation/companion.rs:701— src-tauri/src/acp/delegation/companion.rs:701-714 | src-tauri/src/acp/delegation/companion.rs:732-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) src-tauri/src/chat_channel/backends/weixin.rs:458— src-tauri/src/chat_channel/backends/weixin.rs:458-471 | src-tauri/src/chat_channel/backends/weixin.rs:764-777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) src-tauri/src/commands/browser.rs:1750— src-tauri/src/commands/browser.rs:1750-1763 | src-tauri/src/commands/browser.rs:2215-2228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/commands/browser.rs:2229` calls `window_err` and `src-tauri/src/commands/browser.rs:1766` 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) src-tauri/src/commands/experts.rs:557— src-tauri/src/commands/experts.rs:557-570 | src-tauri/src/commands/science.rs:381-394 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.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.
Duplicated block (14 lines × 2) src-tauri/src/db/service/work_task_service.rs:1683— src-tauri/src/db/service/work_task_service.rs:1683-1696 | src-tauri/src/db/service/work_task_service.rs:1773-1786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:1683` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src-tauri/src/db/service/work_task_service.rs:2598— src-tauri/src/db/service/work_task_service.rs:2598-2611 | src-tauri/src/db/service/work_task_service.rs:2658-2671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:2598` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/db/service/work_task_service.rs:2595` calls `col_expr`, `value`, `Some` and `src-tauri/src/db/service/work_task_service.rs:2655` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) src-tauri/src/parsers/claude.rs:3709— src-tauri/src/parsers/claude.rs:3709-3722 | src-tauri/src/parsers/qoder.rs:1668-1681 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/qoder.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) src-tauri/src/workspace_state/mod.rs:1007— src-tauri/src/workspace_state/mod.rs:1007-1020 | src-tauri/src/workspace_state/mod.rs:1226-1239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/workspace_state/mod.rs:1007` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src-tauri/src/commands/computer.rs:927— src-tauri/src/commands/computer.rs:927-940 | src-tauri/src/commands/computer.rs:969-982 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) src-tauri/src/acp/delegation/meta_writer.rs:314— src-tauri/src/acp/delegation/meta_writer.rs:314-334 | src-tauri/src/acp/delegation/meta_writer.rs:350-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/meta_writer.rs:314` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src-tauri/src/commands/mcp.rs:7032— src-tauri/src/commands/mcp.rs:7032-7045 | src-tauri/src/commands/mcp.rs:7100-7113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:7032` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src-tauri/src/acp/preflight.rs:302— src-tauri/src/acp/preflight.rs:302-315 | src-tauri/src/acp/preflight.rs:316-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) src-tauri/src/parsers/cursor.rs:1595— src-tauri/src/parsers/cursor.rs:1595-1608 | src-tauri/src/parsers/cursor.rs:1710-1723 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/cursor.rs:1595` 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.
D30 · Dependency Vulnerabilities· Medium CVE · ×12
Duplicated block (8 lines × 3) src-tauri/src/acp/delegation/companion.rs:2412— src-tauri/src/acp/delegation/companion.rs:2412-2419 | src-tauri/src/acp/delegation/companion.rs:2481-2488 | src-tauri/src/acp/delegation/companion.rs:2567-2574 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/companion.rs:2412` it does not close everything it opens, so those exact lines 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) src-tauri/src/acp/manager.rs:2070— src-tauri/src/acp/manager.rs:2070-2077 | src-tauri/src/acp/manager.rs:2114-2121 | src-tauri/src/acp/manager.rs:2380-2387 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) src-tauri/src/commands/mcp.rs:1150— src-tauri/src/commands/mcp.rs:1150-1157 | src-tauri/src/commands/mcp.rs:1264-1271 | src-tauri/src/commands/mcp.rs:1346-1353 — 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, `src-tauri/src/commands/mcp.rs:1273` calls `canonicalize_spec`, `Object` and `src-tauri/src/commands/mcp.rs:1354` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) src-tauri/src/commands/mcp.rs:2603— src-tauri/src/commands/mcp.rs:2603-2610 | src-tauri/src/commands/mcp.rs:2689-2696 | src-tauri/src/commands/mcp.rs:2795-2802 — 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 (8 lines × 3) src-tauri/src/commands/version_control.rs:276— src-tauri/src/commands/version_control.rs:276-283 | src-tauri/src/commands/version_control.rs:372-379 | src-tauri/src/commands/version_control.rs:475-482 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/version_control.rs:276` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/db/service/work_task_service.rs:1168— src-tauri/src/db/service/work_task_service.rs:1168-1175 | src-tauri/src/db/service/work_task_service.rs:1318-1325 | src-tauri/src/db/service/work_task_service.rs:1448-1456 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:1168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/db/service/work_task_service.rs:1456` calls `col_expr`, `value` and `src-tauri/src/db/service/work_task_service.rs:1175` 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 × 3) src-tauri/src/process.rs:372— src-tauri/src/process.rs:372-379 | src-tauri/src/process.rs:490-497 | src-tauri/src/process.rs:542-549 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/process.rs:372` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) src-tauri/src/parsers/claude.rs:1608— src-tauri/src/parsers/claude.rs:1608-1615 | src-tauri/src/parsers/codex.rs:489-496 | src-tauri/src/parsers/codex.rs:3489-3496 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) src-tauri/src/commands/windows.rs:663— src-tauri/src/commands/windows.rs:663-670 | src-tauri/src/commands/windows.rs:995-1002 | src-tauri/src/commands/windows.rs:1119-1126 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/windows.rs:663` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/commands/windows.rs:1117` calls `post_window_setup` and `src-tauri/src/commands/windows.rs:661` 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 × 3) src-tauri/src/commands/folders.rs:2420— src-tauri/src/commands/folders.rs:2420-2427 | src-tauri/src/commands/folders.rs:2435-2442 | src-tauri/src/commands/folders.rs:2450-2457 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:2420` it begins part-way through the construct above it, so those 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 × 3) src-tauri/src/commands/windows.rs:754— src-tauri/src/commands/windows.rs:754-761 | src-tauri/src/commands/windows.rs:846-853 | src-tauri/src/commands/windows.rs:1276-1283 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/windows.rs:754` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/mcp.rs:6398— src-tauri/src/commands/mcp.rs:6398-6405 | src-tauri/src/commands/mcp.rs:6469-6476 | src-tauri/src/commands/mcp.rs:6990-6997 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:6398` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/folders.rs:559— src-tauri/src/commands/folders.rs:559-564 | src-tauri/src/commands/folders.rs:1931-1936 | src-tauri/src/commands/folders.rs:6700-6705 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.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 (6 lines × 3) src-tauri/src/commands/mcp.rs:1133— src-tauri/src/commands/mcp.rs:1133-1138 | src-tauri/src/commands/mcp.rs:1624-1631 | src-tauri/src/commands/mcp.rs:4162-4167 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1133` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/windows.rs:685— src-tauri/src/commands/windows.rs:685-690 | src-tauri/src/commands/windows.rs:1020-1025 | src-tauri/src/commands/windows.rs:1141-1146 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `app` to `AppHandle` in one and `&AppHandle` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/commands/windows.rs:691` calls `parent`, `map_err`, `window` and `src-tauri/src/commands/windows.rs:1147` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) src-tauri/src/forge/deliver.rs:550— src-tauri/src/forge/deliver.rs:550-555 | src-tauri/src/forge/github.rs:652-657 | src-tauri/src/forge/github.rs:1419-1424 — 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) src-tauri/src/forge/gitea.rs:1105— src-tauri/src/forge/gitea.rs:1105-1110 | src-tauri/src/forge/github.rs:1738-1743 | src-tauri/src/forge/gitlab.rs:1116-1121 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:1105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) src-tauri/src/forge/gitea.rs:1097— src-tauri/src/forge/gitea.rs:1097-1102 | src-tauri/src/forge/github.rs:1730-1735 | src-tauri/src/forge/gitlab.rs:1108-1113 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:1097` it does not close everything it opens, so those exact lines 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) src-tauri/src/acp/chat_authoring.rs:245— src-tauri/src/acp/chat_authoring.rs:245-250 | src-tauri/src/commands/forge.rs:1937-1942 | src-tauri/src/forge/mod.rs:2120-2125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) src-tauri/src/web/handlers/automation.rs:77— src-tauri/src/web/handlers/automation.rs:77-82 | src-tauri/src/web/handlers/work_task.rs:263-268 | src-tauri/src/web/handlers/work_task.rs:583-588 — before extracting anything, compare `src-tauri/src/web/handlers/automation.rs` and `src-tauri/src/web/handlers/work_task.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/web/handlers/automation.rs:77` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/web/handlers/experts.rs:72— src-tauri/src/web/handlers/experts.rs:72-77 | src-tauri/src/web/handlers/office_tools.rs:91-96 | src-tauri/src/web/handlers/science.rs:73-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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/web/handlers/experts.rs:72` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/forge/cnb.rs:80— src-tauri/src/forge/cnb.rs:80-88 | src-tauri/src/forge/gitea.rs:85-95 | src-tauri/src/forge/gitlab.rs:193-198 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/gitea.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/cnb.rs:80` it does not close everything it opens, so those exact lines 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) src-tauri/src/work_task/git.rs:48— src-tauri/src/work_task/git.rs:48-53 | src-tauri/src/work_task/git.rs:64-69 | src-tauri/src/work_task/git.rs:284-289 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/work_task/git.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. 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 × 3) src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:255— src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:255-260 | src-tauri/science/skills/citation-management/scripts/search_openalex.py:316-321 | src-tauri/science/skills/citation-management/scripts/search_pubmed.py:425-430 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
Hollow method — returns a constant without doing the work src-tauri/src/acp/delegation/transport.rs:717— `client_commit_feedback` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/listener.rs:533— `workdir_of` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/listener.rs:548— `listener_pid` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/listener.rs:552— `program_of` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/listener.rs:556— `workdir_of` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/shim/windows.rs:222— `devtools_visible` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/surface_window.rs:771— `refresh_user_agent` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/surface_window.rs:877— `can_go_back` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/surface_window.rs:881— `can_go_forward` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/browser/surface_window.rs:905— `refresh_user_agent` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/commands/config_sync/domains.rs:204— `validate_preferences` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src-tauri/src/computer/procinfo.rs:238— `process_start` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×11
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/chat_channel/backends/telegram.rs:56— src-tauri/src/chat_channel/backends/telegram.rs:56-87 | src-tauri/src/chat_channel/backends/telegram.rs:105-141 | src-tauri/src/chat_channel/backends/telegram.rs:494-543 | src-tauri/src/chat_channel/backends/telegram.rs:549-590 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/commands/acp.rs:6025— src-tauri/src/commands/acp.rs:6025-6063 | src-tauri/src/commands/acp.rs:13127-13221 | src-tauri/src/commands/acp.rs:13265-13375 | src-tauri/src/commands/acp.rs:14582-14791 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/commands/custom_skills.rs:353— src-tauri/src/commands/custom_skills.rs:353-405 | src-tauri/src/commands/experts.rs:832-894 | src-tauri/src/commands/office_tools.rs:1089-1148 | src-tauri/src/commands/science.rs:657-717 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/commands/custom_skills.rs:448— src-tauri/src/commands/custom_skills.rs:448-480 | src-tauri/src/commands/experts.rs:972-1004 | src-tauri/src/commands/office_tools.rs:1245-1280 | src-tauri/src/commands/science.rs:788-820 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/commands/folders.rs:2547— src-tauri/src/commands/folders.rs:2547-2586 | src-tauri/src/commands/folders.rs:2593-2632 | src-tauri/src/commands/folders.rs:2639-2668 | src-tauri/src/commands/folders.rs:6013-6170 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/commands/remote_proxy.rs:385— src-tauri/src/commands/remote_proxy.rs:385-449 | src-tauri/src/commands/remote_proxy.rs:649-774 | src-tauri/src/commands/remote_proxy.rs:1044-1157 | src-tauri/src/commands/remote_proxy.rs:1294-1448 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/commands/version_control.rs:249— src-tauri/src/commands/version_control.rs:249-319 | src-tauri/src/commands/version_control.rs:346-423 | src-tauri/src/commands/version_control.rs:445-505 | src-tauri/src/commands/version_control.rs:525-610 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/parsers/codebuddy.rs:466— src-tauri/src/parsers/codebuddy.rs:466-497 | src-tauri/src/parsers/codebuddy.rs:499-524 | src-tauri/src/parsers/pi.rs:455-480 | src-tauri/src/parsers/pi.rs:482-516 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/parsers/codex_code_mode.rs:1513— src-tauri/src/parsers/codex_code_mode.rs:1513-1538 | src-tauri/src/parsers/codex_code_mode.rs:1540-1580 | src-tauri/src/parsers/codex_code_mode.rs:1662-1685 | src-tauri/src/parsers/codex_code_mode.rs:2110-2135 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/science/skills/citation-management/scripts/extract_metadata.py:658— src-tauri/science/skills/citation-management/scripts/extract_metadata.py:658-740 | src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:163-262 | src-tauri/science/skills/citation-management/scripts/search_openalex.py:266-321 | src-tauri/science/skills/citation-management/scripts/search_pubmed.py:302-430 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:25— src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:25-40 | src-tauri/science/skills/scholar-evaluation/scripts/check_traceability.py:197-214 | src-tauri/science/skills/scholar-evaluation/scripts/generate_report_scaffold.py:187-214 | src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:241-255 — 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 (18 corresponding lines) · ×11
Edited copy of a member (18 corresponding lines) src-tauri/src/commands/experts.rs:332— src-tauri/src/commands/experts.rs:332-353 | src-tauri/src/commands/science.rs:300-317 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/forge/gitea.rs:950— src-tauri/src/forge/gitea.rs:950-967 | src-tauri/src/forge/github.rs:1679-1701 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/browser/shim/macos.rs:901— src-tauri/src/browser/shim/macos.rs:901-918 | src-tauri/src/browser/shim/macos.rs:998-1015 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/computer/helper/driver_proc.rs:608— src-tauri/src/computer/helper/driver_proc.rs:608-625 | src-tauri/src/computer/helper/driver_proc.rs:628-650 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/web/handlers/files.rs:576— src-tauri/src/web/handlers/files.rs:576-599 | src-tauri/src/web/handlers/workspace_files.rs:180-197 — 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) REDACTED:128— REDACTED:128-151 | REDACTED:64-81 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/browser/shim/windows.rs:429— src-tauri/src/browser/shim/windows.rs:429-446 | src-tauri/src/browser/shim/windows.rs:996-1013 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/db/migration/m20260211_000001_init.rs:303— src-tauri/src/db/migration/m20260211_000001_init.rs:303-320 | src-tauri/src/db/migration/m20260801_000001_work_task.rs:236-265 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/acp/provider_models.rs:274— src-tauri/src/acp/provider_models.rs:274-291 | src-tauri/src/commands/custom_agents.rs:357-375 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/commands/mcp.rs:6208— src-tauri/src/commands/mcp.rs:6208-6232 | src-tauri/src/commands/mcp.rs:7128-7145 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src-tauri/src/db/migration/m20260818_000001_work_task_source.rs:59— src-tauri/src/db/migration/m20260818_000001_work_task_source.rs:59-76 | src-tauri/src/db/migration/m20260831_000001_canvas_node_group_grid.rs:80-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.
TooManyMethods: TaskEngine src-tauri/src/work_task/engine.rs:236— TooManyMethods — 116 methods. The bar is 30 methods; this is 86 over it, 3.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ConnectionManager src-tauri/src/acp/manager.rs:403— TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DelegationBroker src-tauri/src/acp/delegation/broker.rs:1503— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CliRunService src-tauri/src/cli_run/service.rs:441— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ComputerService src-tauri/src/commands/computer.rs:441— TooManyMethods — 46 methods. The bar is 30 methods; 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.
TooManyMethods: DelegationListener src-tauri/src/acp/delegation/listener.rs:148— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× 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: BrowserSurface src-tauri/src/browser/surface.rs:88— TooManyMethods — 37 methods. The bar is 30 methods; 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.
TooManyMethods: ChildHandle src-tauri/src/browser/surface_child.rs:334— TooManyMethods — 35 methods. The bar is 30 methods; 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.
TooManyMethods: TargetTable src-tauri/src/computer/targets.rs:549— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GeminiParser src-tauri/src/parsers/gemini.rs:14— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (7 lines × 3) src-tauri/src/commands/experts.rs:1017— src-tauri/src/commands/experts.rs:1017-1023 | src-tauri/src/commands/office_tools.rs:1292-1298 | src-tauri/src/commands/science.rs:832-838 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/office_tools.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:1017` 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 × 3) src-tauri/src/forge/cnb.rs:311— src-tauri/src/forge/cnb.rs:311-317 | src-tauri/src/forge/gitea.rs:288-294 | src-tauri/src/forge/github.rs:512-518 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/gitea.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/cnb.rs:311` 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, `src-tauri/src/forge/cnb.rs:309` calls `collection_of_kind` and `src-tauri/src/forge/gitea.rs:286` 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 × 3) src-tauri/src/parsers/codebuddy.rs:108— src-tauri/src/parsers/codebuddy.rs:108-114 | src-tauri/src/parsers/codebuddy.rs:224-230 | src-tauri/src/parsers/kimi_code.rs:372-378 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 (7 lines × 3) src-tauri/src/parsers/codebuddy.rs:108— src-tauri/src/parsers/codebuddy.rs:108-114 | src-tauri/src/parsers/grok.rs:710-718 | src-tauri/src/parsers/kimi_code.rs:134-140 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/parsers/kimi_code.rs:141` calls `get`, `and_then` and `src-tauri/src/parsers/grok.rs:718` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) src-tauri/src/keyring_store.rs:39— src-tauri/src/keyring_store.rs:39-45 | src-tauri/src/keyring_store.rs:227-233 | src-tauri/src/keyring_store.rs:287-293 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/keyring_store.rs:39` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/browser/smoke.rs:646— src-tauri/src/browser/smoke.rs:646-652 | src-tauri/src/browser/smoke.rs:664-670 | src-tauri/src/browser/smoke.rs:852-858 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/browser/smoke.rs:646` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/acp/codex_catalog_commit/mod.rs:416— src-tauri/src/acp/codex_catalog_commit/mod.rs:416-422 | src-tauri/src/acp/delegation/companion.rs:2052-2059 | src-tauri/src/commands/acp.rs:8369-8376 — 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 (7 lines × 3) src-tauri/src/acp/custom_registry.rs:369— src-tauri/src/acp/custom_registry.rs:369-376 | src-tauri/src/acp_transcript.rs:194-200 | src-tauri/src/turn_timings.rs:146-152 — before extracting anything, compare `src-tauri/src/acp_transcript.rs` and `src-tauri/src/turn_timings.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) src-tauri/src/chat_channel/backends/lark.rs:594— src-tauri/src/chat_channel/backends/lark.rs:594-600 | src-tauri/src/chat_channel/backends/telegram.rs:445-451 | src-tauri/src/chat_channel/backends/weixin.rs:733-739 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) src-tauri/src/commands/windows.rs:698— src-tauri/src/commands/windows.rs:698-705 | src-tauri/src/commands/windows.rs:782-788 | src-tauri/src/commands/windows.rs:1033-1040 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/windows.rs:698` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TaskEngine::launch (cognitive 49) src-tauri/src/work_task/engine.rs:1279— TaskEngine::launch has cognitive complexity 49 (threshold 15). Drivers by points: if/else 26 (35 pts), match/switch 9 (13 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.
TaskEngine::reconcile_once (cognitive 27) src-tauri/src/work_task/engine.rs:6703— TaskEngine::reconcile_once has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (7 pts), loops 4 (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.
TaskEngine::settle_generation (cognitive 25) src-tauri/src/work_task/engine.rs:3473— TaskEngine::settle_generation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, match/switch 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.
TaskEngine::deliver_pr_closing (cognitive 23) src-tauri/src/work_task/engine.rs:4739— TaskEngine::deliver_pr_closing has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 4 (5 pts), boolean chains 4 (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.
TaskEngine::run_preflight (cognitive 22) src-tauri/src/work_task/engine.rs:3777— TaskEngine::run_preflight has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 4, 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.
TaskEngine::compact_before_prompt (cognitive 20) src-tauri/src/work_task/engine.rs:2278— TaskEngine::compact_before_prompt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), 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.
TaskEngine::recover_merging (cognitive 20) src-tauri/src/work_task/engine.rs:6371— TaskEngine::recover_merging has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), 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.
TaskEngine::await_compaction_turn (cognitive 18) src-tauri/src/work_task/engine.rs:2467— TaskEngine::await_compaction_turn has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 1 (3 pts), loops 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.
TaskEngine::push_into_pull (cognitive 17) src-tauri/src/work_task/engine.rs:5352— TaskEngine::push_into_pull has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×9
TooManyFunctions: codeg::browser::profile src-tauri/src/browser/profile.rs:39— 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: codeg::web::handlers::folders src-tauri/src/web/handlers/folders.rs:18— TooManyFunctions — 41 free functions. The bar is 30 free functions; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: codeg::acp::delegation::transport src-tauri/src/acp/delegation/transport.rs:526— TooManyFunctions — 40 free functions. The bar is 30 free functions; this is 10 over it, 1.33× 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: codeg::commands::pet src-tauri/src/commands/pet.rs:36— TooManyFunctions — 40 free functions. The bar is 30 free functions; this is 10 over it, 1.33× 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: codeg::web::handlers::work_task src-tauri/src/web/handlers/work_task.rs:14— 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: codeg::work_task::git src-tauri/src/work_task/git.rs:12— 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: codeg::acp::scratch_dir src-tauri/src/acp/scratch_dir.rs:157— 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: codeg::browser::shim::linux src-tauri/src/browser/shim/linux.rs:126— 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×8
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×8
Edited copy of a member (19 corresponding lines) src-tauri/src/forge/gitea.rs:1096— src-tauri/src/forge/gitea.rs:1096-1114 | src-tauri/src/forge/github.rs:1729-1747 — 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) src-tauri/src/commands/acp.rs:15131— src-tauri/src/commands/acp.rs:15131-15149 | src-tauri/src/commands/acp.rs:15226-15246 — 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) src-tauri/src/commands/acp.rs:10818— src-tauri/src/commands/acp.rs:10818-10836 | src-tauri/src/commands/acp.rs:10973-10991 — 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) src-tauri/src/acp/binary_cache.rs:905— src-tauri/src/acp/binary_cache.rs:905-924 | src-tauri/src/computer/helper/driver_proc.rs:256-274 — 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) src-tauri/src/acp/manager.rs:227— src-tauri/src/acp/manager.rs:227-248 | src-tauri/src/acp/manager.rs:263-281 — 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) src-tauri/src/acp/manager.rs:1283— src-tauri/src/acp/manager.rs:1283-1307 | src-tauri/src/acp/manager.rs:4633-4651 — 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) src-tauri/src/terminal/manager.rs:841— src-tauri/src/terminal/manager.rs:841-862 | src-tauri/src/terminal/manager.rs:873-891 — 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) src-tauri/src/acp/delegation/broker.rs:1112— src-tauri/src/acp/delegation/broker.rs:1112-1130 | src-tauri/src/acp/delegation/broker.rs:1176-1195 — 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 (20 corresponding lines) · ×8
Edited copy of a member (20 corresponding lines) src-tauri/src/commands/acp.rs:4979— src-tauri/src/commands/acp.rs:4979-4998 | src-tauri/src/commands/acp.rs:5066-5088 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src-tauri/src/commands/experts.rs:1040— src-tauri/src/commands/experts.rs:1040-1059 | src-tauri/src/commands/science.rs:855-874 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src-tauri/src/acp/agent_mentions.rs:226— src-tauri/src/acp/agent_mentions.rs:226-251 | src-tauri/src/acp/agent_mentions.rs:372-391 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src-tauri/src/parsers/codex_code_mode.rs:1373— src-tauri/src/parsers/codex_code_mode.rs:1373-1393 | src-tauri/src/parsers/codex_code_mode.rs:1446-1465 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src-tauri/src/commands/mcp.rs:4348— src-tauri/src/commands/mcp.rs:4348-4367 | src-tauri/src/commands/mcp.rs:4447-4468 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src-tauri/src/commands/browser_tools.rs:151— src-tauri/src/commands/browser_tools.rs:151-170 | src-tauri/src/commands/chat_authoring.rs:688-707 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src-tauri/src/acp/delegation/companion.rs:2220— src-tauri/src/acp/delegation/companion.rs:2220-2239 | src-tauri/src/acp/delegation/companion.rs:4268-4287 — 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) REDACTED:9— REDACTED:9-45 | src-tauri/src/db/migration/m20260930_000001_agent_setting_drop_adapter_channel.rs:9-28 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×8
Edited copy of a member (8 corresponding lines) src-tauri/src/acp/provider_models.rs:131— src-tauri/src/acp/provider_models.rs:131-138 | src-tauri/src/web/proxy_auth.rs:132-139 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src-tauri/src/acp/qoder.rs:130— src-tauri/src/acp/qoder.rs:130-137 | src-tauri/src/acp/zcode.rs:84-94 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src-tauri/src/work_task/git.rs:269— src-tauri/src/work_task/git.rs:269-276 | src-tauri/src/work_task/git.rs:373-380 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src-tauri/src/runtime_lock.rs:85— src-tauri/src/runtime_lock.rs:85-92 | src-tauri/src/runtime_lock.rs:95-102 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src-tauri/src/paths.rs:31— src-tauri/src/paths.rs:31-38 | src-tauri/src/pets/codex_import.rs:20-27 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src-tauri/src/db/service/conversation_tag_service.rs:533— src-tauri/src/db/service/conversation_tag_service.rs:533-542 | src-tauri/src/forge/settings.rs:523-530 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src-tauri/src/db/service/app_metadata_service.rs:53— src-tauri/src/db/service/app_metadata_service.rs:53-60 | src-tauri/src/db/service/conversation_service.rs:1622-1629 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src-tauri/src/parsers/hermes.rs:426— src-tauri/src/parsers/hermes.rs:426-433 | REDACTED:1005-1013 — 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.
Duplicated block (15 lines × 2) src-tauri/src/acp/opencode_catalog.rs:90— src-tauri/src/acp/opencode_catalog.rs:90-104 | src-tauri/src/acp/opencode_catalog.rs:126-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/opencode_catalog.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 (15 lines × 2) src-tauri/src/bin/codeg_server.rs:581— src-tauri/src/bin/codeg_server.rs:581-595 | src-tauri/src/lib.rs:940-954 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/bin/codeg_server.rs:581` 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) src-tauri/src/bin/codeg_server.rs:601— src-tauri/src/bin/codeg_server.rs:601-615 | src-tauri/src/lib.rs:961-975 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/bin/codeg_server.rs:601` 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) src-tauri/src/chat_channel/backends/telegram.rs:211— src-tauri/src/chat_channel/backends/telegram.rs:211-225 | src-tauri/src/chat_channel/backends/telegram.rs:593-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 (15 lines × 2) src-tauri/src/commands/folder_links.rs:791— src-tauri/src/commands/folder_links.rs:791-805 | src-tauri/src/commands/folder_links.rs:845-859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folder_links.rs:791` 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) REDACTED:2414— REDACTED:2414-2428 | REDACTED:3169-3183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2414` 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 (15 lines × 2) src-tauri/src/supervise.rs:233— src-tauri/src/supervise.rs:233-247 | src-tauri/src/supervise.rs:258-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 `src-tauri/src/supervise.rs:233` it begins part-way through the construct above it, so those 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 (15 lines × 2) src-tauri/src/chat_channel/backends/telegram.rs:333— src-tauri/src/chat_channel/backends/telegram.rs:333-347 | src-tauri/src/chat_channel/backends/telegram.rs:394-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/backends/telegram.rs:333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
AC2 · Forms & labels· <Select> field component without a label · ×7
<Select> field component without a label src/components/conversations/conversation-manage-dialog.tsx:896— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label src/components/conversations/conversation-manage-dialog.tsx:927— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label src/components/import-sessions/import-sessions-window.tsx:572— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label src/components/layout/push-workspace.tsx:590— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label src/components/project-boot/shadcn/shadcn-config-panel.tsx:51— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label src/components/settings/acp-agent-settings.tsx:9259— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label src/components/settings/acp-agent-settings.tsx:9403— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×7
Animation without a prefers-reduced-motion guard src/components/automations/automations-page.tsx:951— <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard src/components/browser/browser-toolbar.tsx:499— <div> moves — its `animate-[browser-loading_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard src/components/computer/computer-marker.tsx:60— <div> moves — its `animate-[computer-marker-fade_1100ms_ease-out_forwards]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard src/components/computer/computer-marker.tsx:65— <span> moves — its `animate-[computer-marker-ring_900ms_ease-out_forwards]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard src/components/conversations/sidebar-conversation-card.tsx:597— <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard src/components/layout/status-bar-tasks.tsx:15— <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard src/components/layout/status-bar-update.tsx:32— <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
No assertions: says the shortcut waits for computer use to be switched on src/components/settings/computer-settings.test.tsx:498— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: renders for a remote-desktop window src/components/settings/config-sync-settings.test.tsx:165— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: surfaces the last background failure src/components/settings/config-sync-settings.test.tsx:643— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: shows the model picker once real models load src/components/settings/cursor-config-panel.test.tsx:565— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: offers Thinking / Effort / Fast for the saved model's family src/components/settings/cursor-config-panel.test.tsx:581— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: follows a stop made in another window src/components/settings/web-service-settings.test.tsx:138— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: survives a mismatch that could not name a remote at all src/components/forge/forge-start-dialog.test.tsx:398— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×7
Edited copy of a member (21 corresponding lines) src-tauri/src/browser/surface_child.rs:1158— src-tauri/src/browser/surface_child.rs:1158-1178 | src-tauri/src/browser/surface_child.rs:1194-1215 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src-tauri/src/forge/deliver.rs:674— src-tauri/src/forge/deliver.rs:674-698 | src-tauri/src/forge/deliver.rs:712-732 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src-tauri/src/acp/delegation/companion.rs:700— src-tauri/src/acp/delegation/companion.rs:700-721 | src-tauri/src/acp/delegation/companion.rs:731-751 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src-tauri/src/commands/experts.rs:738— src-tauri/src/commands/experts.rs:738-758 | src-tauri/src/commands/science.rs:556-576 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src-tauri/src/commands/folders.rs:2965— src-tauri/src/commands/folders.rs:2965-2985 | src-tauri/src/commands/folders.rs:3064-3089 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src-tauri/src/commands/mcp_service.rs:386— src-tauri/src/commands/mcp_service.rs:386-406 | src-tauri/src/commands/mcp_service.rs:430-458 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src-tauri/src/acp/delegation/broker.rs:898— src-tauri/src/acp/delegation/broker.rs:898-921 | src-tauri/src/acp/delegation/broker.rs:993-1013 — 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 (27 corresponding lines) · ×7
Edited copy of a member (27 corresponding lines) src-tauri/src/acp/registry.rs:332— src-tauri/src/acp/registry.rs:332-361 | src-tauri/src/models/agent.rs:144-170 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src-tauri/src/forge/gitea.rs:475— src-tauri/src/forge/gitea.rs:475-509 | src-tauri/src/forge/gitlab.rs:725-751 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src-tauri/src/commands/computer.rs:926— src-tauri/src/commands/computer.rs:926-958 | src-tauri/src/commands/computer.rs:968-994 — 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) REDACTED:162— REDACTED:162-188 | REDACTED:88-114 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src-tauri/src/forge/cnb.rs:563— src-tauri/src/forge/cnb.rs:563-591 | src-tauri/src/forge/gitea.rs:999-1025 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src-tauri/src/acp/question.rs:898— src-tauri/src/acp/question.rs:898-924 | src-tauri/src/acp/question.rs:926-954 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src-tauri/src/parsers/kimi_code.rs:159— src-tauri/src/parsers/kimi_code.rs:159-192 | src-tauri/src/parsers/pi.rs:368-394 — 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 (17 lines × 2) src-tauri/src/acp/connection.rs:8929— src-tauri/src/acp/connection.rs:8929-8945 | src-tauri/src/acp/connection.rs:8997-9013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:8929` 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 (17 lines × 2) src-tauri/src/chat_channel/command_handlers.rs:13— src-tauri/src/chat_channel/command_handlers.rs:13-29 | src-tauri/src/chat_channel/session_commands.rs:1378-1394 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/command_handlers.rs:13` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/chat_channel/command_handlers.rs:12` calls `filter`, `contains` and `src-tauri/src/chat_channel/session_commands.rs:1377` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) src-tauri/src/commands/acp.rs:3483— src-tauri/src/commands/acp.rs:3483-3499 | src-tauri/src/commands/acp.rs:4031-4047 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:3483` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src-tauri/src/commands/canvas.rs:710— src-tauri/src/commands/canvas.rs:710-726 | src-tauri/src/commands/canvas.rs:739-755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/canvas.rs:710` 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) src-tauri/src/commands/forge.rs:1340— src-tauri/src/commands/forge.rs:1340-1356 | src-tauri/src/commands/forge.rs:1678-1694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/forge.rs:1340` it does not close everything it opens, so those 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 `draft` to `ForgeTaskDraft` in one and `ForgeIssuesTaskDraft` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 2) src-tauri/src/forge/gitea.rs:1098— src-tauri/src/forge/gitea.rs:1098-1114 | src-tauri/src/forge/github.rs:1731-1747 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:1098` 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) src-tauri/src/forge/gitea.rs:1392— src-tauri/src/forge/gitea.rs:1392-1408 | src-tauri/src/forge/github.rs:471-487 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 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.
AC2 · Forms & labels· <RadioGroup> field component without a label · ×6
<RadioGroup> field component without a label src/components/chat/ask-question-card.tsx:412— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label src/components/conversations/conversation-tag-form-dialog.tsx:270— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label src/components/layout/aux-panel-git-log-tab.tsx:2714— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label src/components/project-boot/hyperframes/hyperframes-launcher.tsx:317— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label src/components/project-boot/shadcn/create-project-dialog.tsx:268— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<RadioGroup> field component without a label src/components/project-boot/shadcn/create-project-dialog.tsx:292— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
TooManyFields: SessionState src-tauri/src/acp/session_state.rs:256— TooManyFields — 85 stored fields beside 29 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: WorkTaskInfo src-tauri/src/models/work_task.rs:9— TooManyFields — 43 stored fields. The bar is 30 stored fields; this is 13 over it, 1.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: Model src-tauri/src/db/entities/work_task.rs:51— TooManyFields — 40 stored fields. The bar is 30 stored fields; this is 10 over it, 1.33× 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: LiveSessionSnapshot src-tauri/src/acp/session_state.rs:2755— TooManyFields — 36 stored fields. The bar is 30 stored fields; this is 6 over it, 1.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: AcpAgentInfo src-tauri/src/acp/types.rs:1759— TooManyFields — 35 stored fields. 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: CodeBuddyLiveState src-tauri/src/acp/connection.rs:20635— TooManyFields — 32 stored fields. 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.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×6
Edited copy of a member (22 corresponding lines) src-tauri/src/chat_channel/session_commands.rs:301— src-tauri/src/chat_channel/session_commands.rs:301-332 | src-tauri/src/chat_channel/session_commands.rs:340-361 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src-tauri/src/commands/mcp.rs:3998— src-tauri/src/commands/mcp.rs:3998-4038 | src-tauri/src/commands/mcp.rs:5023-5044 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src-tauri/src/commands/experts.rs:359— src-tauri/src/commands/experts.rs:359-380 | src-tauri/src/commands/science.rs:323-344 — 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) REDACTED:44— REDACTED:44-69 | REDACTED:36-57 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src-tauri/src/acp/manager.rs:1092— src-tauri/src/acp/manager.rs:1092-1113 | src-tauri/src/acp/manager.rs:3186-3213 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src-tauri/src/commands/acp.rs:14908— src-tauri/src/commands/acp.rs:14908-14929 | src-tauri/src/commands/acp.rs:14948-14974 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×6
Edited copy of a member (14 corresponding lines) src-tauri/src/db/service/conversation_service.rs:558— src-tauri/src/db/service/conversation_service.rs:558-573 | src-tauri/src/db/service/conversation_service.rs:1041-1054 — 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) src-tauri/src/forge/deliver.rs:517— src-tauri/src/forge/deliver.rs:517-537 | src-tauri/src/forge/deliver.rs:549-562 — 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) src-tauri/src/acp/connection.rs:18976— src-tauri/src/acp/connection.rs:18976-18992 | src-tauri/src/acp/connection.rs:20319-20332 — 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) src-tauri/src/update/state.rs:178— src-tauri/src/update/state.rs:178-191 | src-tauri/src/update/state.rs:219-236 — 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) src-tauri/src/acp/codex_catalog_commit/mod.rs:348— src-tauri/src/acp/codex_catalog_commit/mod.rs:348-362 | src-tauri/src/commands/acp.rs:3818-3831 — 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) src-tauri/src/commands/backup/core.rs:313— src-tauri/src/commands/backup/core.rs:313-326 | src-tauri/src/commands/backup/restore.rs:1117-1130 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×6
Edited copies of one member (3 members, 9+ corresponding lines) src-tauri/src/commands/mcp.rs:920— src-tauri/src/commands/mcp.rs:920-931 | src-tauri/src/commands/mcp.rs:952-965 | src-tauri/src/commands/mcp.rs:4135-4143 — 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) src-tauri/src/acp/binary_cache.rs:1260— src-tauri/src/acp/binary_cache.rs:1260-1268 | src-tauri/src/acp/binary_cache.rs:1270-1278 | src-tauri/src/acp/binary_cache.rs:1280-1288 — 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) src-tauri/src/db/service/automation_service.rs:613— src-tauri/src/db/service/automation_service.rs:613-622 | src-tauri/src/db/service/work_task_service.rs:446-457 | src-tauri/src/db/service/work_task_service.rs:3227-3235 — 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) src-tauri/src/computer/launch_req.rs:132— src-tauri/src/computer/launch_req.rs:132-140 | src-tauri/src/forge/auto/webhook.rs:143-151 | src-tauri/src/parsers/cursor.rs:494-502 — 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) src-tauri/src/acp/idle_sweep.rs:51— src-tauri/src/acp/idle_sweep.rs:51-64 | src-tauri/src/acp/scratch_dir.rs:857-865 | src-tauri/src/office_watch/mod.rs:1109-1121 — 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) src-tauri/src/acp/codex_catalog_commit/mod.rs:406— src-tauri/src/acp/codex_catalog_commit/mod.rs:406-414 | src-tauri/src/acp/connection.rs:14013-14021 | src-tauri/src/commands/codex_catalog.rs:717-726 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×6
Edited copies of one member (3 members, 8+ corresponding lines) src-tauri/src/commands/feedback.rs:81— src-tauri/src/commands/feedback.rs:81-88 | src-tauri/src/commands/question.rs:86-93 | src-tauri/src/commands/session_info.rs:389-400 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src-tauri/src/commands/acp.rs:12429— src-tauri/src/commands/acp.rs:12429-12444 | src-tauri/src/commands/acp.rs:13717-13724 | src-tauri/src/commands/acp.rs:15272-15279 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src-tauri/src/db/service/conversation_tag_service.rs:188— src-tauri/src/db/service/conversation_tag_service.rs:188-197 | src-tauri/src/db/service/folder_group_service.rs:49-56 | src-tauri/src/db/service/work_task_service.rs:3419-3426 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src-tauri/src/acp/codex_catalog_commit/lock.rs:132— src-tauri/src/acp/codex_catalog_commit/lock.rs:132-139 | src-tauri/src/browser/registry.rs:205-214 | src-tauri/src/office_watch/mod.rs:332-339 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src-tauri/src/chat_channel/session_commands.rs:1665— src-tauri/src/chat_channel/session_commands.rs:1665-1673 | src-tauri/src/chat_channel/tool_detail.rs:127-134 | src-tauri/src/parsers/mod.rs:595-602 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src-tauri/src/db/service/automation_service.rs:249— src-tauri/src/db/service/automation_service.rs:249-256 | REDACTED:28-36 | REDACTED:23-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×6
Edited copy of a member (4 corresponding lines) src-tauri/src/db/service/canvas_service.rs:70— src-tauri/src/db/service/canvas_service.rs:70-73 | src-tauri/src/db/service/tab_service.rs:48-51 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src-tauri/src/parsers/opencode_context_window.rs:557— src-tauri/src/parsers/opencode_context_window.rs:557-560 | src-tauri/src/parsers/summary_cache.rs: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) src-tauri/src/commands/config_sync/snapshot.rs:503— src-tauri/src/commands/config_sync/snapshot.rs:503-506 | src-tauri/src/parsers/codex.rs:5899-5903 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:288— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:288-291 | src-tauri/science/skills/peer-review/scripts/_common.py:261-264 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src-tauri/src/acp/codex_endpoint_catalog.rs:49— src-tauri/src/acp/codex_endpoint_catalog.rs:49-52 | src-tauri/src/turn_timings.rs:138-141 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src-tauri/src/automation/engine.rs:1182— src-tauri/src/automation/engine.rs:1182-1185 | src-tauri/src/work_task/engine.rs:8615-8618 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (12–13 lines × 2) src-tauri/src/acp_transcript.rs:963— src-tauri/src/acp_transcript.rs:963-974 | src-tauri/src/turn_timings.rs:254-266 — before extracting anything, compare `src-tauri/src/acp_transcript.rs` and `src-tauri/src/turn_timings.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp_transcript.rs:963` it does not close everything it opens, so those 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, `src-tauri/src/acp_transcript.rs:960` calls `is_empty` and `src-tauri/src/turn_timings.rs:253` 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) src-tauri/src/commands/acp.rs:2782— src-tauri/src/commands/acp.rs:2782-2794 | src-tauri/src/commands/acp.rs:2815-2826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:2782` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) src-tauri/src/commands/folders.rs:52— src-tauri/src/commands/folders.rs:52-64 | src-tauri/src/commands/folders.rs:85-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.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 (12–13 lines × 2) src-tauri/src/commands/mcp.rs:1649— src-tauri/src/commands/mcp.rs:1649-1660 | src-tauri/src/commands/mcp.rs:1675-1687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1649` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) src-tauri/src/parsers/codebuddy.rs:473— src-tauri/src/parsers/codebuddy.rs:473-485 | src-tauri/src/parsers/codebuddy.rs:502-513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:473` it begins part-way through the construct above it, so those 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–13 lines × 2) src-tauri/science/skills/exploratory-data-analysis/scripts/_common.py:262— src-tauri/science/skills/exploratory-data-analysis/scripts/_common.py:262-274 | src-tauri/science/skills/scientific-visualization/scripts/_common.py:75-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 `src-tauri/science/skills/exploratory-data-analysis/scripts/_common.py: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 (10 lines × 3) src-tauri/src/commands/experts.rs:768— src-tauri/src/commands/experts.rs:768-777 | src-tauri/src/commands/office_tools.rs:1217-1226 | src-tauri/src/commands/science.rs:586-595 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/office_tools.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:768` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src-tauri/src/commands/mcp.rs:971— src-tauri/src/commands/mcp.rs:971-980 | src-tauri/src/commands/mcp.rs:1511-1520 | src-tauri/src/commands/mcp.rs:1552-1561 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) src-tauri/src/commands/acp.rs:10638— src-tauri/src/commands/acp.rs:10638-10647 | src-tauri/src/parsers/hermes.rs:596-605 | REDACTED:1056-1065 — before extracting anything, compare `src-tauri/src/parsers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) src-tauri/src/commands/remote_proxy.rs:416— src-tauri/src/commands/remote_proxy.rs:416-425 | src-tauri/src/commands/remote_proxy.rs:740-752 | src-tauri/src/commands/remote_proxy.rs:1330-1340 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/remote_proxy.rs:416` 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 (10 lines × 3) src-tauri/src/commands/acp.rs:3465— src-tauri/src/commands/acp.rs:3465-3474 | src-tauri/src/commands/acp.rs:3483-3492 | src-tauri/src/commands/acp.rs:4031-4040 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:3465` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:28— src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:28-37 | src-tauri/science/skills/scholar-evaluation/scripts/generate_report_scaffold.py:190-201 | src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:243-252 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:28` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/mcp.rs:1137— src-tauri/src/commands/mcp.rs:1137-1144 | src-tauri/src/commands/mcp.rs:1241-1248 | src-tauri/src/commands/mcp.rs:1500-1507 | src-tauri/src/commands/mcp.rs:4300-4307 — 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 `src-tauri/src/commands/mcp.rs:1137` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/mcp.rs:1741— src-tauri/src/commands/mcp.rs:1741-1748 | src-tauri/src/commands/mcp.rs:1898-1905 | src-tauri/src/commands/mcp.rs:2553-2560 | src-tauri/src/commands/mcp.rs:2723-2730 — 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 `src-tauri/src/commands/mcp.rs:1741` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/mcp.rs:2942— src-tauri/src/commands/mcp.rs:2942-2949 | src-tauri/src/commands/mcp.rs:3061-3068 | src-tauri/src/commands/mcp.rs:3164-3171 | src-tauri/src/commands/mcp.rs:5220-5227 — 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 `src-tauri/src/commands/mcp.rs:2942` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/windows.rs:673— src-tauri/src/commands/windows.rs:673-680 | src-tauri/src/commands/windows.rs:1005-1012 | src-tauri/src/commands/windows.rs:1129-1136 | src-tauri/src/commands/windows.rs:1217-1224 — 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 `src-tauri/src/commands/windows.rs:673` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/parsers/codebuddy.rs:472— src-tauri/src/parsers/codebuddy.rs:472-479 | src-tauri/src/parsers/codebuddy.rs:501-508 | src-tauri/src/parsers/pi.rs:461-468 | src-tauri/src/parsers/pi.rs:485-492 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/pi.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:472` it does not close everything it opens, so those 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 × 4) src-tauri/src/commands/version_control.rs:272— src-tauri/src/commands/version_control.rs:272-279 | src-tauri/src/commands/version_control.rs:368-375 | src-tauri/src/commands/version_control.rs:471-478 | src-tauri/src/commands/version_control.rs:564-571 — 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 `src-tauri/src/commands/version_control.rs:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TaskEngine::launch (cyclomatic 35) src-tauri/src/work_task/engine.rs:1279— TaskEngine::launch 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.
TaskEngine::deliver_pr_closing (cyclomatic 19) src-tauri/src/work_task/engine.rs:4739— TaskEngine::deliver_pr_closing 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.
TaskEngine::recover_merging (cyclomatic 17) src-tauri/src/work_task/engine.rs:6371— TaskEngine::recover_merging 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.
TaskEngine::reconcile_once (cyclomatic 17) src-tauri/src/work_task/engine.rs:6703— TaskEngine::reconcile_once 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.
TaskEngine::run_preflight (cyclomatic 16) src-tauri/src/work_task/engine.rs:3777— TaskEngine::run_preflight 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.
TodoComment src-tauri/src/parsers/grok.rs:181— /// ├── plan.json # TODO state — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src-tauri/src/db/service/work_task_service.rs:997— /// todo / failed / canceled. Moving to another folder is allowed only for a — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src-tauri/src/db/service/work_task_service.rs:3671— // todo→queued, queued→preparing, preparing→queued — all on the timeline. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src-tauri/src/db/migration/m20260801_000001_work_task.rs:10— // todo → queued → running ⇄ awaiting_input → review → merging → done — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src-tauri/src/db/entities/work_task.rs:5— /// `todo → queued → preparing → running ⇄ awaiting_input → review → merging → — 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.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×5
Edited copy of a member (28 corresponding lines) src-tauri/src/chat_channel/session_commands.rs:1112— src-tauri/src/chat_channel/session_commands.rs:1112-1186 | src-tauri/src/chat_channel/session_commands.rs:1244-1280 — 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) src-tauri/science/skills/statistical-power/scripts/simulate_power.py:232— src-tauri/science/skills/statistical-power/scripts/simulate_power.py:232-266 | src-tauri/science/skills/statistical-power/scripts/simulate_power.py:271-298 — 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) src-tauri/src/parsers/codex.rs:384— src-tauri/src/parsers/codex.rs:384-415 | src-tauri/src/parsers/kimi_code.rs:125-152 — 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) src-tauri/src/db/service/chat_channel_service.rs:45— src-tauri/src/db/service/chat_channel_service.rs:45-72 | src-tauri/src/db/service/model_provider_service.rs:43-70 — 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) src-tauri/src/work_task/engine.rs:5013— src-tauri/src/work_task/engine.rs:5013-5051 | src-tauri/src/work_task/engine.rs:7611-7638 — 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 copy of a member (23 corresponding lines) · ×5
Edited copy of a member (23 corresponding lines) src-tauri/src/commands/acp.rs:6261— src-tauri/src/commands/acp.rs:6261-6289 | src-tauri/src/computer/helper/driver_proc.rs:117-139 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src-tauri/src/automation/engine.rs:216— src-tauri/src/automation/engine.rs:216-246 | src-tauri/src/work_task/engine.rs:475-497 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src-tauri/src/parsers/hermes.rs:79— src-tauri/src/parsers/hermes.rs:79-101 | REDACTED:74-99 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src-tauri/src/commands/canvas.rs:702— src-tauri/src/commands/canvas.rs:702-726 | src-tauri/src/commands/canvas.rs:733-755 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src-tauri/src/db/migration/m20260829_000001_folder_group.rs:90— src-tauri/src/db/migration/m20260829_000001_folder_group.rs:90-112 | src-tauri/src/db/migration/m20260929_000001_canvas_board.rs:131-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.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×5
Edited copy of a member (25 corresponding lines) src-tauri/src/acp/delegation/listener.rs:1474— src-tauri/src/acp/delegation/listener.rs:1474-1498 | src-tauri/src/acp/delegation/listener.rs:1518-1542 — 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) src-tauri/src/acp/manager.rs:4227— src-tauri/src/acp/manager.rs:4227-4255 | src-tauri/src/acp/manager.rs:4384-4408 — 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) src-tauri/src/commands/mcp.rs:4373— src-tauri/src/commands/mcp.rs:4373-4397 | src-tauri/src/commands/mcp.rs:4474-4498 — 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) src-tauri/src/acp/delegation/broker.rs:3385— src-tauri/src/acp/delegation/broker.rs:3385-3409 | src-tauri/src/acp/delegation/broker.rs:3428-3460 — 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) src-tauri/src/web/handlers/acp.rs:166— src-tauri/src/web/handlers/acp.rs:166-197 | src-tauri/src/web/handlers/acp.rs:481-505 — 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 (17 corresponding lines) · ×5
Edited copy of a member (17 corresponding lines) src-tauri/src/forge/cnb.rs:972— src-tauri/src/forge/cnb.rs:972-993 | src-tauri/src/forge/gitea.rs:1457-1473 — 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) src-tauri/src/commands/experts.rs:302— src-tauri/src/commands/experts.rs:302-318 | src-tauri/src/commands/science.rs:270-286 — 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) src-tauri/src/commands/generative_ui.rs:278— src-tauri/src/commands/generative_ui.rs:278-295 | src-tauri/src/commands/generative_ui.rs:368-384 — 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) src-tauri/src/commands/folders.rs:4178— src-tauri/src/commands/folders.rs:4178-4197 | src-tauri/src/web/handlers/workspace_files.rs:73-89 — 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) src-tauri/src/commands/remote_proxy.rs:538— src-tauri/src/commands/remote_proxy.rs:538-559 | src-tauri/src/web/handlers/files.rs:691-707 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×5
Edited copies of one member (3 members, 11+ corresponding lines) src-tauri/src/forge/cnb.rs:306— src-tauri/src/forge/cnb.rs:306-317 | src-tauri/src/forge/gitea.rs:284-294 | src-tauri/src/forge/github.rs:505-518 — 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) src-tauri/src/acp/connection.rs:5212— src-tauri/src/acp/connection.rs:5212-5223 | src-tauri/src/acp/connection.rs:5311-5321 | src-tauri/src/acp/connection.rs:12410-12424 — 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) src-tauri/src/work_task/git.rs:391— src-tauri/src/work_task/git.rs:391-401 | src-tauri/src/work_task/git.rs:409-419 | src-tauri/src/work_task/git.rs:566-578 — 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) src-tauri/src/chat_channel/manager.rs:152— src-tauri/src/chat_channel/manager.rs:152-162 | src-tauri/src/chat_channel/manager.rs:168-178 | src-tauri/src/chat_channel/manager.rs:200-210 — 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) src-tauri/src/commands/assistants.rs:111— src-tauri/src/commands/assistants.rs:111-121 | src-tauri/src/commands/assistants.rs:128-138 | src-tauri/src/commands/assistants.rs:146-156 — 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.
Duplicated block (21 lines × 2) src-tauri/src/commands/canvas.rs:484— src-tauri/src/commands/canvas.rs:484-504 | src-tauri/src/commands/canvas.rs:627-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/canvas.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 (21 lines × 2) src-tauri/src/commands/experts.rs:1015— src-tauri/src/commands/experts.rs:1015-1035 | src-tauri/src/commands/science.rs:830-850 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:1015` 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 (21 lines × 2) src-tauri/src/commands/mcp.rs:1825— src-tauri/src/commands/mcp.rs:1825-1845 | src-tauri/src/commands/mcp.rs:1976-1996 — both copies are in the same file, so extract the block into 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) src-tauri/src/parsers/hermes.rs:81— src-tauri/src/parsers/hermes.rs:81-101 | REDACTED:79-99 — before extracting anything, compare `src-tauri/src/parsers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/hermes.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 (21 lines × 2) src-tauri/src/db/migration/m20260227_000001_folder_parent_branch.rs:8— src-tauri/src/db/migration/m20260227_000001_folder_parent_branch.rs:8-28 | src-tauri/src/db/migration/m20260423_000001_drop_folder_parent_branch.rs:8-28 — before extracting anything, compare `src-tauri/src/db/migration/m20260227_000001_folder_parent_branch.rs` and `src-tauri/src/db/migration/m20260423_000001_drop_folder_parent_branch.rs` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) src-tauri/src/acp/connection.rs:9488— src-tauri/src/acp/connection.rs:9488-9505 | src-tauri/src/acp/connection.rs:9792-9809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:9488` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) src-tauri/src/commands/acp.rs:13143— src-tauri/src/commands/acp.rs:13143-13160 | src-tauri/src/commands/acp.rs:13429-13446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:13143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) src-tauri/src/commands/folders.rs:5557— src-tauri/src/commands/folders.rs:5557-5574 | src-tauri/src/commands/folders.rs:5656-5673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/commands/folders.rs:5575` calls `clone` and `src-tauri/src/commands/folders.rs:5675` 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 (18 lines × 2) src-tauri/src/commands/mcp.rs:2603— src-tauri/src/commands/mcp.rs:2603-2620 | src-tauri/src/commands/mcp.rs:2795-2812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:2603` 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) src-tauri/src/parsers/codebuddy.rs:1217— src-tauri/src/parsers/codebuddy.rs:1217-1234 | src-tauri/src/parsers/kimi_code.rs:1062-1079 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:1217` 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) src-tauri/src/acp/delegation/broker.rs:906— src-tauri/src/acp/delegation/broker.rs:906-921 | src-tauri/src/acp/delegation/broker.rs:998-1013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:906` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/mcp.rs:1861— src-tauri/src/commands/mcp.rs:1861-1876 | src-tauri/src/commands/mcp.rs:2008-2023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1861` 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) src-tauri/src/forge/cnb.rs:622— src-tauri/src/forge/cnb.rs:622-637 | src-tauri/src/forge/gitea.rs:1058-1073 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/gitea.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) src-tauri/src/forge/gitea.rs:170— src-tauri/src/forge/gitea.rs:170-185 | src-tauri/src/forge/gitlab.rs:293-308 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/gitlab.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.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 (16 lines × 2) src-tauri/src/parsers/cursor.rs:1936— src-tauri/src/parsers/cursor.rs:1936-1951 | src-tauri/src/parsers/grok.rs:1466-1481 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–10 lines × 2) src-tauri/src/automation/engine.rs:269— src-tauri/src/automation/engine.rs:269-278 | src-tauri/src/work_task/engine.rs:553-561 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/automation/engine.rs:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `engine` to `Arc<AutomationEngine>` in one and `Arc<TaskEngine>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9–10 lines × 2) src-tauri/src/chat_channel/session_event_subscriber.rs:431— src-tauri/src/chat_channel/session_event_subscriber.rs:431-440 | src-tauri/src/chat_channel/session_event_subscriber.rs:455-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/session_event_subscriber.rs:431` it does not close everything it opens, so those exact lines 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) REDACTED:45— REDACTED:45-54 | REDACTED:80-88 — both copies are in the same file, so extract the block into 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) src-tauri/src/db/service/work_task_service.rs:490— src-tauri/src/db/service/work_task_service.rs:490-499 | src-tauri/src/db/service/work_task_service.rs:507-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.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 (9–10 lines × 2) src-tauri/src/forge/cnb.rs:394— src-tauri/src/forge/cnb.rs:394-403 | src-tauri/src/forge/cnb.rs:501-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/forge/cnb.rs:500` calls `Some` and `src-tauri/src/forge/cnb.rs:393` 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–8 lines × 2) src-tauri/src/acp/connection.rs:2551— src-tauri/src/acp/connection.rs:2551-2557 | src-tauri/src/acp/connection.rs:2709-2716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:2709` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) src-tauri/src/browser/smoke.rs:642— src-tauri/src/browser/smoke.rs:642-649 | src-tauri/src/browser/smoke.rs:849-855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) src-tauri/src/commands/acp.rs:10821— src-tauri/src/commands/acp.rs:10821-10828 | src-tauri/src/commands/acp.rs:10976-10982 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:10821` it begins part-way through the construct above it, so those 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) src-tauri/src/commands/project_boot.rs:143— src-tauri/src/commands/project_boot.rs:143-149 | src-tauri/src/commands/project_boot.rs:497-504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/project_boot.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. 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 × 2) src-tauri/src/parsers/claude.rs:1602— src-tauri/src/parsers/claude.rs:1602-1609 | src-tauri/src/parsers/claude.rs:2112-2118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:1602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) src-tauri/src/commands/custom_skills.rs:373— src-tauri/src/commands/custom_skills.rs:373-379 | src-tauri/src/commands/experts.rs:861-867 | src-tauri/src/commands/office_tools.rs:1116-1122 | src-tauri/src/commands/science.rs:684-690 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/experts.rs` as WHOLE FILES: this scan already matched 6 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 `src-tauri/src/commands/custom_skills.rs:373` 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 × 4) src-tauri/src/commands/folders.rs:5423— src-tauri/src/commands/folders.rs:5423-5431 | src-tauri/src/commands/folders.rs:5489-5495 | src-tauri/src/commands/folders.rs:5519-5525 | src-tauri/src/commands/folders.rs:5565-5574 — 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 `src-tauri/src/commands/folders.rs:5565` it begins part-way through the construct above it, so those 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 (7 lines × 4) src-tauri/src/commands/folders.rs:5418— src-tauri/src/commands/folders.rs:5418-5424 | src-tauri/src/commands/folders.rs:5484-5490 | src-tauri/src/commands/folders.rs:5514-5520 | src-tauri/src/commands/folders.rs:5747-5753 — 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 `src-tauri/src/commands/folders.rs:5418` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) src-tauri/src/parsers/grok.rs:1193— src-tauri/src/parsers/grok.rs:1193-1199 | src-tauri/src/parsers/kimi_code.rs:1022-1028 | src-tauri/src/parsers/pi.rs:571-577 | src-tauri/src/parsers/pi.rs:1380-1386 — before extracting anything, compare `src-tauri/src/parsers/grok.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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 (7 lines × 4) src-tauri/src/automation/engine.rs:754— src-tauri/src/automation/engine.rs:754-760 | src-tauri/src/automation/engine.rs:762-768 | src-tauri/src/work_task/engine.rs:6842-6848 | src-tauri/src/work_task/engine.rs:6850-6856 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Outbound HTTP without resilience src-tauri/src/acp/binary_cache.rs:1178— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience src-tauri/src/commands/version_control.rs:267— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience src-tauri/src/commands/version_control.rs:362— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience src-tauri/src/commands/version_control.rs:466— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience src-tauri/src/commands/version_control.rs:559— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
DelegationBroker::start_delegation_inner (cognitive 51) src-tauri/src/acp/delegation/broker.rs:2484— DelegationBroker::start_delegation_inner has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (41 pts), match/switch 7 (10 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.
DelegationBroker::resume_with_context (cognitive 33) src-tauri/src/acp/delegation/broker.rs:4281— DelegationBroker::resume_with_context has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (28 pts), match/switch 5 (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.
DelegationBroker::resume_delegation (cognitive 23) src-tauri/src/acp/delegation/broker.rs:4054— DelegationBroker::resume_delegation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 2 (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.
DelegationBroker::get_tasks_status (cognitive 17) src-tauri/src/acp/delegation/broker.rs:3685— DelegationBroker::get_tasks_status has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 7). 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.
CliRunService::launch_steps (cognitive 28) src-tauri/src/cli_run/service.rs:730— CliRunService::launch_steps has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, match/switch 6, 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.
CliRunService::start (cognitive 22) src-tauri/src/cli_run/service.rs:603— CliRunService::start has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 1 (3 pts), match/switch 2 (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.
CliRunService::apply_selections (cognitive 19) src-tauri/src/cli_run/service.rs:1283— CliRunService::apply_selections has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (4 pts), loops 3, 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.
CliRunService::pump (cognitive 19) src-tauri/src/cli_run/service.rs:1572— CliRunService::pump has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 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· Edited copy of a member (49 corresponding lines) · ×4
Edited copy of a member (49 corresponding lines) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:159— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:159-207 | src-tauri/science/skills/peer-review/scripts/_common.py:124-180 — 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.
Edited copy of a member (49 corresponding lines) src-tauri/src/commands/mcp.rs:5093— src-tauri/src/commands/mcp.rs:5093-5146 | src-tauri/src/commands/mcp.rs:5379-5427 — 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.
Edited copy of a member (49 corresponding lines) src-tauri/src/db/service/work_task_service.rs:1834— src-tauri/src/db/service/work_task_service.rs:1834-1882 | src-tauri/src/db/service/work_task_service.rs:2099-2159 — 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.
Edited copy of a member (49 corresponding lines) src-tauri/src/db/service/work_task_service.rs:1514— src-tauri/src/db/service/work_task_service.rs:1514-1586 | src-tauri/src/db/service/work_task_service.rs:3092-3140 — 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 (36 corresponding lines) · ×4
Edited copy of a member (36 corresponding lines) src-tauri/src/db/service/work_task_service.rs:2948— src-tauri/src/db/service/work_task_service.rs:2948-2985 | src-tauri/src/db/service/work_task_service.rs:3010-3045 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src-tauri/src/chat_channel/command_handlers.rs:9— src-tauri/src/chat_channel/command_handlers.rs:9-47 | src-tauri/src/chat_channel/session_commands.rs:1375-1410 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src-tauri/src/browser/shim/macos.rs:191— src-tauri/src/browser/shim/macos.rs:191-226 | src-tauri/src/browser/shim/macos.rs:299-334 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src-tauri/src/acp/file_system_runtime.rs:984— src-tauri/src/acp/file_system_runtime.rs:984-1019 | src-tauri/src/acp/file_system_runtime.rs:1024-1062 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×4
Edited copy of a member (24 corresponding lines) src-tauri/src/commands/acp.rs:10843— src-tauri/src/commands/acp.rs:10843-10866 | src-tauri/src/commands/acp.rs:10998-11028 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src-tauri/src/acp_transcript.rs:953— src-tauri/src/acp_transcript.rs:953-979 | src-tauri/src/turn_timings.rs:246-269 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src-tauri/src/backgrounds/marketplace.rs:436— src-tauri/src/backgrounds/marketplace.rs:436-459 | src-tauri/src/pets/marketplace.rs:392-421 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src-tauri/src/acp/delegation/event_emitter.rs:162— src-tauri/src/acp/delegation/event_emitter.rs:162-186 | src-tauri/src/acp/delegation/event_emitter.rs:197-220 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×4
Edited copy of a member (26 corresponding lines) src-tauri/src/db/service/work_task_service.rs:1071— src-tauri/src/db/service/work_task_service.rs:1071-1096 | src-tauri/src/db/service/work_task_service.rs:2380-2405 — 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) src-tauri/src/forge/gitea.rs:1218— src-tauri/src/forge/gitea.rs:1218-1243 | src-tauri/src/forge/gitlab.rs:1192-1217 — 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) src-tauri/src/commands/folders.rs:4015— src-tauri/src/commands/folders.rs:4015-4040 | src-tauri/src/commands/folders.rs:4046-4072 — 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) src-tauri/science/skills/exploratory-data-analysis/scripts/_common.py:255— src-tauri/science/skills/exploratory-data-analysis/scripts/_common.py:255-280 | src-tauri/science/skills/scientific-visualization/scripts/_common.py:73-100 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×4
Edited copies of one member (3 members, 10+ corresponding lines) src-tauri/src/parsers/codebuddy.rs:861— src-tauri/src/parsers/codebuddy.rs:861-870 | src-tauri/src/parsers/kimi_code.rs:921-930 | src-tauri/src/parsers/kimi_code.rs:934-943 — 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) src-tauri/src/acp/connection.rs:7618— src-tauri/src/acp/connection.rs:7618-7627 | src-tauri/src/acp/connection.rs:7656-7665 | src-tauri/src/acp/connection.rs:7678-7687 — 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) src-tauri/src/db/migration/m20260608_000001_conversation_title_locked.rs:45— src-tauri/src/db/migration/m20260608_000001_conversation_title_locked.rs:45-54 | src-tauri/src/db/migration/m20260610_000001_conversation_pinned_at.rs:24-33 | src-tauri/src/db/migration/m20261017_000002_conversation_source.rs:25-34 — 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) src-tauri/src/db/migration/m20260727_000001_custom_agent_skills.rs:28— src-tauri/src/db/migration/m20260727_000001_custom_agent_skills.rs:28-37 | src-tauri/src/db/migration/m20260728_000001_custom_agent_skills_dir.rs:24-33 | src-tauri/src/db/migration/m20260808_000001_custom_agent_supports_mcp.rs:31-40 — 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 (5 members, 10+ corresponding lines) · ×4
Edited copies of one member (5 members, 10+ corresponding lines) src-tauri/src/acp/delegation/listener.rs:947— src-tauri/src/acp/delegation/listener.rs:947-956 | src-tauri/src/acp/delegation/listener.rs:961-970 | src-tauri/src/acp/delegation/listener.rs:977-986 | src-tauri/src/acp/delegation/listener.rs:993-1002 | src-tauri/src/acp/delegation/listener.rs:1011-1020 — 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) src-tauri/src/forge/cnb.rs:815— src-tauri/src/forge/cnb.rs:815-824 | src-tauri/src/forge/gitea.rs:1161-1174 | src-tauri/src/forge/gitea.rs:1201-1211 | src-tauri/src/forge/gitlab.rs:1143-1153 | src-tauri/src/forge/gitlab.rs:1177-1187 — 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) src-tauri/src/db/migration/m20260221_000001_folder_is_open.rs:24— src-tauri/src/db/migration/m20260221_000001_folder_is_open.rs:24-33 | src-tauri/src/db/migration/m20260424_000001_folder_color.rs:26-35 | src-tauri/src/db/migration/m20260607_000001_folder_parent_id.rs:25-34 | src-tauri/src/db/migration/m20260611_000001_folder_is_chat.rs:24-33 | src-tauri/src/db/migration/m20260717_000001_folder_alias.rs:24-33 — 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) src-tauri/src/db/migration/m20260807_000001_work_task_scheduled_at.rs:27— src-tauri/src/db/migration/m20260807_000001_work_task_scheduled_at.rs:27-36 | src-tauri/src/db/migration/m20260819_000001_work_task_completion_kind.rs:31-40 | src-tauri/src/db/migration/m20261015_000001_work_task_deferred_at.rs:29-38 | src-tauri/src/db/migration/m20261022_000001_work_task_delivery.rs:26-35 | src-tauri/src/db/migration/m20261112_000001_work_task_writeback_drafts.rs:25-34 — 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.
Duplicated block (20 lines × 2) src-tauri/src/commands/office_tools.rs:710— src-tauri/src/commands/office_tools.rs:710-729 | src-tauri/src/commands/office_tools.rs:731-750 — both copies are in the same file, so extract the block into 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) src-tauri/src/web/mod.rs:689— src-tauri/src/web/mod.rs:689-708 | src-tauri/src/web/mod.rs:1042-1061 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/web/mod.rs:1065` calls `emit_web_service_status_changed` and `src-tauri/src/web/mod.rs:710` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 2) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:81— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:81-100 | src-tauri/science/skills/peer-review/scripts/_common.py:66-85 — before extracting anything, compare `src-tauri/science/skills/hypothesis-generation/scripts/_common.py` and `src-tauri/science/skills/peer-review/scripts/_common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/science/skills/hypothesis-generation/scripts/_common.py:80` calls `_reject_url_like_path` and `src-tauri/science/skills/peer-review/scripts/_common.py:64` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 2) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:389— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:389-408 | src-tauri/science/skills/peer-review/scripts/_common.py:350-369 — before extracting anything, compare `src-tauri/science/skills/hypothesis-generation/scripts/_common.py` and `src-tauri/science/skills/peer-review/scripts/_common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11–13 lines × 2) src-tauri/src/acp/connection.rs:10570— src-tauri/src/acp/connection.rs:10570-10580 | src-tauri/src/acp/connection.rs:10734-10746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:10570` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/acp.rs:10845— src-tauri/src/commands/acp.rs:10845-10855 | src-tauri/src/commands/acp.rs:11000-11012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:11000` it does not close everything it opens, so those 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–13 lines × 2) src-tauri/src/commands/mcp.rs:1627— src-tauri/src/commands/mcp.rs:1627-1639 | src-tauri/src/commands/mcp.rs:4163-4173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1627` it begins part-way through the construct above it, so those 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–13 lines × 2) src-tauri/src/commands/windows.rs:2430— src-tauri/src/commands/windows.rs:2430-2440 | src-tauri/src/commands/windows.rs:2508-2520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/windows.rs:2508` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src-tauri/src/chat_channel/message_formatter.rs:41— src-tauri/src/chat_channel/message_formatter.rs:41-51 | src-tauri/src/chat_channel/session_event_subscriber.rs:558-569 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/message_formatter.rs:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src-tauri/src/commands/acp.rs:6268— src-tauri/src/commands/acp.rs:6268-6278 | src-tauri/src/computer/helper/driver_proc.rs:121-132 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11–12 lines × 2) src-tauri/src/commands/browser.rs:413— src-tauri/src/commands/browser.rs:413-424 | src-tauri/src/commands/browser.rs:598-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/browser.rs:413` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src-tauri/src/parsers/codex.rs:3080— src-tauri/src/parsers/codex.rs:3080-3091 | src-tauri/src/parsers/codex.rs:4306-4316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codex.rs:3080` it does not close everything it opens, so those 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) src-tauri/src/commands/folders.rs:3538— src-tauri/src/commands/folders.rs:3538-3545 | src-tauri/src/commands/folders.rs:3875-3883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:3538` it does not close everything it opens, so those exact lines 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 × 2) src-tauri/src/commands/folders.rs:6563— src-tauri/src/commands/folders.rs:6563-6570 | src-tauri/src/commands/folders.rs:6729-6737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) src-tauri/src/computer/helper/driver_proc.rs:482— src-tauri/src/computer/helper/driver_proc.rs:482-490 | src-tauri/src/computer/helper/driver_proc.rs:705-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/computer/helper/driver_proc.rs:482` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/computer/helper/driver_proc.rs:481` calls `drop` and `src-tauri/src/computer/helper/driver_proc.rs:704` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) src-tauri/src/parsers/codex.rs:385— src-tauri/src/parsers/codex.rs:385-393 | src-tauri/src/parsers/kimi_code.rs:126-133 — before extracting anything, compare `src-tauri/src/parsers/codex.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codex.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 (5 lines × 3) src-tauri/src/commands/folders.rs:1798— src-tauri/src/commands/folders.rs:1798-1802 | src-tauri/src/commands/folders.rs:3704-3708 | src-tauri/src/commands/folders.rs:3899-3905 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:1798` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/folders.rs:1676— src-tauri/src/commands/folders.rs:1676-1680 | src-tauri/src/commands/folders.rs:3706-3710 | src-tauri/src/commands/folders.rs:3901-3907 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:3901` it begins part-way through the construct above it, so those 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 × 3) src-tauri/src/commands/browser.rs:1304— src-tauri/src/commands/browser.rs:1304-1308 | src-tauri/src/commands/browser.rs:2364-2368 | src-tauri/src/commands/browser.rs:3653-3657 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/browser.rs:1304` 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 × 3) src-tauri/src/commands/windows.rs:693— src-tauri/src/commands/windows.rs:693-697 | src-tauri/src/commands/windows.rs:1028-1032 | src-tauri/src/commands/windows.rs:1245-1249 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/windows.rs:693` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
X18 · Disposal-pattern correctness· Explicit release owed and not made on every path · ×4
Explicit release owed and not made on every path src-tauri/src/db/service/conversation_service.rs:1202— `txn` (line 1202) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 1303; the `return` on line 1238 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
Explicit release owed and not made on every path src-tauri/src/commands/computer.rs:1394— `admitted` (line 1394) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
Explicit release owed and not made on every path src-tauri/src/commands/computer.rs:1531— `admitted` (line 1531) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
Explicit release owed and not made on every path src-tauri/src/commands/computer.rs:1616— `admitted` (line 1616) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
X2 · Cancellation propagation· Async function without AbortSignal · ×4
Async function without AbortSignal: uploadAttachment src/lib/api.ts:4577— `uploadAttachment` 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: workspaceFileFetch src/lib/api.ts:4717— `workspaceFileFetch` 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: seedRelease public/sw.js:137— `seedRelease` 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: fetchBootDocument public/sw.js:189— `fetchBootDocument` 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 })`.
AC2 · Forms & labels· <Textarea> field component without a label · ×3
<Textarea> field component without a label src/components/chat/plan-approval-card.tsx:91— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Textarea> field component without a label src/components/layout/commit-dialog.tsx:1305— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Textarea> field component without a label src/components/settings/acp-agent-settings.tsx:9003— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
Low contrast colour pair in CSS (3.6:1) src-tauri/experts/skills/brainstorming/scripts/frame-template.html:131— `.option.selected .letter` sets color: white on background-color: #0a84ff — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.6:1) src-tauri/experts/skills/brainstorming/scripts/frame-template.html:193— `.mock-nav` sets color: white on background-color: #0a84ff — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.6:1) src-tauri/experts/skills/brainstorming/scripts/frame-template.html:196— `.mock-button` sets color: white on background-color: #0a84ff — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
WatchState::account (cyclomatic 31) src-tauri/src/acp/background_watch.rs:1563— WatchState::account 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.
WatchState::tick (cyclomatic 27) src-tauri/src/acp/background_watch.rs:1130— WatchState::tick 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.
WatchState::classify_and_feed (cyclomatic 19) src-tauri/src/acp/background_watch.rs:1802— WatchState::classify_and_feed 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.
OpenCodeParser::load_v2_messages (cyclomatic 27) REDACTED:798— OpenCodeParser::load_v2_messages 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.
OpenCodeParser::load_sqlite_parts (cyclomatic 26) REDACTED:478— OpenCodeParser::load_sqlite_parts 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.
OpenCodeParser::load_sqlite_messages (cyclomatic 20) REDACTED:289— OpenCodeParser::load_sqlite_messages 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.
WatchState::account (cognitive 91) src-tauri/src/acp/background_watch.rs:1563— WatchState::account has cognitive complexity 91 (threshold 15). Drivers by points: if/else 25 (84 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 62). 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.
WatchState::tick (cognitive 48) src-tauri/src/acp/background_watch.rs:1130— WatchState::tick has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (34 pts), match/switch 3 (7 pts), boolean chains 4, loops 1 (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.
WatchState::classify_and_feed (cognitive 31) src-tauri/src/acp/background_watch.rs:1802— WatchState::classify_and_feed has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 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.
OpenClawParser::parse_conversation_detail (cognitive 56) src-tauri/src/parsers/openclaw.rs:509— OpenClawParser::parse_conversation_detail has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (46 pts), match/switch 3 (6 pts), loops 2 (4 pts) (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OpenClawParser::summaries_from_tree (cognitive 43) src-tauri/src/parsers/openclaw.rs:403— OpenClawParser::summaries_from_tree has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (32 pts), match/switch 3 (8 pts), loops 2 (3 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.
OpenClawParser::resolve_session (cognitive 31) src-tauri/src/parsers/openclaw.rs:717— OpenClawParser::resolve_session has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 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.
OpenCodeParser::load_v2_messages (cognitive 50) REDACTED:798— OpenCodeParser::load_v2_messages has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (35 pts), match/switch 4 (8 pts), loops 5 (7 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenCodeParser::load_sqlite_parts (cognitive 47) REDACTED:478— OpenCodeParser::load_sqlite_parts has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (36 pts), match/switch 3 (8 pts), boolean chains 2, 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.
OpenCodeParser::load_sqlite_messages (cognitive 35) REDACTED:289— OpenCodeParser::load_sqlite_messages has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 4 (8 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.
IndexService::start_build (cognitive 41) src-tauri/src/commands/workspace_file_search/index_cache.rs:902— IndexService::start_build has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 3 (6 pts), loops 1 (5 pts), boolean chains 1 (nesting depth added 26). 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.
IndexService::snapshot (cognitive 23) src-tauri/src/commands/workspace_file_search/index_cache.rs:819— IndexService::snapshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexService::search (cognitive 16) src-tauri/src/commands/workspace_file_search/index_cache.rs:1112— IndexService::search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, match/switch 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.
GeminiParser::parse_jsonl_chat_value (cognitive 34) src-tauri/src/parsers/gemini.rs:197— GeminiParser::parse_jsonl_chat_value has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (7 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.
GeminiParser::extract_text (cognitive 17) src-tauri/src/parsers/gemini.rs:358— GeminiParser::extract_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), 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.
GeminiParser::parse_user_blocks (cognitive 16) src-tauri/src/parsers/gemini.rs:457— GeminiParser::parse_user_blocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 pts), 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.
JTree::find_branch_first_user_message (cognitive 31) src-tauri/src/parsers/openclaw.rs:234— JTree::find_branch_first_user_message has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 2 (nesting depth added 20). 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.
JTree::parse (cognitive 16) src-tauri/src/parsers/openclaw.rs:121— JTree::parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JTree::conversation_branches (cognitive 16) src-tauri/src/parsers/openclaw.rs:283— JTree::conversation_branches 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.
Change coupling clique: content-parts-renderer.tsx, tool-kind-classifier.ts, REDACTED src/components/message/content-parts-renderer.tsx— 3 files — `src/components/message/content-parts-renderer.tsx`, `src/lib/adapters/tool-kind-classifier.ts`, `REDACTED` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change coupling clique: acp-agent-settings.tsx, add-model-provider-dialog.tsx, edit-model-provider-dialog.tsx src/components/settings/acp-agent-settings.tsx— 3 files — `src/components/settings/acp-agent-settings.tsx`, `src/components/settings/add-model-provider-dialog.tsx`, `src/components/settings/edit-model-provider-dialog.tsx` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change coupling clique: codex.rs, gemini.rs, openclaw.rs, REDACTED src-tauri/src/parsers/codex.rs— 4 files — `src-tauri/src/parsers/codex.rs`, `src-tauri/src/parsers/gemini.rs`, `src-tauri/src/parsers/openclaw.rs`, `REDACTED` — all change together with no explicit dependency: a fully-connected co-change clique, not 6 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×3
Edited copy of a member (44 corresponding lines) src-tauri/src/computer/helper/driver_proc.rs:451— src-tauri/src/computer/helper/driver_proc.rs:451-507 | src-tauri/src/computer/local.rs:1078-1121 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (44 corresponding lines) src-tauri/src/acp/file_system_runtime.rs:1166— src-tauri/src/acp/file_system_runtime.rs:1166-1217 | src-tauri/src/commands/folders.rs:4534-4577 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (44 corresponding lines) src-tauri/src/acp/stderr_tail.rs:261— src-tauri/src/acp/stderr_tail.rs:261-323 | src-tauri/src/acp/stderr_tail.rs:464-507 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×3
Edited copy of a member (35 corresponding lines) src-tauri/src/db/service/work_task_service.rs:2334— src-tauri/src/db/service/work_task_service.rs:2334-2375 | src-tauri/src/db/service/work_task_service.rs:2905-2939 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src-tauri/src/commands/experts.rs:556— src-tauri/src/commands/experts.rs:556-596 | src-tauri/src/commands/science.rs:380-414 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src-tauri/src/db/migration/m20260608_000001_conversation_title_locked.rs:8— src-tauri/src/db/migration/m20260608_000001_conversation_title_locked.rs:8-43 | src-tauri/src/db/migration/m20261016_000002_conversation_assistant.rs:8-42 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×3
Edited copy of a member (39 corresponding lines) src-tauri/src/commands/config_sync/domains.rs:802— src-tauri/src/commands/config_sync/domains.rs:802-840 | src-tauri/src/commands/config_sync/domains.rs:878-916 — 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) src-tauri/src/acp/connection.rs:10851— src-tauri/src/acp/connection.rs:10851-10910 | src-tauri/src/acp/connection.rs:11040-11078 — 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) src-tauri/src/backgrounds/mod.rs:89— src-tauri/src/backgrounds/mod.rs:89-127 | src-tauri/src/pets/mod.rs:75-116 — 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 (30 corresponding lines) · ×3
Edited copy of a member (30 corresponding lines) src-tauri/src/commands/experts.rs:256— src-tauri/src/commands/experts.rs:256-285 | src-tauri/src/commands/science.rs:221-250 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src-tauri/src/forge/gitea.rs:1307— src-tauri/src/forge/gitea.rs:1307-1336 | src-tauri/src/forge/github.rs:103-138 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src-tauri/src/db/service/import_service.rs:169— src-tauri/src/db/service/import_service.rs:169-198 | src-tauri/src/db/service/import_service.rs:213-256 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×3
Edited copies of one member (3 members, 20+ corresponding lines) src-tauri/src/commands/browser.rs:1292— src-tauri/src/commands/browser.rs:1292-1318 | src-tauri/src/commands/browser.rs:2359-2378 | src-tauri/src/commands/browser.rs:2698-2717 — 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) src-tauri/src/forge/cnb.rs:242— src-tauri/src/forge/cnb.rs:242-261 | src-tauri/src/forge/github.rs:376-395 | src-tauri/src/forge/gitlab.rs:327-354 — 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) src-tauri/src/computer/local.rs:705— src-tauri/src/computer/local.rs:705-726 | src-tauri/src/computer/local.rs:793-827 | src-tauri/src/computer/local.rs:894-913 — 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, 12+ corresponding lines) · ×3
Edited copies of one member (3 members, 12+ corresponding lines) src-tauri/src/commands/folders.rs:1671— src-tauri/src/commands/folders.rs:1671-1682 | src-tauri/src/commands/folders.rs:3701-3712 | src-tauri/src/commands/folders.rs:3896-3909 — 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) src-tauri/src/forge/deliver.rs:366— src-tauri/src/forge/deliver.rs:366-379 | src-tauri/src/forge/deliver.rs:385-396 | src-tauri/src/forge/deliver.rs:398-409 — 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) src-tauri/src/commands/computer.rs:1506— src-tauri/src/commands/computer.rs:1506-1517 | src-tauri/src/commands/computer.rs:1591-1602 | src-tauri/src/commands/computer.rs:1638-1649 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×3
Edited copies of one member (3 members, 18+ corresponding lines) src-tauri/src/forge/gitea.rs:309— src-tauri/src/forge/gitea.rs:309-328 | src-tauri/src/forge/github.rs:538-559 | src-tauri/src/forge/gitlab.rs:576-593 — 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) src-tauri/src/acp/manager.rs:4169— src-tauri/src/acp/manager.rs:4169-4193 | src-tauri/src/acp/manager.rs:4200-4217 | src-tauri/src/acp/manager.rs:4353-4377 — 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) src-tauri/src/commands/config_sync/domains.rs:281— src-tauri/src/commands/config_sync/domains.rs:281-301 | src-tauri/src/commands/config_sync/domains.rs:780-797 | src-tauri/src/commands/config_sync/domains.rs:856-873 — 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, 14+ corresponding lines) · ×3
Edited copies of one member (3 members, 14+ corresponding lines) src-tauri/src/work_task/git.rs:46— src-tauri/src/work_task/git.rs:46-59 | src-tauri/src/work_task/git.rs:62-75 | src-tauri/src/work_task/git.rs:282-295 — 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) src-tauri/src/commands/system_settings.rs:90— src-tauri/src/commands/system_settings.rs:90-104 | src-tauri/src/commands/system_settings.rs:108-121 | src-tauri/src/commands/system_settings.rs:292-307 — 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) src-tauri/src/web/handlers/upload_jail.rs:64— src-tauri/src/web/handlers/upload_jail.rs:64-77 | src-tauri/src/web/handlers/upload_jail.rs:88-103 | src-tauri/src/web/handlers/upload_jail.rs:107-121 — 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, 10+ corresponding lines) · ×3
Edited copies of one member (4 members, 10+ corresponding lines) src-tauri/src/db/service/conversation_service.rs:146— src-tauri/src/db/service/conversation_service.rs:146-156 | src-tauri/src/db/service/conversation_service.rs:187-198 | src-tauri/src/db/service/conversation_service.rs:586-595 | src-tauri/src/db/service/conversation_service.rs:1366-1376 — 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) src-tauri/src/commands/browser_tools.rs:123— src-tauri/src/commands/browser_tools.rs:123-136 | src-tauri/src/commands/chat_authoring.rs:663-676 | src-tauri/src/commands/computer_tools.rs:339-348 | src-tauri/src/commands/delegation.rs:181-190 — 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) src-tauri/src/acp/delegation/listener.rs:1074— src-tauri/src/acp/delegation/listener.rs:1074-1083 | src-tauri/src/acp/delegation/listener.rs:1088-1097 | src-tauri/src/acp/delegation/listener.rs:1102-1111 | src-tauri/src/acp/delegation/listener.rs:1115-1126 — 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 (4 members, 9+ corresponding lines) · ×3
Edited copies of one member (4 members, 9+ corresponding lines) src-tauri/src/keyring_store.rs:37— src-tauri/src/keyring_store.rs:37-45 | src-tauri/src/keyring_store.rs:225-233 | src-tauri/src/keyring_store.rs:274-282 | src-tauri/src/keyring_store.rs:285-293 — 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) src-tauri/src/db/service/folder_service.rs:502— src-tauri/src/db/service/folder_service.rs:502-514 | src-tauri/src/db/service/folder_service.rs:574-584 | src-tauri/src/db/service/folder_service.rs:606-615 | src-tauri/src/db/service/folder_service.rs:623-631 — 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) src-tauri/src/db/service/conversation_service.rs:336— src-tauri/src/db/service/conversation_service.rs:336-344 | src-tauri/src/db/service/conversation_service.rs:346-354 | src-tauri/src/db/service/token_usage_service.rs:493-504 | src-tauri/src/db/service/token_usage_service.rs:526-537 — 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, 8+ corresponding lines) · ×3
Edited copies of one member (4 members, 8+ corresponding lines) src-tauri/src/browser/profile.rs:804— src-tauri/src/browser/profile.rs:804-814 | src-tauri/src/browser/surface_child.rs:89-99 | src-tauri/src/browser/surface_window.rs:372-383 | src-tauri/src/commands/clipboard.rs:189-196 — 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) src-tauri/science/skills/hypothesis-generation/scripts/check_falsification_controls.py:442— src-tauri/science/skills/hypothesis-generation/scripts/check_falsification_controls.py:442-451 | src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:1067-1074 | src-tauri/science/skills/hypothesis-generation/scripts/validate_prediction_matrix.py:273-282 | src-tauri/science/skills/peer-review/scripts/audit_citations.py:194-203 — 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) src-tauri/src/db/migration/m20260330_000001_chat_channel.rs:127— src-tauri/src/db/migration/m20260330_000001_chat_channel.rs:127-134 | src-tauri/src/db/migration/m20260621_000001_automation.rs:250-258 | src-tauri/src/db/migration/m20260803_000001_token_usage.rs:163-170 | src-tauri/src/db/migration/m20261006_000001_conversation_tag.rs:159-166 — 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 copy of a member (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:315— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:315-319 | src-tauri/science/skills/peer-review/scripts/_common.py:287-291 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src-tauri/src/web/handlers/git.rs:221— src-tauri/src/web/handlers/git.rs:221-225 | src-tauri/src/web/handlers/mcp.rs:83-88 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src-tauri/src/web/handlers/assistants.rs:28— src-tauri/src/web/handlers/assistants.rs:28-32 | src-tauri/src/web/handlers/forge.rs:358-362 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (34 lines × 2) src-tauri/src/acp/connection.rs:9981— src-tauri/src/acp/connection.rs:9981-10014 | src-tauri/src/acp/connection.rs:10106-10139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) src-tauri/src/acp/delegation/broker.rs:3014— src-tauri/src/acp/delegation/broker.rs:3014-3047 | src-tauri/src/acp/delegation/broker.rs:3091-3124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:3014` it does not close everything it opens, so those 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 (34 lines × 2) src-tauri/src/acp/delegation/broker.rs:4678— src-tauri/src/acp/delegation/broker.rs:4678-4711 | src-tauri/src/acp/delegation/broker.rs:4749-4782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:4678` it does not close everything it opens, so those 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 (19 lines × 2) REDACTED:163— REDACTED:163-181 | REDACTED:89-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 `REDACTED:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) src-tauri/src/commands/acp.rs:14176— src-tauri/src/commands/acp.rs:14176-14194 | src-tauri/src/commands/acp.rs:14862-14880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:14176` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:55— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:55-73 | src-tauri/science/skills/peer-review/scripts/_common.py:41-59 — before extracting anything, compare `src-tauri/science/skills/hypothesis-generation/scripts/_common.py` and `src-tauri/science/skills/peer-review/scripts/_common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16–17 lines × 2) src-tauri/src/acp/delegation/broker.rs:2918— src-tauri/src/acp/delegation/broker.rs:2918-2934 | src-tauri/src/acp/delegation/broker.rs:4597-4612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:2918` 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–17 lines × 2) src-tauri/src/commands/canvas.rs:362— src-tauri/src/commands/canvas.rs:362-378 | src-tauri/src/commands/canvas.rs:432-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/canvas.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.
Duplicated block (16–17 lines × 2) src-tauri/src/forge/gitea.rs:312— src-tauri/src/forge/gitea.rs:312-328 | src-tauri/src/forge/github.rs:544-559 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitea.rs:312` 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) src-tauri/src/acp/connection.rs:18789— src-tauri/src/acp/connection.rs:18789-18803 | src-tauri/src/parsers/grok.rs:1328-1341 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:18789` 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 `raw_output` to `&serde_json::Value` in one and `&Value` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14–15 lines × 2) src-tauri/src/commands/folders.rs:4180— src-tauri/src/commands/folders.rs:4180-4194 | src-tauri/src/web/handlers/workspace_files.rs:74-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 (14–15 lines × 2) src-tauri/src/parsers/claude.rs:3688— src-tauri/src/parsers/claude.rs:3688-3702 | src-tauri/src/parsers/qoder.rs:1650-1663 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/qoder.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:3688` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/folder_links.rs:139— src-tauri/src/commands/folder_links.rs:139-147 | src-tauri/src/web/handlers/files.rs:582-590 | src-tauri/src/web/handlers/workspace_files.rs:181-189 — 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/web/handlers/files.rs:593` calls `truncate_chars` and `src-tauri/src/web/handlers/workspace_files.rs:192` 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 × 3) src-tauri/src/forge/cnb.rs:832— src-tauri/src/forge/cnb.rs:832-840 | src-tauri/src/forge/gitea.rs:1219-1227 | src-tauri/src/forge/gitlab.rs:1193-1201 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/gitea.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 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) src-tauri/src/commands/feedback.rs:47— src-tauri/src/commands/feedback.rs:47-55 | src-tauri/src/commands/question.rs:56-64 | src-tauri/src/commands/session_info.rs:362-370 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7–8 lines × 3) src-tauri/src/commands/windows.rs:685— src-tauri/src/commands/windows.rs:685-691 | src-tauri/src/commands/windows.rs:1020-1026 | src-tauri/src/commands/windows.rs:1236-1243 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/windows.rs:685` it does not close everything it opens, so those exact lines 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 × 3) src-tauri/src/db/mod.rs:79— src-tauri/src/db/mod.rs:79-85 | src-tauri/src/parsers/hermes.rs:86-93 | REDACTED:84-91 — before extracting anything, compare `src-tauri/src/parsers/hermes.rs` and `REDACTED` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 3) src-tauri/src/parsers/codex.rs:3081— src-tauri/src/parsers/codex.rs:3081-3087 | src-tauri/src/parsers/codex.rs:4307-4313 | src-tauri/src/parsers/codex.rs:4601-4608 — 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.
Weak hash algorithm src-tauri/src/browser/egress.rs:955— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src-tauri/src/browser/profile.rs:160— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src-tauri/src/parsers/opencode_context_window.rs:190— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
AC2 · Forms & labels· <FolderInput> field component without a label · ×2
<FolderInput> field component without a label src/components/conversations/move-to-folder-menu.tsx:47— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<FolderInput> field component without a label src/components/conversations/move-to-folder-menu.tsx:116— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
Low contrast colour pair in CSS (2.9:1) src-tauri/experts/skills/brainstorming/scripts/frame-template.html:123— `.option .letter` sets color: #86868b on background-color: #e5e5e7 — 2.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (2.9:1) src-tauri/experts/skills/brainstorming/scripts/frame-template.html:161— `.mockup-header` sets color: #86868b on background-color: #e5e5e7 — 2.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
CodexParser::parse_conversation_detail (cyclomatic 219) src-tauri/src/parsers/codex.rs:3241— CodexParser::parse_conversation_detail has cyclomatic complexity 219 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodexParser::parse_jsonl_summary (cyclomatic 65) src-tauri/src/parsers/codex.rs:417— CodexParser::parse_jsonl_summary has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sidebar-conversation-list.SidebarConversationList::renderRow (cyclomatic 42) src/components/conversations/sidebar-conversation-list.tsx:2997— sidebar-conversation-list.SidebarConversationList::renderRow 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. This shape REPEATS in the file: 2 other methods here (sidebar-conversation-list.SidebarConversationList, sidebar-conversation-list.SidebarConversationList::folderHeaderElement) 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.
sidebar-conversation-list.SidebarConversationList::folderHeaderElement (cyclomatic 26) src/components/conversations/sidebar-conversation-list.tsx:2885— sidebar-conversation-list.SidebarConversationList::folderHeaderElement 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. This shape REPEATS in the file: 2 other methods here (sidebar-conversation-list.SidebarConversationList, sidebar-conversation-list.SidebarConversationList::renderRow) 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.
DelegationBroker::start_delegation_inner (cyclomatic 29) src-tauri/src/acp/delegation/broker.rs:2484— DelegationBroker::start_delegation_inner 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.
DelegationBroker::resume_with_context (cyclomatic 28) src-tauri/src/acp/delegation/broker.rs:4281— DelegationBroker::resume_with_context 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.
CliRunService::launch_steps (cyclomatic 28) src-tauri/src/cli_run/service.rs:730— CliRunService::launch_steps has cyclomatic complexity 28 (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.
CliRunService::apply_selections (cyclomatic 17) src-tauri/src/cli_run/service.rs:1283— CliRunService::apply_selections 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.
CodeBuddyParser::parse_detail (cyclomatic 27) src-tauri/src/parsers/codebuddy.rs:187— CodeBuddyParser::parse_detail 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.
CodeBuddyParser::parse_summary (cyclomatic 16) src-tauri/src/parsers/codebuddy.rs:95— CodeBuddyParser::parse_summary 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.
acp-agent-settings.AcpAgentSettings::renderFixButton (cyclomatic 20) src/components/settings/acp-agent-settings.tsx:6319— acp-agent-settings.AcpAgentSettings::renderFixButton 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 (acp-agent-settings.AcpAgentSettings, acp-agent-settings.AcpAgentSettings::handleFixAction) 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.
acp-agent-settings.AcpAgentSettings::handleFixAction (cyclomatic 16) src/components/settings/acp-agent-settings.tsx:6167— acp-agent-settings.AcpAgentSettings::handleFixAction 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 shape REPEATS in the file: 2 other methods here (acp-agent-settings.AcpAgentSettings, acp-agent-settings.AcpAgentSettings::renderFixButton) 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.
D10 · Test Quality· Fixed-sleep synchronisation · ×2
Fixed-sleep synchronisation: re-probes an unconfirmed snapshot exactly once, then treats it as not switched src/components/settings/assistant-editor-dialog.test.tsx:523— This test starts work it did not wait for (`user`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 600))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: ignores an answer to a request the form moved away from src/components/settings/provider-models.test.tsx:154— This test starts work it did not wait for (`user`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
CodexParser::parse_conversation_detail (cognitive 873) src-tauri/src/parsers/codex.rs:3241— CodexParser::parse_conversation_detail has cognitive complexity 873 (threshold 15). Drivers by points: if/else 158 (729 pts), match/switch 20 (94 pts), loops 8 (34 pts), boolean chains 16 (nesting depth added 671). 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.
CodexParser::parse_jsonl_summary (cognitive 212) src-tauri/src/parsers/codex.rs:417— CodexParser::parse_jsonl_summary has cognitive complexity 212 (threshold 15). Drivers by points: if/else 44 (191 pts), match/switch 5 (14 pts), boolean chains 6, loops 1 (nesting depth added 156). 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.
WeixinBackend::start (cognitive 134) src-tauri/src/chat_channel/backends/weixin.rs:438— WeixinBackend::start has cognitive complexity 134 (threshold 15). Drivers by points: if/else 23 (102 pts), match/switch 4 (16 pts), loops 3 (15 pts), boolean chains 1 (nesting depth added 103). 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.
WeixinBackend::do_send (cognitive 21) src-tauri/src/chat_channel/backends/weixin.rs:324— WeixinBackend::do_send has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (21 pts) (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.
sidebar-conversation-list.SidebarConversationList::renderRow (cognitive 66) src/components/conversations/sidebar-conversation-list.tsx:2997— sidebar-conversation-list.SidebarConversationList::renderRow has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 19 (45 pts), if/else 12 (13 pts), boolean chains 8 (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. This shape REPEATS in the file: 2 other methods here (sidebar-conversation-list.SidebarConversationList, sidebar-conversation-list.SidebarConversationList::folderHeaderElement) 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.
sidebar-conversation-list.SidebarConversationList::folderHeaderElement (cognitive 22) src/components/conversations/sidebar-conversation-list.tsx:2885— sidebar-conversation-list.SidebarConversationList::folderHeaderElement has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (14 pts), boolean chains 8 (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. This shape REPEATS in the file: 2 other methods here (sidebar-conversation-list.SidebarConversationList, sidebar-conversation-list.SidebarConversationList::renderRow) 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.
CodeBuddyParser::parse_detail (cognitive 63) src-tauri/src/parsers/codebuddy.rs:187— CodeBuddyParser::parse_detail has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (56 pts), match/switch 2 (5 pts), boolean chains 1, loops 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.
CodeBuddyParser::parse_summary (cognitive 30) src-tauri/src/parsers/codebuddy.rs:95— CodeBuddyParser::parse_summary has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 2 (5 pts), 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.
ClaudeParser::parse_jsonl_summary (cognitive 47) src-tauri/src/parsers/claude.rs:1521— ClaudeParser::parse_jsonl_summary has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 6, match/switch 3 (5 pts), 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.
ClaudeParser::list_conversations (cognitive 21) src-tauri/src/parsers/claude.rs:1706— ClaudeParser::list_conversations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (8 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.
ComputerService::agent_clipboard (cognitive 25) src-tauri/src/commands/computer.rs:1953— ComputerService::agent_clipboard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 4 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComputerService::agent_act (cognitive 19) src-tauri/src/commands/computer.rs:2061— ComputerService::agent_act has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (7 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.
TargetTable::observe (cognitive 24) src-tauri/src/computer/targets.rs:575— TargetTable::observe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetTable::sweep (cognitive 17) src-tauri/src/computer/targets.rs:1089— TargetTable::sweep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AutomationEngine::reconcile_once (cognitive 23) src-tauri/src/automation/engine.rs:925— AutomationEngine::reconcile_once has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, 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.
AutomationEngine::resolve_cwd (cognitive 20) src-tauri/src/automation/engine.rs:636— AutomationEngine::resolve_cwd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 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.
ClineParser::session_detail (cognitive 21) src-tauri/src/parsers/cline.rs:445— ClineParser::session_detail has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), 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.
ClineParser::legacy_conversation (cognitive 17) src-tauri/src/parsers/cline.rs:755— ClineParser::legacy_conversation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 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.
AcpAgent::connect_to (cognitive 20) src-tauri/src/acp/agent_process.rs:712— AcpAgent::connect_to has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 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.
AcpAgent::spawn_process (cognitive 18) src-tauri/src/acp/agent_process.rs:354— AcpAgent::spawn_process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 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.
sidebar-conversation-grouping.buildRows::pushFolderEntry (cognitive 17) src/components/conversations/sidebar-conversation-grouping.ts:1418— sidebar-conversation-grouping.buildRows::pushFolderEntry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sidebar-conversation-grouping.buildRows::pushFolders) 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.
sidebar-conversation-grouping.buildRows::pushFolders (cognitive 17) src/components/conversations/sidebar-conversation-grouping.ts:1449— sidebar-conversation-grouping.buildRows::pushFolders has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), boolean chains 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sidebar-conversation-grouping.buildRows::pushFolderEntry) 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.
Near-duplicate member pair (27 shared lines) src-tauri/src/forge/gitea.rs:407— src-tauri/src/forge/gitea.rs:407-462 | src-tauri/src/forge/github.rs:651-737 — These two members are variants of one another: 27 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 (27 shared lines) src-tauri/src/acp/cursor_ext.rs:95— src-tauri/src/acp/cursor_ext.rs:95-197 | src-tauri/src/acp/question.rs:504-586 — These two members are variants of one another: 27 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) src-tauri/src/commands/custom_skills.rs:308— src-tauri/src/commands/custom_skills.rs:308-334 | src-tauri/src/commands/experts.rs:763-789 | src-tauri/src/commands/experts.rs:1010-1035 | src-tauri/src/commands/office_tools.rs:1211-1238 | src-tauri/src/commands/office_tools.rs:1285-1310 | src-tauri/src/commands/science.rs:581-607 | src-tauri/src/commands/science.rs:825-850 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) src-tauri/science/skills/exploratory-data-analysis/scripts/capability_manifest.py:30— src-tauri/science/skills/exploratory-data-analysis/scripts/capability_manifest.py:30-77 | src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:21-69 | src-tauri/science/skills/exploratory-data-analysis/scripts/eda_analyzer.py:50-113 | src-tauri/science/skills/exploratory-data-analysis/scripts/image_inspector.py:29-53 | src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py:21-80 | src-tauri/science/skills/exploratory-data-analysis/scripts/sequence_inspector.py:32-68 | src-tauri/science/skills/exploratory-data-analysis/scripts/tabular_profile.py:22-65 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) src-tauri/src/commands/conversations.rs:2799— src-tauri/src/commands/conversations.rs:2799-2816 | src-tauri/src/commands/folder_links.rs:450-470 | src-tauri/src/commands/folders.rs:1703-1719 | src-tauri/src/commands/folders.rs:1722-1738 | src-tauri/src/git_credential.rs:387-405 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src-tauri/src/parsers/claude.rs:3214— src-tauri/src/parsers/claude.rs:3214-3228 | src-tauri/src/parsers/codex.rs:6380-6396 | src-tauri/src/parsers/gemini.rs:403-417 | src-tauri/src/parsers/hermes.rs:720-734 | REDACTED:1438-1452 — 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 (69 corresponding lines) · ×2
Edited copy of a member (69 corresponding lines) src-tauri/src/db/service/work_task_service.rs:1296— src-tauri/src/db/service/work_task_service.rs:1296-1378 | src-tauri/src/db/service/work_task_service.rs:1428-1496 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (69 corresponding lines) src-tauri/src/parsers/claude.rs:3447— src-tauri/src/parsers/claude.rs:3447-3515 | src-tauri/src/parsers/openclaw.rs:959-1034 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×2
Edited copy of a member (46 corresponding lines) src-tauri/src/update/install.rs:609— src-tauri/src/update/install.rs:609-666 | src-tauri/src/update/install.rs:668-713 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) src-tauri/src/parsers/kimi_code.rs:199— src-tauri/src/parsers/kimi_code.rs:199-251 | src-tauri/src/parsers/pi.rs:400-445 — 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 (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) src-tauri/src/chat_channel/session_commands.rs:119— src-tauri/src/chat_channel/session_commands.rs:119-162 | src-tauri/src/chat_channel/session_commands.rs:170-201 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) src-tauri/src/cli_run/discovery.rs:518— src-tauri/src/cli_run/discovery.rs:518-559 | src-tauri/src/cli_run/discovery.rs:585-616 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×2
Edited copy of a member (38 corresponding lines) src-tauri/src/commands/experts.rs:695— src-tauri/src/commands/experts.rs:695-733 | src-tauri/src/commands/science.rs:514-551 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) src-tauri/src/web/handlers/app_update.rs:213— src-tauri/src/web/handlers/app_update.rs:213-250 | src-tauri/src/web/handlers/app_update.rs:253-301 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×2
Edited copy of a member (33 corresponding lines) src-tauri/src/commands/chat_channel.rs:96— src-tauri/src/commands/chat_channel.rs:96-139 | src-tauri/src/commands/chat_channel.rs:141-173 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) src-tauri/src/acp/file_system_runtime.rs:1225— src-tauri/src/acp/file_system_runtime.rs:1225-1257 | src-tauri/src/commands/folders.rs:4585-4619 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) src-tauri/src/db/migration/m20260404_000001_model_provider.rs:8— src-tauri/src/db/migration/m20260404_000001_model_provider.rs:8-42 | src-tauri/src/db/migration/m20260801_000003_work_task_template.rs:8-41 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) src-tauri/src/commands/canvas.rs:568— src-tauri/src/commands/canvas.rs:568-601 | src-tauri/src/commands/canvas.rs:611-647 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×2
Edited copies of one member (3 members, 26+ corresponding lines) src-tauri/src/commands/browser.rs:3414— src-tauri/src/commands/browser.rs:3414-3443 | src-tauri/src/commands/browser.rs:3449-3474 | src-tauri/src/commands/browser.rs:3480-3510 — 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.
Edited copies of one member (3 members, 26+ corresponding lines) src-tauri/src/forge/cnb.rs:447— src-tauri/src/forge/cnb.rs:447-472 | src-tauri/src/forge/gitea.rs:247-273 | src-tauri/src/forge/gitlab.rs:923-955 — 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 (4 members, 14+ corresponding lines) · ×2
Edited copies of one member (4 members, 14+ corresponding lines) src-tauri/src/db/service/work_task_service.rs:1726— src-tauri/src/db/service/work_task_service.rs:1726-1744 | src-tauri/src/db/service/work_task_service.rs:1804-1822 | src-tauri/src/db/service/work_task_service.rs:2049-2062 | src-tauri/src/db/service/work_task_service.rs:2074-2091 — 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) src-tauri/src/commands/system_settings.rs:706— src-tauri/src/commands/system_settings.rs:706-720 | src-tauri/src/web/handlers/system_settings.rs:119-139 | src-tauri/src/web/handlers/version_control.rs:99-112 | src-tauri/src/web/handlers/version_control.rs:139-152 — 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, 16+ corresponding lines) · ×2
Edited copies of one member (3 members, 16+ corresponding lines) src-tauri/src/acp/manager.rs:2069— src-tauri/src/acp/manager.rs:2069-2084 | src-tauri/src/acp/manager.rs:2113-2129 | src-tauri/src/acp/manager.rs:2379-2395 — 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) src-tauri/src/web/handlers/acp.rs:678— src-tauri/src/web/handlers/acp.rs:678-696 | src-tauri/src/web/handlers/acp.rs:710-726 | src-tauri/src/web/handlers/acp.rs:1264-1279 — 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 (5 members, 8+ corresponding lines) · ×2
Edited copies of one member (5 members, 8+ corresponding lines) src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:44— src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:44-53 | src-tauri/science/skills/scholar-evaluation/scripts/check_process.py:220-227 | src-tauri/science/skills/scholar-evaluation/scripts/check_traceability.py:218-229 | src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:259-268 | src-tauri/science/skills/scholar-evaluation/scripts/weight_sensitivity.py:255-266 — 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.
Edited copies of one member (5 members, 8+ corresponding lines) src-tauri/src/web/handlers/acp.rs:1174— src-tauri/src/web/handlers/acp.rs:1174-1185 | src-tauri/src/web/handlers/acp.rs:1291-1298 | src-tauri/src/web/handlers/acp.rs:1337-1344 | src-tauri/src/web/handlers/acp.rs:1541-1552 | src-tauri/src/web/handlers/acp.rs:1574-1585 — 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 (4 members, 7+ corresponding lines) · ×2
Edited copies of one member (4 members, 7+ corresponding lines) src-tauri/src/db/service/sender_context_service.rs:46— src-tauri/src/db/service/sender_context_service.rs:46-52 | src-tauri/src/db/service/sender_context_service.rs:59-65 | src-tauri/src/db/service/sender_context_service.rs:73-80 | src-tauri/src/db/service/sender_context_service.rs:95-101 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) src-tauri/science/skills/hypothesis-generation/scripts/lint_causal_claims.py:179— src-tauri/science/skills/hypothesis-generation/scripts/lint_causal_claims.py:179-185 | src-tauri/science/skills/peer-review/scripts/lint_review.py:244-250 | src-tauri/science/skills/peer-review/scripts/validate_claim_evidence.py:211-217 | src-tauri/science/skills/peer-review/scripts/validate_review_intake.py:443-449 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×2
Edited copies of one member (3 members, 7+ corresponding lines) src-tauri/science/skills/scientific-visualization/scripts/export_plan.py:20— src-tauri/science/skills/scientific-visualization/scripts/export_plan.py:20-26 | src-tauri/science/skills/scientific-visualization/scripts/figure_export.py:389-396 | src-tauri/science/skills/scientific-visualization/scripts/style_presets.py:275-283 — 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) src-tauri/src/acp/opencode_plugins.rs:130— src-tauri/src/acp/opencode_plugins.rs:130-136 | src-tauri/src/update/install.rs:1301-1307 | src-tauri/src/update/install.rs:1419-1425 — 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 copy of a member (3 corresponding lines) · ×2
Edited copy of a member (3 corresponding lines) src-tauri/src/cli_run/hello.rs:34— src-tauri/src/cli_run/hello.rs:34-42 | src-tauri/src/forge/auto/webhook.rs:155-157 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src-tauri/src/commands/mcp.rs:41— src-tauri/src/commands/mcp.rs:41-46 | src-tauri/src/commands/remote_proxy.rs:527-529 — 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 (23–26 lines × 2) src-tauri/src/acp/connection.rs:10669— src-tauri/src/acp/connection.rs:10669-10694 | src-tauri/src/acp/connection.rs:10811-10833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:10669` it begins part-way through the construct above it, so those exact lines 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–26 lines × 2) src-tauri/src/db/service/conversation_service.rs:1674— src-tauri/src/db/service/conversation_service.rs:1674-1699 | src-tauri/src/db/service/conversation_service.rs:1760-1782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/conversation_service.rs:1674` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) src-tauri/src/parsers/codebuddy.rs:1267— src-tauri/src/parsers/codebuddy.rs:1267-1291 | src-tauri/src/parsers/kimi_code.rs:1105-1129 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:1267` 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 (25 lines × 2) src-tauri/src/commands/mcp.rs:6830— src-tauri/src/commands/mcp.rs:6830-6854 | src-tauri/src/commands/mcp.rs:6865-6889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:6830` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/commands/acp.rs:3057— src-tauri/src/commands/acp.rs:3057-3078 | src-tauri/src/commands/mcp.rs:790-811 — before extracting anything, compare `src-tauri/src/commands/acp.rs` and `src-tauri/src/commands/mcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (22 lines × 2) src-tauri/src/commands/acp.rs:12722— src-tauri/src/commands/acp.rs:12722-12743 | src-tauri/src/commands/acp.rs:12831-12852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:12722` it does not close everything it opens, so those 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 (18–20 lines × 2) src-tauri/src/acp/connection.rs:6832— src-tauri/src/acp/connection.rs:6832-6851 | src-tauri/src/acp/connection.rs:6912-6929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:6832` it begins part-way through the construct above it, so those exact lines 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–20 lines × 2) src-tauri/src/commands/chat_channel.rs:97— src-tauri/src/commands/chat_channel.rs:97-114 | src-tauri/src/commands/chat_channel.rs:142-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–20 lines × 2) src-tauri/src/acp/connection.rs:10587— src-tauri/src/acp/connection.rs:10587-10606 | src-tauri/src/acp/connection.rs:10760-10769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:10587` 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–20 lines × 2) src-tauri/src/lib.rs:1131— src-tauri/src/lib.rs:1131-1140 | src-tauri/src/lib.rs:1151-1170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/lib.rs:1151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) src-tauri/src/acp/cursor_ext.rs:145— src-tauri/src/acp/cursor_ext.rs:145-158 | src-tauri/src/acp/question.rs:541-556 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/cursor_ext.rs:145` it does not close everything it opens, so those 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–16 lines × 2) src-tauri/src/work_task/engine.rs:4494— src-tauri/src/work_task/engine.rs:4494-4509 | src-tauri/src/work_task/engine.rs:6433-6446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/work_task/engine.rs:4494` it does not close everything it opens, so those exact lines 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) src-tauri/src/db/service/import_service.rs:170— src-tauri/src/db/service/import_service.rs:170-184 | src-tauri/src/db/service/import_service.rs:215-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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/import_service.rs:170` it does not close everything it opens, so those 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) src-tauri/src/forge/gitea.rs:422— src-tauri/src/forge/gitea.rs:422-436 | src-tauri/src/forge/github.rs:665-680 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 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–15 lines × 4) src-tauri/src/commands/folders.rs:2554— src-tauri/src/commands/folders.rs:2554-2568 | src-tauri/src/commands/folders.rs:2611-2623 | src-tauri/src/commands/folders.rs:2651-2663 | src-tauri/src/commands/folders.rs:6061-6071 — 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 `src-tauri/src/commands/folders.rs:2554` it begins part-way through the construct above it, so those exact lines 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–15 lines × 4) src-tauri/src/commands/folders.rs:2552— src-tauri/src/commands/folders.rs:2552-2566 | src-tauri/src/commands/folders.rs:2571-2581 | src-tauri/src/commands/folders.rs:2608-2621 | src-tauri/src/commands/folders.rs:2648-2661 — 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 `src-tauri/src/commands/folders.rs:2608` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 3) src-tauri/src/forge/cnb.rs:249— src-tauri/src/forge/cnb.rs:249-261 | src-tauri/src/forge/github.rs:381-395 | src-tauri/src/forge/gitlab.rs:342-354 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/cnb.rs:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 3) src-tauri/science/skills/hypothesis-generation/scripts/check_falsification_controls.py:424— src-tauri/science/skills/hypothesis-generation/scripts/check_falsification_controls.py:424-438 | src-tauri/science/skills/hypothesis-generation/scripts/validate_prediction_matrix.py:255-269 | src-tauri/science/skills/peer-review/scripts/audit_citations.py:178-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13–15 lines × 2) src-tauri/src/acp/delegation/broker.rs:2936— src-tauri/src/acp/delegation/broker.rs:2936-2950 | src-tauri/src/acp/delegation/broker.rs:4614-4626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:2936` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) src-tauri/src/commands/mcp.rs:936— src-tauri/src/commands/mcp.rs:936-950 | src-tauri/src/commands/mcp.rs:4121-4133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:936` 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–14 lines × 2) src-tauri/src/acp/antigravity_login.rs:903— src-tauri/src/acp/antigravity_login.rs:903-913 | src-tauri/src/acp/antigravity_login.rs:1078-1091 — both copies are in the same file, so extract the 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 (11–14 lines × 2) src-tauri/src/automation/engine.rs:1146— src-tauri/src/automation/engine.rs:1146-1159 | src-tauri/src/work_task/engine.rs:6884-6894 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 4) src-tauri/src/parsers/claude.rs:3215— src-tauri/src/parsers/claude.rs:3215-3226 | src-tauri/src/parsers/gemini.rs:404-415 | src-tauri/src/parsers/hermes.rs:721-732 | REDACTED:1439-1450 — before extracting anything, compare `src-tauri/src/parsers/gemini.rs` and `src-tauri/src/parsers/hermes.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. 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 lines × 4) src-tauri/src/parsers/codex.rs:5663— src-tauri/src/parsers/codex.rs:5663-5674 | src-tauri/src/parsers/deepseek.rs:748-759 | src-tauri/src/parsers/kimi_code.rs:1151-1162 | src-tauri/src/parsers/trae_usage.rs:375-386 — before extracting anything, compare `src-tauri/src/parsers/codex.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) src-tauri/src/commands/custom_skills.rs:394— src-tauri/src/commands/custom_skills.rs:394-405 | src-tauri/src/commands/office_tools.rs:1137-1148 | src-tauri/src/commands/science.rs:706-717 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/office_tools.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/custom_skills.rs:394` 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 × 3) src-tauri/src/acp/delegation/companion.rs:2797— src-tauri/src/acp/delegation/companion.rs:2797-2808 | src-tauri/src/acp/delegation/companion.rs:2948-2959 | src-tauri/src/acp/delegation/companion.rs:3230-3241 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/companion.rs:2797` 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–12 lines × 3) src-tauri/src/commands/custom_skills.rs:417— src-tauri/src/commands/custom_skills.rs:417-427 | src-tauri/src/commands/experts.rs:929-940 | src-tauri/src/commands/science.rs:751-761 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/experts.rs` as WHOLE FILES: this scan already matched 6 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 `src-tauri/src/commands/custom_skills.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.
Duplicated block (11–12 lines × 3) src-tauri/src/commands/folders.rs:5489— src-tauri/src/commands/folders.rs:5489-5499 | src-tauri/src/commands/folders.rs:5519-5530 | src-tauri/src/commands/folders.rs:5568-5578 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:5489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) src-tauri/src/commands/browser.rs:1936— src-tauri/src/commands/browser.rs:1936-1947 | src-tauri/src/commands/browser.rs:1971-1980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/browser.rs:1936` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) src-tauri/src/acp/connection.rs:2384— src-tauri/src/acp/connection.rs:2384-2395 | src-tauri/src/acp/connection.rs:2650-2659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:2384` it begins part-way through the construct above it, so those exact lines 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–11 lines × 4) src-tauri/src/chat_channel/backends/telegram.rs:66— src-tauri/src/chat_channel/backends/telegram.rs:66-72 | src-tauri/src/chat_channel/backends/telegram.rs:112-122 | src-tauri/src/chat_channel/backends/telegram.rs:511-520 | src-tauri/src/chat_channel/backends/telegram.rs:569-578 — 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 `src-tauri/src/chat_channel/backends/telegram.rs:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–11 lines × 4) src-tauri/src/parsers/claude.rs:3872— src-tauri/src/parsers/claude.rs:3872-3878 | src-tauri/src/parsers/codex.rs:475-482 | src-tauri/src/parsers/codex.rs:3472-3479 | src-tauri/src/parsers/openclaw.rs:137-147 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 3) src-tauri/src/commands/folders.rs:5419— src-tauri/src/commands/folders.rs:5419-5429 | src-tauri/src/commands/folders.rs:5485-5495 | src-tauri/src/commands/folders.rs:5515-5525 — 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 (11 lines × 3) src-tauri/src/commands/folders.rs:2148— src-tauri/src/commands/folders.rs:2148-2158 | src-tauri/src/commands/folders.rs:2206-2216 | src-tauri/src/commands/folders.rs:3185-3196 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:2148` it begins part-way through the construct above it, so those exact lines 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–11 lines × 2) src-tauri/src/forge/gitlab.rs:388— src-tauri/src/forge/gitlab.rs:388-398 | src-tauri/src/forge/gitlab.rs:537-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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/gitlab.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. 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–11 lines × 2) src-tauri/src/parsers/codex.rs:424— src-tauri/src/parsers/codex.rs:424-430 | src-tauri/src/parsers/codex.rs:3249-3259 — both copies are in the same file, so extract the block into 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–10 lines × 2) src-tauri/src/commands/mcp.rs:954— src-tauri/src/commands/mcp.rs:954-963 | src-tauri/src/commands/mcp.rs:4136-4141 — both copies are in the same file, so extract the block into 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–10 lines × 2) src-tauri/src/forge/gitea.rs:410— src-tauri/src/forge/gitea.rs:410-419 | src-tauri/src/forge/github.rs:657-662 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 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 (9 lines × 4) src-tauri/src/commands/folder_links.rs:453— src-tauri/src/commands/folder_links.rs:453-461 | src-tauri/src/commands/folders.rs:1706-1714 | src-tauri/src/commands/folders.rs:1725-1733 | src-tauri/src/git_credential.rs:390-400 — before extracting anything, compare `src-tauri/src/commands/folders.rs` and `src-tauri/src/git_credential.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folder_links.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.
Duplicated block (9 lines × 4) src-tauri/src/commands/folders.rs:2359— src-tauri/src/commands/folders.rs:2359-2368 | src-tauri/src/commands/folders.rs:2469-2478 | src-tauri/src/commands/folders.rs:3320-3328 | src-tauri/src/commands/folders.rs:3664-3673 — 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 `src-tauri/src/commands/folders.rs:2359` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/commands/folders.rs:2468` calls `args` and `src-tauri/src/commands/folders.rs:3663` 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 × 5) src-tauri/src/commands/conversations.rs:2802— src-tauri/src/commands/conversations.rs:2802-2811 | src-tauri/src/commands/folder_links.rs:453-460 | src-tauri/src/commands/folders.rs:1706-1713 | src-tauri/src/commands/folders.rs:1725-1732 | src-tauri/src/git_credential.rs:390-399 — before extracting anything, compare `src-tauri/src/commands/folders.rs` and `src-tauri/src/git_credential.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/conversations.rs:2802` it begins part-way through the construct above it, so those exact lines 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) src-tauri/src/parsers/grok.rs:709— src-tauri/src/parsers/grok.rs:709-716 | src-tauri/src/parsers/grok.rs:1192-1199 | src-tauri/src/parsers/kimi_code.rs:133-140 | src-tauri/src/parsers/kimi_code.rs:1021-1028 | src-tauri/src/parsers/pi.rs:1379-1386 — before extracting anything, compare `src-tauri/src/parsers/grok.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/grok.rs:709` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/parsers/kimi_code.rs:141` calls `get`, `and_then` and `src-tauri/src/parsers/grok.rs:718` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 7) src-tauri/src/commands/custom_skills.rs:316— src-tauri/src/commands/custom_skills.rs:316-322 | src-tauri/src/commands/experts.rs:773-778 | src-tauri/src/commands/experts.rs:1017-1023 | src-tauri/src/commands/office_tools.rs:1222-1227 | src-tauri/src/commands/office_tools.rs:1292-1298 | src-tauri/src/commands/science.rs:591-596 | src-tauri/src/commands/science.rs:832-838 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/experts.rs` as WHOLE FILES: this scan already matched 6 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 `src-tauri/src/commands/custom_skills.rs:316` 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 × 7) src-tauri/src/web/handlers/automation.rs:87— src-tauri/src/web/handlers/automation.rs:87-92 | src-tauri/src/web/handlers/work_task.rs:234-239 | src-tauri/src/web/handlers/work_task.rs:244-249 | src-tauri/src/web/handlers/work_task.rs:529-534 | src-tauri/src/web/handlers/work_task.rs:539-544 | src-tauri/src/web/handlers/work_task.rs:549-554 | src-tauri/src/web/handlers/work_task.rs:593-598 — before extracting anything, compare `src-tauri/src/web/handlers/automation.rs` and `src-tauri/src/web/handlers/work_task.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/web/handlers/automation.rs:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) src-tauri/src/forge/cnb.rs:395— src-tauri/src/forge/cnb.rs:395-403 | src-tauri/src/forge/cnb.rs:502-509 | src-tauri/src/forge/gitea.rs:411-419 | src-tauri/src/forge/github.rs:658-662 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/gitea.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/forge/cnb.rs:500` calls `Some` and `src-tauri/src/forge/cnb.rs:393` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) src-tauri/src/commands/custom_skills.rs:141— src-tauri/src/commands/custom_skills.rs:141-145 | src-tauri/src/commands/experts.rs:217-221 | src-tauri/src/commands/office_tools.rs:278-282 | src-tauri/src/commands/science.rs:174-178 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/experts.rs` as WHOLE FILES: this scan already matched 6 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.
Duplicated block (6 lines × 4) src-tauri/src/chat_channel/session_commands.rs:1677— src-tauri/src/chat_channel/session_commands.rs:1677-1682 | src-tauri/src/commands/conversations.rs:547-552 | src-tauri/src/commands/session_info.rs:230-235 | src-tauri/src/db/service/import_service.rs:317-322 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `at` to `AgentType` in one and `&AgentType` 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 × 4) src-tauri/src/parsers/claude.rs:1420— src-tauri/src/parsers/claude.rs:1420-1425 | src-tauri/src/parsers/claude.rs:2980-2985 | src-tauri/src/parsers/codex.rs:5851-5856 | src-tauri/src/parsers/openclaw.rs:911-916 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 7) src-tauri/src/commands/browser_tools.rs:177— src-tauri/src/commands/browser_tools.rs:177-186 | src-tauri/src/commands/chat_authoring.rs:714-723 | src-tauri/src/commands/computer_tools.rs:519-528 | src-tauri/src/commands/delegation.rs:240-250 | src-tauri/src/commands/feedback.rs:95-104 | src-tauri/src/commands/question.rs:100-109 | src-tauri/src/commands/session_info.rs:407-416 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 7 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/browser_tools.rs:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 7) src-tauri/src/web/handlers/browser_tools.rs:34— src-tauri/src/web/handlers/browser_tools.rs:34-43 | src-tauri/src/web/handlers/chat_authoring.rs:33-42 | src-tauri/src/web/handlers/computer_tools.rs:37-46 | src-tauri/src/web/handlers/computer_tools.rs:56-65 | src-tauri/src/web/handlers/feedback.rs:38-47 | src-tauri/src/web/handlers/question.rs:34-43 | src-tauri/src/web/handlers/session_info.rs:33-42 — there are 7 copies across 6 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 `src-tauri/src/web/handlers/browser_tools.rs:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Unfinished branch — a todo!() / unimplemented!() arm in a real function src-tauri/src/db/service/work_task_service.rs:1010— `update` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
Unfinished branch — a todo!() / unimplemented!() arm in a real function src-tauri/src/work_task/engine.rs:827— `start` does real work, but one of its branches is `Err` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
Dead file (~33 LoC) src/components/ui/folder-badge.tsx— no import path from any entry point (111 application, 9 tooling, 846 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 (~33 LoC) src/lib/folder-badge.ts— no import path from any entry point (111 application, 9 tooling, 846 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/components/ui/folder-badge.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative src/lib/custom-style.ts:471— 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.
AC2 · Forms & labels· <TextSelect> field component without a label · ×1
<TextSelect> field component without a label REDACTED:2260— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark src-tauri/experts/skills/brainstorming/scripts/frame-template.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Low contrast colour pair in CSS (1.8:1) src-tauri/experts/skills/brainstorming/scripts/frame-template.html:183— `.placeholder` sets color: #aeaeb2 on background-color: #e5e5e7 — 1.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast Tailwind colour pair (2.5:1) src/components/layout/session-details-insights.tsx:185— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
acp-connections-context.AcpConnectionsProvider (cyclomatic 489) src/contexts/acp-connections-context.tsx:3902— acp-connections-context.AcpConnectionsProvider has cyclomatic complexity 489 (threshold 15). Most of this is not in the body itself: 1 of the 489 points is its own statement and the rest belongs to 98 function literals inside it that branch (lines 5279, 7316, 5126, …). 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.
workspace-context.WorkspaceProvider (cyclomatic 454) src/contexts/workspace-context.tsx:635— workspace-context.WorkspaceProvider has cyclomatic complexity 454 (threshold 15). Most of this is not in the body itself: 7 of the 454 points are its own statements and the rest belongs to 128 function literals inside it that branch (lines 2364, 1126, 2550, …). 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.
tab-store.useTabStore (cyclomatic 289) src/stores/tab-store.ts:1640— tab-store.useTabStore has cyclomatic complexity 289 (threshold 15). Most of this is not in the body itself: 1 of the 289 points is its own statement and the rest belongs to 74 function literals inside it that branch (lines 2407, 2257, 1757, …). 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.
aux-panel-file-tree-tab.FileTreeTab (cyclomatic 271) src/components/layout/aux-panel-file-tree-tab.tsx:1136— aux-panel-file-tree-tab.FileTreeTab has cyclomatic complexity 271 (threshold 15). Of this number, 43 points are the body's own statements and 228 belong to 83 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
message-input.MessageInput (cyclomatic 269) REDACTED:332— message-input.MessageInput has cyclomatic complexity 269 (threshold 15). Of this number, 54 points are the body's own statements and 215 belong to 60 function literals 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.
acp-agent-settings.AcpAgentSettings (cyclomatic 253) src/components/settings/acp-agent-settings.tsx:4973— acp-agent-settings.AcpAgentSettings has cyclomatic complexity 253 (threshold 15). To reduce it, separate the cases: extract each independent 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 (acp-agent-settings.AcpAgentSettings::handleFixAction, acp-agent-settings.AcpAgentSettings::renderFixButton) 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.
canvas-view.CanvasFlow (cyclomatic 241) src/components/canvas/canvas-view.tsx:192— canvas-view.CanvasFlow has cyclomatic complexity 241 (threshold 15). Most of this is not in the body itself: 15 of the 241 points are its own statements and the rest belongs to 82 function literals inside it that branch (lines 1914, 1229, 1633, …). 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.
acp-connections-context.connectionsReducer (cyclomatic 232) src/contexts/acp-connections-context.tsx:1982— acp-connections-context.connectionsReducer has cyclomatic complexity 232 (threshold 15). Of this number, 229 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
conversation-detail-panel.ConversationTabView (cyclomatic 191) src/components/conversations/conversation-detail-panel.tsx:271— conversation-detail-panel.ConversationTabView has cyclomatic complexity 191 (threshold 15). Of this number, 73 points are the body's own statements and 118 belong to 51 function literals 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.
forge-page.ForgePage (cyclomatic 177) src/components/forge/forge-page.tsx:630— forge-page.ForgePage has cyclomatic complexity 177 (threshold 15). Of this number, 61 points are the body's own statements and 116 belong to 47 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
file-workspace-panel.FileWorkspacePanelBody (cyclomatic 176) src/components/files/file-workspace-panel.tsx:779— file-workspace-panel.FileWorkspacePanelBody has cyclomatic complexity 176 (threshold 15). Of this number, 71 points are the body's own statements and 105 belong to 44 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.
pi-config-panel.PiConfigPanel (cyclomatic 175) src/components/settings/pi-config-panel.tsx:306— pi-config-panel.PiConfigPanel has cyclomatic complexity 175 (threshold 15). Of this number, 107 points are the body's own statements and 68 belong to 29 function literals 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.
task-detail-sheet.TaskDetailSheet (cyclomatic 166) src/components/tasks/task-detail-sheet.tsx:219— task-detail-sheet.TaskDetailSheet has cyclomatic complexity 166 (threshold 15). Of this number, 123 points are the body's own statements and 43 belong to 21 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
aux-panel-git-changes-tab.GitChangesTab (cyclomatic 160) src/components/layout/aux-panel-git-changes-tab.tsx:505— aux-panel-git-changes-tab.GitChangesTab has cyclomatic complexity 160 (threshold 15). Of this number, 65 points are the body's own statements and 95 belong to 43 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal-view.TerminalView (cyclomatic 156) src/components/terminal/terminal-view.tsx:118— terminal-view.TerminalView has cyclomatic complexity 156 (threshold 15). Most of this is not in the body itself: 11 of the 156 points are its own statements and the rest belongs to 40 function items inside it that branch (a function literal at line 284, a function literal at line 353, a function literal at line 547, …). 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.
conversation-runtime-store.reducer (cyclomatic 145) src/stores/conversation-runtime-store.ts:2363— conversation-runtime-store.reducer has cyclomatic complexity 145 (threshold 15). Of this number, 130 points are the body's own statements and 15 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
aux-panel-git-log-tab.GitLogTab (cyclomatic 124) src/components/layout/aux-panel-git-log-tab.tsx:1295— aux-panel-git-log-tab.GitLogTab has cyclomatic complexity 124 (threshold 15). Of this number, 22 points are the body's own statements and 102 belong to 31 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
workspace-upload-dialog.WorkspaceUploadDialog (cyclomatic 123) src/components/layout/workspace-upload-dialog.tsx:153— workspace-upload-dialog.WorkspaceUploadDialog has cyclomatic complexity 123 (threshold 15). Of this number, 24 points are the body's own statements and 99 belong to 44 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
token-usage-page.TokenUsagePage (cyclomatic 120) src/components/token-usage/token-usage-page.tsx:328— token-usage-page.TokenUsagePage has cyclomatic complexity 120 (threshold 15). Of this number, 61 points are the body's own statements and 59 belong to 26 function literals 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.
conversation-runtime-store.useConversationRuntimeStore (cyclomatic 120) src/stores/conversation-runtime-store.ts:4418— conversation-runtime-store.useConversationRuntimeStore has cyclomatic complexity 120 (threshold 15). Most of this is not in the body itself: 1 of the 120 points is its own statement and the rest belongs to 31 function items inside it that branch (a function literal at line 4992, syncTurnMetadata::trySync, a function literal at line 4744, …). 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.
message-list-view.MessageListView (cyclomatic 114) src/components/message/message-list-view.tsx:1525— message-list-view.MessageListView has cyclomatic complexity 114 (threshold 15). Of this number, 40 points are the body's own statements and 74 belong to 23 function literals 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.
skills-settings.SkillsSettings (cyclomatic 113) src/components/settings/skills-settings.tsx:166— skills-settings.SkillsSettings has cyclomatic complexity 113 (threshold 15). Of this number, 55 points are the body's own statements and 58 belong to 29 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mcp-settings.McpSettings (cyclomatic 112) src/components/settings/mcp-settings.tsx:412— mcp-settings.McpSettings has cyclomatic complexity 112 (threshold 15). Of this number, 43 points are the body's own statements and 69 belong to 27 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
commit-dialog.CommitWorkspace (cyclomatic 104) src/components/layout/commit-dialog.tsx:240— commit-dialog.CommitWorkspace has cyclomatic complexity 104 (threshold 15). Of this number, 35 points are the body's own statements and 69 belong to 29 function literals 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.
update-provider.UpdateProvider (cyclomatic 102) src/components/providers/update-provider.tsx:181— update-provider.UpdateProvider has cyclomatic complexity 102 (threshold 15). Most of this is not in the body itself: 9 of the 102 points are its own statements and the rest belongs to 24 function literals inside it that branch (lines 734, 544, 684, …). 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.
codex-model-list-editor.CodexModelListEditor (cyclomatic 101) src/components/settings/codex-model-list-editor.tsx:246— codex-model-list-editor.CodexModelListEditor has cyclomatic complexity 101 (threshold 15). Of this number, 52 points are the body's own statements and 49 belong to 24 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.
backup-settings.BackupSettings (cyclomatic 94) src/components/settings/backup-settings.tsx:118— backup-settings.BackupSettings has cyclomatic complexity 94 (threshold 15). Of this number, 53 points are the body's own statements and 41 belong to 21 function literals inside it that branch. 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.
config-sync-settings.ConfigSyncSettings (cyclomatic 93) src/components/settings/config-sync-settings.tsx:140— config-sync-settings.ConfigSyncSettings has cyclomatic complexity 93 (threshold 15). Of this number, 34 points are the body's own statements and 59 belong to 22 function literals 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.
cursor-config-panel.CursorConfigPanel (cyclomatic 92) src/components/settings/cursor-config-panel.tsx:333— cursor-config-panel.CursorConfigPanel has cyclomatic complexity 92 (threshold 15). Of this number, 57 points are the body's own statements and 35 belong to 15 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
import-sessions-window.ImportSessionsWindow (cyclomatic 91) src/components/import-sessions/import-sessions-window.tsx:85— import-sessions-window.ImportSessionsWindow has cyclomatic complexity 91 (threshold 15). Of this number, 29 points are the body's own statements and 62 belong to 24 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
branch-dropdown.BranchDropdown (cyclomatic 91) src/components/layout/branch-dropdown.tsx:136— branch-dropdown.BranchDropdown has cyclomatic complexity 91 (threshold 15). Most of this is not in the body itself: 13 of the 91 points are its own statements and the rest belongs to 27 function items inside it that branch (handleConfirm, getConfirmTitle, getConfirmDescription, …). 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.
system-network-settings.SystemNetworkSettings (cyclomatic 90) src/components/settings/system-network-settings.tsx:108— system-network-settings.SystemNetworkSettings has cyclomatic complexity 90 (threshold 15). Of this number, 57 points are the body's own statements and 33 belong to 16 function literals 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.
agent-row.AgentRow (cyclomatic 88) src/components/message/activity/rows/agent-row.tsx:47— agent-row.AgentRow has cyclomatic complexity 88 (threshold 15). Of this number, 55 points are the body's own statements and 33 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
add-custom-agent-dialog.AddCustomAgentDialog (cyclomatic 85) src/components/settings/add-custom-agent-dialog.tsx:227— add-custom-agent-dialog.AddCustomAgentDialog has cyclomatic complexity 85 (threshold 15). Of this number, 37 points are the body's own statements and 48 belong to 17 function literals inside it that branch. 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.
ClaudeRecordAccumulator::feed_value (cyclomatic 84) src-tauri/src/parsers/claude.rs:2020— ClaudeRecordAccumulator::feed_value has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
task-deliver-pr-dialog.TaskDeliverPrDialog (cyclomatic 83) src/components/tasks/task-deliver-pr-dialog.tsx:90— task-deliver-pr-dialog.TaskDeliverPrDialog has cyclomatic complexity 83 (threshold 15). Of this number, 60 points are the body's own statements and 23 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tasks-page.TasksPage (cyclomatic 81) src/components/tasks/tasks-page.tsx:116— tasks-page.TasksPage has cyclomatic complexity 81 (threshold 15). Of this number, 22 points are the body's own statements and 59 belong to 22 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
conversation-runtime-store.buildStreamingTurnsFromLiveMessage (cyclomatic 81) src/stores/conversation-runtime-store.ts:1138— conversation-runtime-store.buildStreamingTurnsFromLiveMessage has cyclomatic complexity 81 (threshold 15). Of this number, 76 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SessionState::apply_event_inner (cyclomatic 79) src-tauri/src/acp/session_state.rs:1206— SessionState::apply_event_inner has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
appearance-provider.AppearanceProvider (cyclomatic 77) src/components/appearance-provider.tsx:399— appearance-provider.AppearanceProvider has cyclomatic complexity 77 (threshold 15). Most of this is not in the body itself: 2 of the 77 points are its own statements and the rest belongs to 30 function literals inside it that branch (lines 1039, 943, 894, …). 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.
forge-issue-detail-sheet.ForgeIssueDetailSheet (cyclomatic 75) src/components/forge/forge-issue-detail-sheet.tsx:2506— forge-issue-detail-sheet.ForgeIssueDetailSheet has cyclomatic complexity 75 (threshold 15). Of this number, 51 points are the body's own statements and 24 belong to 10 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
layout.FolderWorkspaceShell (cyclomatic 74) src/app/workspace/layout.tsx:779— layout.FolderWorkspaceShell has cyclomatic complexity 74 (threshold 15). Of this number, 22 points are the body's own statements and 52 belong to 11 function literals 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.
workspace-folder-dialog.WorkspaceFolderDialog (cyclomatic 74) src/components/layout/workspace-folder-dialog.tsx:98— workspace-folder-dialog.WorkspaceFolderDialog has cyclomatic complexity 74 (threshold 15). Of this number, 33 points are the body's own statements and 41 belong to 19 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
directory-browser.DirectoryBrowser (cyclomatic 74) src/components/shared/directory-browser.tsx:138— directory-browser.DirectoryBrowser has cyclomatic complexity 74 (threshold 15). Most of this is not in the body itself: 7 of the 74 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 473, a function literal at line 302, a function literal at line 398, …). 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.
suggestion-popup.SuggestionPopup (cyclomatic 73) src/components/chat/composer/suggestion/suggestion-popup.tsx:147— suggestion-popup.SuggestionPopup has cyclomatic complexity 73 (threshold 15). Of this number, 23 points are the body's own statements and 50 belong to 16 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.
pdf-viewer.PdfViewer (cyclomatic 72) src/components/files/pdf-viewer.tsx:104— pdf-viewer.PdfViewer has cyclomatic complexity 72 (threshold 15). Of this number, 27 points are the body's own statements and 45 belong to 21 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.
status-bar-update.StatusBarUpdate (cyclomatic 71) src/components/layout/status-bar-update.tsx:115— status-bar-update.StatusBarUpdate has cyclomatic complexity 71 (threshold 15). Of this number, 69 points are the body's own statements and 2 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.
commit-message-settings-dialog.CommitMessageSettingsBody (cyclomatic 70) src/components/layout/commit-message-settings-dialog.tsx:161— commit-message-settings-dialog.CommitMessageSettingsBody has cyclomatic complexity 70 (threshold 15). Of this number, 34 points are the body's own statements and 36 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kimi-code-config-panel.KimiCodeConfigPanel (cyclomatic 70) src/components/settings/kimi-code-config-panel.tsx:479— kimi-code-config-panel.KimiCodeConfigPanel has cyclomatic complexity 70 (threshold 15). Of this number, 46 points are the body's own statements and 24 belong to 12 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.
custom-skills-settings.CustomSkillsBody (cyclomatic 70) src/components/settings/custom-skills-settings.tsx:134— custom-skills-settings.CustomSkillsBody has cyclomatic complexity 70 (threshold 15). Of this number, 21 points are the body's own statements and 49 belong to 21 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
browser-surface-host.NativeSurfaceHost (cyclomatic 69) src/components/browser/browser-surface-host.tsx:200— browser-surface-host.NativeSurfaceHost has cyclomatic complexity 69 (threshold 15). Of this number, 27 points are the body's own statements and 42 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ask-question-card.AskQuestionCard (cyclomatic 69) src/components/chat/ask-question-card.tsx:86— ask-question-card.AskQuestionCard has cyclomatic complexity 69 (threshold 15). Of this number, 29 points are the body's own statements and 40 belong to 14 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.
canvas-conversation-surface.CanvasConversationSurface (cyclomatic 66) src/components/canvas/canvas-conversation-surface.tsx:181— canvas-conversation-surface.CanvasConversationSurface has cyclomatic complexity 66 (threshold 15). Of this number, 24 points are the body's own statements and 42 belong to 17 function literals 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.
command-manage-dialog.CommandManageDialog (cyclomatic 66) src/components/layout/command-manage-dialog.tsx:202— command-manage-dialog.CommandManageDialog has cyclomatic complexity 66 (threshold 15). Of this number, 18 points are the body's own statements and 48 belong to 22 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
three-pane-merge-editor.ThreePaneMergeEditor (cyclomatic 66) src/components/merge/three-pane-merge-editor.tsx:53— three-pane-merge-editor.ThreePaneMergeEditor has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 8 of the 66 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 251, 447, 181, …). 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.
app-workspace-store.useAppWorkspaceStore (cyclomatic 66) src/stores/app-workspace-store.ts:328— app-workspace-store.useAppWorkspaceStore has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 1 of the 66 points is its own statement and the rest belongs to 29 function literals inside it that branch (lines 505, 344, 416, …). 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.
use-open-file-tabs-watch.useOpenFileTabsWatch (cyclomatic 65) src/hooks/use-open-file-tabs-watch.ts:185— use-open-file-tabs-watch.useOpenFileTabsWatch has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 1 of the 65 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 238, 426, 206, …). 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.
use-session-feedback.useSessionFeedback (cyclomatic 65) src/hooks/use-session-feedback.ts:130— use-session-feedback.useSessionFeedback has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 10 of the 65 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 375, 212, 272, …). 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.
agent-selector.AgentSelector (cyclomatic 64) src/components/chat/agent-selector.tsx:71— agent-selector.AgentSelector has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 8 of the 64 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 165, 376, 493, …). 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.
validate_register.validate_register (cyclomatic 62) src-tauri/science/skills/scientific-brainstorming/scripts/validate_register.py:164— validate_register.validate_register has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ai-elements-adapter.adaptMessageTurn (cyclomatic 62) src/lib/adapters/ai-elements-adapter.ts:2452— ai-elements-adapter.adaptMessageTurn has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chat-html-markdown.createChatHtmlProcessor.<returned closure> (cyclomatic 61) REDACTED:197— chat-html-markdown.createChatHtmlProcessor.<returned closure> has cyclomatic complexity 61 (threshold 15). Of this number, 59 points are the body's own statements and 2 belong 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.
grep-no-match.pipelineStages (cyclomatic 61) src/lib/grep-no-match.ts:179— grep-no-match.pipelineStages has cyclomatic complexity 61 (threshold 15). Of this number, 58 points are the body's own statements and 3 belong 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.
conversation-manage-dialog.ConversationManageDialog (cyclomatic 58) src/components/conversations/conversation-manage-dialog.tsx:517— conversation-manage-dialog.ConversationManageDialog has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 15 of the 58 points are its own statements and the rest belongs to 20 function literals inside it that branch (lines 649, 999, 615, …). 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.
pi-project-trust-banner.PiProjectTrustBanner (cyclomatic 57) src/components/chat/pi-project-trust-banner.tsx:89— pi-project-trust-banner.PiProjectTrustBanner has cyclomatic complexity 57 (threshold 15). Of this number, 32 points are the body's own statements and 25 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
workspace-chrome-controller.WorkspaceChromeController (cyclomatic 57) src/components/layout/workspace-chrome-controller.tsx:53— workspace-chrome-controller.WorkspaceChromeController has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 1 of the 57 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 211, 135, 99, …). 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.
delegation-status-row.DelegationStatusRow (cyclomatic 57) src/components/message/delegation-status-row.tsx:90— delegation-status-row.DelegationStatusRow has cyclomatic complexity 57 (threshold 15). Of this number, 44 points are the body's own statements and 13 belong to 6 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.
deepseek-model-list-editor.DeepSeekModelListEditor (cyclomatic 57) src/components/settings/deepseek-model-list-editor.tsx:302— deepseek-model-list-editor.DeepSeekModelListEditor has cyclomatic complexity 57 (threshold 15). Of this number, 27 points are the body's own statements and 30 belong to 10 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
computer-settings.ComputerSettingsSection (cyclomatic 57) src/components/settings/computer-settings.tsx:208— computer-settings.ComputerSettingsSection has cyclomatic complexity 57 (threshold 15). Of this number, 26 points are the body's own statements and 31 belong to 10 function literals 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.
exit-meaning.splitCommandLine (cyclomatic 57) src/lib/activity/exit-meaning.ts:78— exit-meaning.splitCommandLine has cyclomatic complexity 57 (threshold 15). Of this number, 54 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
actJson (cyclomatic 57) REDACTED:526— actJson has cyclomatic complexity 57 (threshold 15). Of this number, 53 points are the body's own statements and 4 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
computer-window-picker.ComputerWindowPicker (cyclomatic 56) src/components/computer/computer-window-picker.tsx:348— computer-window-picker.ComputerWindowPicker has cyclomatic complexity 56 (threshold 15). Of this number, 32 points are the body's own statements and 24 belong to 13 function items inside it that branch. 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.
selection-action-bubble.SelectionActionBubble (cyclomatic 54) src/components/message/selection-action-bubble.tsx:103— selection-action-bubble.SelectionActionBubble has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 8 of the 54 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 147, 203, 285, …). 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.
qoder-config-panel.QoderConfigPanel (cyclomatic 54) src/components/settings/qoder-config-panel.tsx:94— qoder-config-panel.QoderConfigPanel has cyclomatic complexity 54 (threshold 15). Of this number, 37 points are the body's own statements and 17 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
skill-agent-matrix.SkillAgentMatrix (cyclomatic 54) src/components/settings/skill-agent-matrix.tsx:188— skill-agent-matrix.SkillAgentMatrix has cyclomatic complexity 54 (threshold 15). Of this number, 16 points are the body's own statements and 38 belong to 22 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.
tab-bar.TabBar (cyclomatic 53) src/components/tabs/tab-bar.tsx:53— tab-bar.TabBar has cyclomatic complexity 53 (threshold 15). Of this number, 18 points are the body's own statements and 35 belong to 10 function literals 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.
rich-composer.RichComposer (cyclomatic 52) src/components/chat/composer/rich-composer.tsx:254— rich-composer.RichComposer has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 6 of the 52 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 412, 533, 607, …). 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.
virtualized-message-thread.VirtualizedMessageThreadImpl (cyclomatic 52) src/components/message/virtualized-message-thread.tsx:201— virtualized-message-thread.VirtualizedMessageThreadImpl has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 9 of the 52 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 437, a function literal at line 346, a function literal at line 393, …). 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.
_common.validate_rubric (cyclomatic 51) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:393— _common.validate_rubric 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.
sidebar-conversation-card.SidebarConversationCard (cyclomatic 51) src/components/conversations/sidebar-conversation-card.tsx:222— sidebar-conversation-card.SidebarConversationCard has cyclomatic complexity 51 (threshold 15). Of this number, 42 points are the body's own statements and 9 belong to 7 function literals 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.
export_plan.validate_against_plan (cyclomatic 50) src-tauri/science/skills/scientific-visualization/scripts/export_plan.py:153— export_plan.validate_against_plan has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
opencode-connect-dialog.OpenCodeConnectDialog (cyclomatic 49) src/components/settings/opencode-connect-dialog.tsx:99— opencode-connect-dialog.OpenCodeConnectDialog has cyclomatic complexity 49 (threshold 15). Of this number, 28 points are the body's own statements and 21 belong to 7 function items inside it that branch. 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.
delegation-card.codeModeCallSite (cyclomatic 49) src/lib/delegation-card.ts:429— delegation-card.codeModeCallSite has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sidebar-conversation-grouping.buildRows (cyclomatic 48) src/components/conversations/sidebar-conversation-grouping.ts:1247— sidebar-conversation-grouping.buildRows has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 8 of the 48 points are its own statements and the rest belongs to 6 function items inside it that branch (pushFolderEntry, pushFolders, pushRecent, …). 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.
file-workspace-header.FileWorkspaceHeader (cyclomatic 48) src/components/files/file-workspace-header.tsx:72— file-workspace-header.FileWorkspaceHeader has cyclomatic complexity 48 (threshold 15). Of this number, 38 points are the body's own statements and 10 belong to 4 function items inside it that branch. 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.
push-workspace.PushWorkspace (cyclomatic 48) src/components/layout/push-workspace.tsx:293— push-workspace.PushWorkspace has cyclomatic complexity 48 (threshold 15). Of this number, 23 points are the body's own statements and 25 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
logs-settings.LogsSettings (cyclomatic 48) src/components/settings/logs-settings.tsx:272— logs-settings.LogsSettings has cyclomatic complexity 48 (threshold 15). Of this number, 17 points are the body's own statements and 31 belong to 21 function literals 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.
tool-call-normalization.inferFromInput (cyclomatic 48) REDACTED:409— tool-call-normalization.inferFromInput 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.
sidebar-conversation-list.FolderHeader (cyclomatic 47) src/components/conversations/sidebar-conversation-list.tsx:227— sidebar-conversation-list.FolderHeader has cyclomatic complexity 47 (threshold 15). Of this number, 34 points are the body's own statements and 13 belong to 8 function literals 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.
use-timeline-window.useTimelineWindow (cyclomatic 46) src/components/message/activity/use-timeline-window.ts:285— use-timeline-window.useTimelineWindow has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 12 of the 46 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 525, 414, 486, …). 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.
agent-tools-settings.AgentToolsSettingsSection (cyclomatic 46) src/components/settings/agent-tools-settings.tsx:135— agent-tools-settings.AgentToolsSettingsSection has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 10 of the 46 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 361, 162, 470, …). 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.
web-service-settings.WebServiceSettings (cyclomatic 46) src/components/settings/web-service-settings.tsx:288— web-service-settings.WebServiceSettings has cyclomatic complexity 46 (threshold 15). Of this number, 16 points are the body's own statements and 30 belong to 10 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.
terminal-context.TerminalProvider (cyclomatic 46) src/contexts/terminal-context.tsx:229— terminal-context.TerminalProvider has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 27 function literals inside it that branch (lines 619, 419, 247, …). 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.
unified-diff-preview.parseUnifiedDiff (cyclomatic 45) src/components/diff/unified-diff-preview.tsx:271— unified-diff-preview.parseUnifiedDiff has cyclomatic complexity 45 (threshold 15). Of this number, 40 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
collab-agent-row.CollabAgentRow (cyclomatic 45) src/components/message/activity/rows/collab-agent-row.tsx:43— collab-agent-row.CollabAgentRow has cyclomatic complexity 45 (threshold 15). Of this number, 32 points are the body's own statements and 13 belong to 3 function literals 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.
codex-visualize-card.CodexVisualizeCard (cyclomatic 45) src/components/message/codex-visualize-card.tsx:436— codex-visualize-card.CodexVisualizeCard has cyclomatic complexity 45 (threshold 15). Of this number, 31 points are the body's own statements and 14 belong to 5 function literals 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.
completed-turn-content.CompletedTurnContent (cyclomatic 45) src/components/message/completed-turn-content.tsx:77— completed-turn-content.CompletedTurnContent has cyclomatic complexity 45 (threshold 15). Of this number, 37 points are the body's own statements and 8 belong to 5 function literals 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.
turn-stats.TurnStats (cyclomatic 45) src/components/message/turn-stats.tsx:56— turn-stats.TurnStats has cyclomatic complexity 45 (threshold 15). Of this number, 38 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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.
delegation-agent-defaults.DelegationAgentDefaultsPanel (cyclomatic 45) src/components/settings/delegation-agent-defaults.tsx:115— delegation-agent-defaults.DelegationAgentDefaultsPanel has cyclomatic complexity 45 (threshold 15). Of this number, 16 points are the body's own statements and 29 belong to 11 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.
summarize.summarizeActivity (cyclomatic 45) src/lib/activity/summarize.ts:96— summarize.summarizeActivity has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 6 of the 45 points are its own statements and the rest belongs to one function literal inside it that branches (line 109). 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.
layout.WorkspaceContent (cyclomatic 44) src/app/workspace/layout.tsx:282— layout.WorkspaceContent has cyclomatic complexity 44 (threshold 15). Of this number, 29 points are the body's own statements and 15 belong to 5 function literals inside it that branch. 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.
console.format (cyclomatic 44) src/browser-injected/console.js:241— console.format has cyclomatic complexity 44 (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.
browser-screenshot-markup.ScreenshotMarkupDialog (cyclomatic 44) src/components/browser/browser-screenshot-markup.tsx:68— browser-screenshot-markup.ScreenshotMarkupDialog has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 5 of the 44 points are its own statements and the rest belongs to 18 function items inside it that branch (onKeyDown, a function literal at line 131, onPointerDown, …). 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.
office-preview.OfficePreview (cyclomatic 44) REDACTED:79— office-preview.OfficePreview has cyclomatic complexity 44 (threshold 15). Of this number, 18 points are the body's own statements and 26 belong to 12 function literals 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.
task-editor-dialog.TaskEditorBody (cyclomatic 44) src/components/tasks/task-editor-dialog.tsx:97— task-editor-dialog.TaskEditorBody has cyclomatic complexity 44 (threshold 15). Of this number, 20 points are the body's own statements and 24 belong to 12 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.
git-credential-context.GitCredentialProvider (cyclomatic 44) src/contexts/git-credential-context.tsx:174— git-credential-context.GitCredentialProvider has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 15 of the 44 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 340, 260, 463, …). 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.
use-connection-lifecycle.useConnectionLifecycle (cyclomatic 44) src/hooks/use-connection-lifecycle.ts:136— use-connection-lifecycle.useConnectionLifecycle has cyclomatic complexity 44 (threshold 15). Of this number, 16 points are the body's own statements and 28 belong to 7 function literals 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.
describe-tool-call.toolStepKind (cyclomatic 44) src/lib/activity/describe-tool-call.ts:98— describe-tool-call.toolStepKind 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.
permission-dialog.PermissionDialog (cyclomatic 43) src/components/chat/permission-dialog.tsx:62— permission-dialog.PermissionDialog has cyclomatic complexity 43 (threshold 15). Of this number, 38 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
codeg-mcp-tool-card.CodegMcpToolCard (cyclomatic 43) src/components/message/codeg-mcp-tool-card.tsx:117— codeg-mcp-tool-card.CodegMcpToolCard has cyclomatic complexity 43 (threshold 15). Of this number, 30 points are the body's own statements and 13 belong 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.
live-tool-output.isJsonContainerPrefix (cyclomatic 43) src/lib/live-tool-output.ts:29— live-tool-output.isJsonContainerPrefix has cyclomatic complexity 43 (threshold 15). Of this number, 42 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.
act.defaultActionFor (cyclomatic 42) browser-agent/src/act.ts:1109— act.defaultActionFor 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.
file-workspace-tab-bar.FileWorkspaceTabItem (cyclomatic 42) src/components/files/file-workspace-tab-bar.tsx:373— file-workspace-tab-bar.FileWorkspaceTabItem has cyclomatic complexity 42 (threshold 15). Of this number, 39 points are the body's own statements and 3 belong 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.
remote-workspace-manage-dialog.RemoteWorkspaceManageDialog (cyclomatic 42) src/components/layout/remote-workspace-manage-dialog.tsx:160— remote-workspace-manage-dialog.RemoteWorkspaceManageDialog has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 15 of the 42 points are its own statements and the rest belongs to 20 function literals inside it that branch (lines 190, 328, 358, …). 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.
describe-tool-call.describeUncached (cyclomatic 42) src/lib/activity/describe-tool-call.ts:631— describe-tool-call.describeUncached 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.
task-detail-sheet.timelineDetail (cyclomatic 41) src/components/tasks/task-detail-sheet.tsx:2030— task-detail-sheet.timelineDetail has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
power._resolve (cyclomatic 40) src-tauri/science/skills/statistical-power/scripts/power.py:88— power._resolve 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.
composer-context-usage.ComposerContextUsage (cyclomatic 40) src/components/chat/composer-context-usage.tsx:34— composer-context-usage.ComposerContextUsage has cyclomatic complexity 40 (threshold 15). Of this number, 34 points are the body's own statements and 6 belong to 5 function literals 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.
session-details-content.SessionDetailsContent (cyclomatic 40) src/components/conversations/session-details-content.tsx:512— session-details-content.SessionDetailsContent has cyclomatic complexity 40 (threshold 15). Of this number, 35 points are the body's own statements and 5 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-catalog-source.CodexCatalogStatusLine (cyclomatic 40) src/components/settings/codex-catalog-source.tsx:464— codex-catalog-source.CodexCatalogStatusLine has cyclomatic complexity 40 (threshold 15). Of this number, 34 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
task-settings-dialog.TaskSettingsBody (cyclomatic 40) src/components/tasks/task-settings-dialog.tsx:189— task-settings-dialog.TaskSettingsBody has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 9 of the 40 points are its own statements and the rest belongs to 10 function items inside it that branch (save, a function literal at line 254, a function literal at line 600, …). 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.
delegation-card.templateLiteralTextEnd (cyclomatic 40) src/lib/delegation-card.ts:785— delegation-card.templateLiteralTextEnd 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.
DelegationListener::serve_one (cyclomatic 39) src-tauri/src/acp/delegation/listener.rs:444— DelegationListener::serve_one 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.
automations-page.AutomationsPage (cyclomatic 39) src/components/automations/automations-page.tsx:223— automations-page.AutomationsPage has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 15 of the 39 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 286, a function literal at line 333, a function literal at line 243, …). 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.
search-command-dialog.SearchCommandDialog (cyclomatic 39) src/components/conversations/search-command-dialog.tsx:44— search-command-dialog.SearchCommandDialog has cyclomatic complexity 39 (threshold 15). Of this number, 25 points are the body's own statements and 14 belong to 8 function literals 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.
command-dropdown.CommandDropdown (cyclomatic 39) src/components/layout/command-dropdown.tsx:58— command-dropdown.CommandDropdown has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 8 of the 39 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 198, 152, 134, …). 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.
task-card.TaskCard (cyclomatic 39) src/components/tasks/task-card.tsx:411— task-card.TaskCard has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 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.
canvas-model.deriveFlowGraph (cyclomatic 38) src/components/canvas/canvas-model.ts:891— canvas-model.deriveFlowGraph has cyclomatic complexity 38 (threshold 15). Of this number, 35 points are the body's own statements and 3 belong 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.
antigravity-config-panel.HeadlessSignIn (cyclomatic 38) src/components/settings/antigravity-config-panel.tsx:242— antigravity-config-panel.HeadlessSignIn has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 15 of the 38 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 365, 317, 493, …). 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.
antigravity-config-panel.AntigravityConfigPanel (cyclomatic 38) src/components/settings/antigravity-config-panel.tsx:927— antigravity-config-panel.AntigravityConfigPanel has cyclomatic complexity 38 (threshold 15). Of this number, 23 points are the body's own statements and 15 belong to 4 function literals 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.
pet-manager-section.PetManagerSection (cyclomatic 38) src/components/settings/pet-manager-section.tsx:61— pet-manager-section.PetManagerSection has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 87, 283, 107, …). 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.
quick-messages-settings.QuickMessagesSettings (cyclomatic 38) src/components/settings/quick-messages-settings.tsx:121— quick-messages-settings.QuickMessagesSettings has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 13 of the 38 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 430, 200, 215, …). 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.
tab-store.applyRemoteSnapshot (cyclomatic 38) src/stores/tab-store.ts:3441— tab-store.applyRemoteSnapshot has cyclomatic complexity 38 (threshold 15). Of this number, 29 points are the body's own statements and 9 belong to 4 function literals 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.
validate_review_intake.validate_intake (cyclomatic 37) src-tauri/science/skills/peer-review/scripts/validate_review_intake.py:74— validate_review_intake.validate_intake 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.
region-node.RegionNode (cyclomatic 37) src/components/canvas/nodes/region-node.tsx:34— region-node.RegionNode has cyclomatic complexity 37 (threshold 15). Of this number, 30 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
doc-guest-preview.DocGuestPreview (cyclomatic 37) src/components/files/doc-guest-preview.tsx:76— doc-guest-preview.DocGuestPreview has cyclomatic complexity 37 (threshold 15). Of this number, 30 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
step-visuals.toolIcon (cyclomatic 37) src/components/message/activity/step-visuals.tsx:53— step-visuals.toolIcon has cyclomatic complexity 37 (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.
computer-settings.StopShortcutRow (cyclomatic 37) src/components/settings/computer-settings.tsx:893— computer-settings.StopShortcutRow has cyclomatic complexity 37 (threshold 15). Of this number, 28 points are the body's own statements and 9 belong to 2 function literals 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.
opencode-permissions.globCovers (cyclomatic 37) src/lib/opencode-permissions.ts:445— opencode-permissions.globCovers has cyclomatic complexity 37 (threshold 15). Of this number, 24 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
composer-connection-status.ComposerConnectionStatus (cyclomatic 36) src/components/chat/composer-connection-status.tsx:92— composer-connection-status.ComposerConnectionStatus has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to 5 function literals 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.
forge-settings-dialog.ForgeSettingsScope (cyclomatic 36) src/components/forge/forge-settings-dialog.tsx:163— forge-settings-dialog.ForgeSettingsScope has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
status-bar-mcp.StatusBarMcp (cyclomatic 36) src/components/layout/status-bar-mcp.tsx:85— status-bar-mcp.StatusBarMcp has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 belong to 5 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.
merge-workspace.MergeWorkspace (cyclomatic 36) src/components/merge/merge-workspace.tsx:45— merge-workspace.MergeWorkspace has cyclomatic complexity 36 (threshold 15). Of this number, 20 points are the body's own statements and 16 belong to 8 function items inside it that branch. 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.
activity-timeline.ActivityTimeline (cyclomatic 36) src/components/message/activity/activity-timeline.tsx:150— activity-timeline.ActivityTimeline has cyclomatic complexity 36 (threshold 15). Of this number, 26 points are the body's own statements and 10 belong to 3 function literals inside it that branch. 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.
version-control-settings.VersionControlSettings (cyclomatic 36) src/components/settings/version-control-settings.tsx:226— version-control-settings.VersionControlSettings has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 301, 366, 267, …). 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.
build-activity.collectSteps (cyclomatic 36) src/lib/activity/build-activity.ts:247— build-activity.collectSteps has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 261, note). 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.
conversation-runtime-store.computeTimelinePrefix (cyclomatic 36) src/stores/conversation-runtime-store.ts:3914— conversation-runtime-store.computeTimelinePrefix has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to 5 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.
conversation-tags-store.useConversationTagsStore (cyclomatic 36) src/stores/conversation-tags-store.ts:161— conversation-tags-store.useConversationTagsStore has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 170, 271, 217, …). 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.
ConnectionManager::send_prompt_linked_full (cyclomatic 35) src-tauri/src/acp/manager.rs:1511— ConnectionManager::send_prompt_linked_full 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.
image_metadata.screen_metadata (cyclomatic 35) src-tauri/science/skills/scientific-visualization/scripts/image_metadata.py:493— image_metadata.screen_metadata 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.
aux-panel-file-tree-tab.RenderNode (cyclomatic 35) src/components/layout/aux-panel-file-tree-tab.tsx:640— aux-panel-file-tree-tab.RenderNode has cyclomatic complexity 35 (threshold 15). Of this number, 23 points are the body's own statements and 12 belong to 10 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.
command-rows.CommandDetail (cyclomatic 35) src/components/message/activity/rows/command-rows.tsx:357— command-rows.CommandDetail has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to 2 function literals 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.
acp-agent-settings.buildVersionCheck (cyclomatic 35) src/components/settings/acp-agent-settings.tsx:4439— acp-agent-settings.buildVersionCheck 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.
general-settings.GeneralSettings (cyclomatic 35) src/components/settings/general-settings.tsx:75— general-settings.GeneralSettings has cyclomatic complexity 35 (threshold 15). Of this number, 16 points are the body's own statements and 19 belong to 9 function literals 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.
html-preview-inline.inlineHtmlResources (cyclomatic 35) REDACTED:567— html-preview-inline.inlineHtmlResources has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 14 of the 35 points are its own statements and the rest belongs to 9 function items inside it that branch (stripActiveAttributes, a function literal at line 672, a function literal at line 644, …). 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.
validate_hypothesis_schema.validate_record (cyclomatic 34) src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:783— validate_hypothesis_schema.validate_record 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.
browser-toolbar.BrowserToolbar (cyclomatic 34) src/components/browser/browser-toolbar.tsx:179— browser-toolbar.BrowserToolbar has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 10 function items inside it that branch (submit, a function literal at line 388, onKeyDown, …). 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.
status-bar-computer.ComputerPopover (cyclomatic 34) src/components/layout/status-bar-computer.tsx:173— status-bar-computer.ComputerPopover has cyclomatic complexity 34 (threshold 15). Of this number, 21 points are the body's own statements and 13 belong to 8 function items inside it that branch. 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.
generic-row.GenericRow (cyclomatic 34) src/components/message/activity/rows/generic-row.tsx:48— generic-row.GenericRow has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 86, 195, 68, …). 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.
branch-picker.BranchPicker (cyclomatic 34) src/components/shared/branch-picker.tsx:96— branch-picker.BranchPicker has cyclomatic complexity 34 (threshold 15). Of this number, 20 points are the body's own statements and 14 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tab-store.applyGroupInvariants (cyclomatic 34) src/stores/tab-store.ts:1193— tab-store.applyGroupInvariants 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.
LockedHome::commit (cyclomatic 33) src-tauri/src/acp/codex_catalog_commit/mod.rs:1876— LockedHome::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.
computer-indicator.ComputerIndicator (cyclomatic 33) src/components/computer/computer-indicator.tsx:66— computer-indicator.ComputerIndicator has cyclomatic complexity 33 (threshold 15). Of this number, 24 points are the body's own statements and 9 belong to 6 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.
conversation-detail-header.ConversationDetailHeader (cyclomatic 33) src/components/conversations/conversation-detail-header.tsx:96— conversation-detail-header.ConversationDetailHeader has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 8 of the 33 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 200, 174, 194, …). 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.
acp-agent-settings.buildAgentDraft (cyclomatic 33) src/components/settings/acp-agent-settings.tsx:3907— acp-agent-settings.buildAgentDraft 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.
opencode-permissions-section.OpenCodePermissionsSection (cyclomatic 33) src/components/settings/opencode-permissions-section.tsx:103— opencode-permissions-section.OpenCodePermissionsSection has cyclomatic complexity 33 (threshold 15). Of this number, 22 points are the body's own statements and 11 belong to 9 function literals inside it that branch. 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.
edit.describeEditFiles (cyclomatic 33) src/lib/activity/edit.ts:495— edit.describeEditFiles has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WeixinBackend::start (cyclomatic 32) src-tauri/src/chat_channel/backends/weixin.rs:438— WeixinBackend::start 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.
CitationValidator.validate_file (cyclomatic 32) src-tauri/science/skills/citation-management/scripts/validate_citations.py:360— CitationValidator.validate_file 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.
figure_export.export_figure (cyclomatic 32) src-tauri/science/skills/scientific-visualization/scripts/figure_export.py:167— figure_export.export_figure 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.
browser-device-stage.BrowserDeviceStage (cyclomatic 32) src/components/browser/browser-device-stage.tsx:72— browser-device-stage.BrowserDeviceStage has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body's own statements and 10 belong to 4 function literals 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.
activity-header.ActivityHeader (cyclomatic 32) src/components/message/activity/activity-header.tsx:47— activity-header.ActivityHeader has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
channel-list-tab.ChannelListTab (cyclomatic 32) src/components/settings/channel-list-tab.tsx:57— channel-list-tab.ChannelListTab has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 248, 115, 131, …). 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.
delegation-settings.DelegationSettingsSection (cyclomatic 32) src/components/settings/delegation-settings.tsx:92— delegation-settings.DelegationSettingsSection has cyclomatic complexity 32 (threshold 15). Of this number, 19 points are the body's own statements and 13 belong to 11 function literals 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.
edit-model-provider-dialog.EditModelProviderDialog (cyclomatic 32) src/components/settings/edit-model-provider-dialog.tsx:53— edit-model-provider-dialog.EditModelProviderDialog has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 147, 77, 111, …). 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.
server-file-browser-dialog.ServerFileBrowserDialog (cyclomatic 32) src/components/shared/server-file-browser-dialog.tsx:35— server-file-browser-dialog.ServerFileBrowserDialog has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 225, a function literal at line 187, renderEntries, …). 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.
usePetDrag.usePetDrag (cyclomatic 31) src/app/pet/_hooks/usePetDrag.ts:56— usePetDrag.usePetDrag has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 130, 97, 182, …). 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.
message-thread.EscapeLockOnUserScroll (cyclomatic 31) src/components/ai-elements/message-thread.tsx:143— message-thread.EscapeLockOnUserScroll has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 199, 176, 150, …). 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.
file-viewer-drawer.FileViewerBody (cyclomatic 31) src/components/files/file-viewer-drawer.tsx:122— file-viewer-drawer.FileViewerBody has cyclomatic complexity 31 (threshold 15). Of this number, 16 points are the body's own statements and 15 belong to 9 function literals 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.
status-bar-web-service.StatusBarWebService (cyclomatic 31) src/components/layout/status-bar-web-service.tsx:94— status-bar-web-service.StatusBarWebService has cyclomatic complexity 31 (threshold 15). Of this number, 23 points are the body's own statements and 8 belong to 7 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.
goal-tool-call.GoalCard (cyclomatic 31) src/components/message/goal-tool-call.tsx:212— goal-tool-call.GoalCard has cyclomatic complexity 31 (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.
acp-agent-settings.extractCodexTomlImportantValues (cyclomatic 31) src/components/settings/acp-agent-settings.tsx:2426— acp-agent-settings.extractCodexTomlImportantValues 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.
assistant-editor-dialog.AssistantEditorBody (cyclomatic 31) src/components/settings/assistant-editor-dialog.tsx:108— assistant-editor-dialog.AssistantEditorBody 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. This shape REPEATS in the file: one other method here (assistant-editor-dialog.AssistantEditorBody::save) 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.
office-tools-settings.OfficeToolsBody (cyclomatic 31) src/components/settings/office-tools-settings.tsx:221— office-tools-settings.OfficeToolsBody has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 4 of the 31 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 242, 262, 283, …). 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.
cron-humanize.describeCron (cyclomatic 31) src/lib/cron-humanize.ts:29— cron-humanize.describeCron 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.
lint_causal_claims.lint (cyclomatic 30) src-tauri/science/skills/hypothesis-generation/scripts/lint_causal_claims.py:58— lint_causal_claims.lint 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.
_common.validate_evaluation (cyclomatic 30) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:750— _common.validate_evaluation 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.
html-code-preview.HtmlCodePreview (cyclomatic 30) src/components/ai-elements/html-code-preview.tsx:122— html-code-preview.HtmlCodePreview has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 belong to 6 function literals 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.
chat-width-handles.WidthHandle (cyclomatic 30) src/components/chat/chat-width-handles.tsx:140— chat-width-handles.WidthHandle 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 8 function literals inside it that branch (lines 247, 197, 284, …). 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.
image-preview.ImagePreview (cyclomatic 30) src/components/files/image-preview.tsx:41— image-preview.ImagePreview has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 8 function literals 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.
aux-panel-git-log-tab.AuthorFilter (cyclomatic 30) src/components/layout/aux-panel-git-log-tab.tsx:935— aux-panel-git-log-tab.AuthorFilter has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 belong to 4 function items inside it that branch. 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.
pet-marketplace-dialog.PetMarketplaceDialog (cyclomatic 30) src/components/settings/pet-marketplace-dialog.tsx:66— pet-marketplace-dialog.PetMarketplaceDialog has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 110, 185, 139, …). 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.
codex-model-list-editor.CodexCustomRow (cyclomatic 30) src/components/settings/codex-model-list-editor.tsx:895— codex-model-list-editor.CodexCustomRow has cyclomatic complexity 30 (threshold 15). Of this number, 16 points are the body's own statements and 14 belong to 8 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.
tab-item.TabItem (cyclomatic 30) src/components/tabs/tab-item.tsx:92— tab-item.TabItem has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 belong to 5 function literals 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.
chat-html-markdown.htmlEnd (cyclomatic 30) REDACTED:107— chat-html-markdown.htmlEnd 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.
delegation-card.parseToolOutput (cyclomatic 30) src/lib/delegation-card.ts:1477— delegation-card.parseToolOutput 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.
session-files.computeLineDiff (cyclomatic 30) REDACTED:625— session-files.computeLineDiff 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.
LarkBackend::start_ws_receiver (cyclomatic 29) src-tauri/src/chat_channel/backends/lark.rs:257— LarkBackend::start_ws_receiver 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.
lint_review.lint (cyclomatic 29) src-tauri/science/skills/peer-review/scripts/lint_review.py:113— lint_review.lint 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.
browser-events-bridge.BrowserEventsBridge (cyclomatic 29) src/components/browser/browser-events-bridge.tsx:115— browser-events-bridge.BrowserEventsBridge has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 170, 206, 301, …). 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.
browser-page-handoff.BrowserSendToChatControl (cyclomatic 29) src/components/browser/browser-page-handoff.tsx:83— browser-page-handoff.BrowserSendToChatControl has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 9 of the 29 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 118, 104, 149, …). 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.
aux-panel.AuxPanel (cyclomatic 29) src/components/layout/aux-panel.tsx:107— aux-panel.AuxPanel has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body's own statements and 9 belong to 2 function literals 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.
delegation-rows.DelegationStepRow (cyclomatic 29) src/components/message/activity/rows/delegation-rows.tsx:174— delegation-rows.DelegationStepRow has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to 2 function literals 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.
acp-connections-context.sameConfigOptions (cyclomatic 29) src/contexts/acp-connections-context.tsx:1519— acp-connections-context.sameConfigOptions 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.
edit.editDiffText (cyclomatic 29) src/lib/activity/edit.ts:694— edit.editDiffText 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.
PetWindow.PetWindow (cyclomatic 28) src/app/pet/_components/PetWindow.tsx:57— PetWindow.PetWindow has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 214, a function literal at line 156, a function literal at line 160, …). 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.
model-option-list.ModelOptionList (cyclomatic 28) src/components/chat/model-option-list.tsx:72— model-option-list.ModelOptionList has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 7 of the 28 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 157, 293, 219, …). 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.
sidebar-section-header.SidebarSectionHeader (cyclomatic 28) src/components/conversations/sidebar-section-header.tsx:43— sidebar-section-header.SidebarSectionHeader has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
sidebar.Sidebar (cyclomatic 28) src/components/layout/sidebar.tsx:172— sidebar.Sidebar has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 belong to 10 function literals 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.
use-rail-growth.useRailGrowth (cyclomatic 28) src/components/message/activity/use-rail-growth.ts:68— use-rail-growth.useRailGrowth has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 103, 74, 84, …). 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.
hyperframes-launcher.HyperframesLauncher (cyclomatic 28) src/components/project-boot/hyperframes/hyperframes-launcher.tsx:63— hyperframes-launcher.HyperframesLauncher has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 7 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.
channel-events-tab.ChannelEventsTab (cyclomatic 28) src/components/settings/channel-events-tab.tsx:187— channel-events-tab.ChannelEventsTab has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 7 of the 28 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 346, 241, 289, …). 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.
file-tab-id.parseFileTabId (cyclomatic 28) src/lib/file-tab-id.ts:112— file-tab-id.parseFileTabId 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.
conflict-dialog.ConflictDialog (cyclomatic 27) src/components/layout/conflict-dialog.tsx:34— conflict-dialog.ConflictDialog has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 61, a function literal at line 127, handleAbort, …). 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.
message-list-view.mergeConsecutiveAssistantTurns (cyclomatic 27) src/components/message/message-list-view.tsx:1007— message-list-view.mergeConsecutiveAssistantTurns has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 2 function items inside it that branch (flush, reuseCachedMergedRun). 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.
opencode-plugins-modal.OpencodePluginsModal (cyclomatic 27) src/components/settings/opencode-plugins-modal.tsx:43— opencode-plugins-modal.OpencodePluginsModal has cyclomatic complexity 27 (threshold 15). Of this number, 16 points are the body's own statements and 11 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
task-merge-dialog.TaskMergeDialog (cyclomatic 27) src/components/tasks/task-merge-dialog.tsx:56— task-merge-dialog.TaskMergeDialog has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 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.
ClaudeParser::parse_jsonl_summary (cyclomatic 26) src-tauri/src/parsers/claude.rs:1521— ClaudeParser::parse_jsonl_summary 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.
sequence_inspector.inspect_sequence_file (cyclomatic 26) src-tauri/science/skills/exploratory-data-analysis/scripts/sequence_inspector.py:71— sequence_inspector.inspect_sequence_file 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.
office_watch_shim.held (cyclomatic 26) REDACTED:60— office_watch_shim.held has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 9 function items inside it that branch (relay, connect, a function literal at line 99, …). 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.
eval-render.__codegEvalRender (cyclomatic 26) src/browser-injected/eval-render.js:82— eval-render.__codegEvalRender 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.
use-reference-search.useReferenceSearch (cyclomatic 26) src/components/chat/composer/use-reference-search.ts:251— use-reference-search.useReferenceSearch has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 318, 405, 411, …). 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.
merge-diff.computeMergeHunks (cyclomatic 26) src/components/merge/merge-diff.ts:170— merge-diff.computeMergeHunks has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong 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.
subagent-session-dialog.SubagentSessionDialog (cyclomatic 26) src/components/message/subagent-session-dialog.tsx:114— subagent-session-dialog.SubagentSessionDialog has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 151, 194, 189, …). 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.
custom-style-section.CustomStyleSection (cyclomatic 26) src/components/settings/custom-style-section.tsx:157— custom-style-section.CustomStyleSection has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 6 function literals 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.
assistant-editor-dialog.AssistantEditorBody::save (cyclomatic 26) src/components/settings/assistant-editor-dialog.tsx:262— assistant-editor-dialog.AssistantEditorBody::save 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 shape REPEATS in the file: one other method here (assistant-editor-dialog.AssistantEditorBody) 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.
computer-use-settings.DriverSection (cyclomatic 26) src/components/settings/computer-use-settings.tsx:149— computer-use-settings.DriverSection has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 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.
task-actions.buildTaskActions (cyclomatic 26) src/components/tasks/task-actions.ts:116— task-actions.buildTaskActions 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.
task-row.TaskRow (cyclomatic 26) src/components/tasks/task-row.tsx:90— task-row.TaskRow has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 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.
exit-meaning.answerOf (cyclomatic 26) src/lib/activity/exit-meaning.ts:435— exit-meaning.answerOf 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.
branch-selector-rows.buildBranchRows (cyclomatic 26) src/lib/branch-selector-rows.ts:299— branch-selector-rows.buildBranchRows 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.
CitationValidator.validate_entry (cyclomatic 25) src-tauri/science/skills/citation-management/scripts/validate_citations.py:89— CitationValidator.validate_entry 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.
check_traceability.validate_manifest (cyclomatic 25) src-tauri/science/skills/scholar-evaluation/scripts/check_traceability.py:26— check_traceability.validate_manifest 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.
evaluate_matrix.load_scores (cyclomatic 25) src-tauri/science/skills/scientific-brainstorming/scripts/evaluate_matrix.py:153— evaluate_matrix.load_scores 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.
browser-status-layer.BrowserNoticeBar (cyclomatic 25) src/components/browser/browser-status-layer.tsx:139— browser-status-layer.BrowserNoticeBar has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
reference-uri.parseCodegReferenceUri (cyclomatic 25) src/components/chat/composer/reference-uri.ts:81— reference-uri.parseCodegReferenceUri has cyclomatic complexity 25 (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.
unstash-dialog.StashWorkspace (cyclomatic 25) src/components/layout/unstash-dialog.tsx:184— unstash-dialog.StashWorkspace has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 7 function items inside it that branch (handleSelectFile, handleToggleStash, handleDrop, …). 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.
live-turn-stats.extractEditStats (cyclomatic 25) src/components/message/live-turn-stats.tsx:165— live-turn-stats.extractEditStats has cyclomatic complexity 25 (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.
assistants-panel.AssistantsPanel (cyclomatic 25) src/components/settings/assistants-panel.tsx:145— assistants-panel.AssistantsPanel has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 6 function literals 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.
browser-settings.BrowserSettings (cyclomatic 25) src/components/settings/browser-settings.tsx:522— browser-settings.BrowserSettings has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 562, a function literal at line 1013, a function literal at line 1049, …). 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.
provider-models.ModelPickerDialog (cyclomatic 25) src/components/settings/provider-models.tsx:434— provider-models.ModelPickerDialog has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 belong to 6 function items inside it that branch. 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.
use-long-press-drag.useLongPressDrag (cyclomatic 25) src/hooks/use-long-press-drag.ts:20— use-long-press-drag.useLongPressDrag has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 74, 164, 133, …). 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.
ai-elements-adapter.createMessageTurnAdapter.adapt (cyclomatic 25) src/lib/adapters/ai-elements-adapter.ts:2863— ai-elements-adapter.createMessageTurnAdapter.adapt has cyclomatic complexity 25 (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.
html-preview-inline.scanStartTags (cyclomatic 25) REDACTED:121— html-preview-inline.scanStartTags 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.
delegation-card.codeModeArgsTransparent (cyclomatic 25) src/lib/delegation-card.ts:910— delegation-card.codeModeArgsTransparent 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.
file-tree-keyboard.resolveTreeKeyboardAction (cyclomatic 25) src/lib/file-tree-keyboard.ts:102— file-tree-keyboard.resolveTreeKeyboardAction 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.
session-files.buildDiffChunk (cyclomatic 25) REDACTED:1061— session-files.buildDiffChunk 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.
OpenClawParser::parse_conversation_detail (cyclomatic 24) src-tauri/src/parsers/openclaw.rs:509— OpenClawParser::parse_conversation_detail 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.
check_falsification_controls.audit (cyclomatic 24) src-tauri/science/skills/hypothesis-generation/scripts/check_falsification_controls.py:302— check_falsification_controls.audit 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.
generate_report_scaffold.generate_scaffold (cyclomatic 24) src-tauri/science/skills/scholar-evaluation/scripts/generate_report_scaffold.py:36— generate_report_scaffold.generate_scaffold 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.
act.selectIn (cyclomatic 24) browser-agent/src/act.ts:1445— act.selectIn has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.act (cyclomatic 24) browser-agent/src/index.ts:480— index.act 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.
inline-dollar-math.normalizeInlineDollarMath (cyclomatic 24) src/components/ai-elements/inline-dollar-math.ts:58— inline-dollar-math.normalizeInlineDollarMath has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong 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.
canvas-model.computeAlignment (cyclomatic 24) src/components/canvas/canvas-model.ts:531— canvas-model.computeAlignment 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.
file-node.FileNode (cyclomatic 24) src/components/canvas/nodes/file-node.tsx:59— file-node.FileNode has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 7 function literals 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.
html-preview.InlineHtmlPreview (cyclomatic 24) src/components/files/html-preview.tsx:140— html-preview.InlineHtmlPreview has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 5 function literals 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.
activity-row.ActivityRow (cyclomatic 24) src/components/message/activity/activity-row.tsx:59— activity-row.ActivityRow has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals 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.
ask-question-result-card.AskQuestionResultCard (cyclomatic 24) src/components/message/ask-question-result-card.tsx:46— ask-question-result-card.AskQuestionResultCard has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
reply-artifacts.ReplyArtifacts (cyclomatic 24) src/components/message/reply-artifacts.tsx:62— reply-artifacts.ReplyArtifacts has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 5 function items inside it that branch. 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.
acp-agent-settings.upsertTomlSectionBooleanKey (cyclomatic 24) src/components/settings/acp-agent-settings.tsx:2925— acp-agent-settings.upsertTomlSectionBooleanKey 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.
add-chat-channel-dialog.AddChatChannelDialog (cyclomatic 24) src/components/settings/add-chat-channel-dialog.tsx:34— add-chat-channel-dialog.AddChatChannelDialog has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 belong to 2 function literals 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.
edit-chat-channel-dialog.EditChatChannelDialog (cyclomatic 24) src/components/settings/edit-chat-channel-dialog.tsx:33— edit-chat-channel-dialog.EditChatChannelDialog has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 belong to 2 function literals inside it that branch. 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.
science-settings.ScienceBody (cyclomatic 24) src/components/settings/science-settings.tsx:39— science-settings.ScienceBody has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 102, 124, 56, …). 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.
close-request-dialog.CloseRequestDialog (cyclomatic 24) src/components/workspace/close-request-dialog.tsx:65— close-request-dialog.CloseRequestDialog has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 107, 136, 150, …). 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.
command.commandOutputFromJsonString (cyclomatic 24) src/lib/activity/command.ts:147— command.commandOutputFromJsonString has cyclomatic complexity 24 (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.
delegation-card.skipJsTemplate (cyclomatic 24) src/lib/delegation-card.ts:309— delegation-card.skipJsTemplate 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.
token-speed.isDense (cyclomatic 24) src/lib/token-speed.ts:52— token-speed.isDense has cyclomatic complexity 24 (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.
TelegramBackend::start (cyclomatic 23) src-tauri/src/chat_channel/backends/telegram.rs:204— TelegramBackend::start 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.
_common.parse_bibtex (cyclomatic 23) src-tauri/science/skills/citation-management/scripts/_common.py:97— _common.parse_bibtex 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.
weight_sensitivity.analyze (cyclomatic 23) src-tauri/science/skills/scholar-evaluation/scripts/weight_sensitivity.py:47— weight_sensitivity.analyze 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.
ScientificSchematicGenerator.generate_iterative (cyclomatic 23) src-tauri/science/skills/scientific-schematics/scripts/generate_schematic_ai.py:561— ScientificSchematicGenerator.generate_iterative 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.
agent-config-section.AgentConfigSection (cyclomatic 23) src/components/automations/agent-config-section.tsx:63— agent-config-section.AgentConfigSection has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
automation-editor.AutomationEditor::submit (cyclomatic 23) src/components/automations/automation-editor.tsx:228— automation-editor.AutomationEditor::submit 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.
browser-tab-view.NativeBrowserTabView (cyclomatic 23) src/components/browser/browser-tab-view.tsx:122— browser-tab-view.NativeBrowserTabView has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 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.
async-task-row.AsyncTaskRow (cyclomatic 23) src/components/chat/async-task-row.tsx:66— async-task-row.AsyncTaskRow has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body's own statements and 9 belong to 3 function literals 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.
composer-add-menu.ComposerAddMenu (cyclomatic 23) src/components/chat/composer/composer-add-menu.tsx:78— composer-add-menu.ComposerAddMenu has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 5 function literals 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.
conversation-context-bar.ConversationFolderBranchPicker (cyclomatic 23) src/components/chat/conversation-context-bar.tsx:270— conversation-context-bar.ConversationFolderBranchPicker has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to 4 function literals 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.
conversation-tag-picker.ConversationTagPickerPanel (cyclomatic 23) src/components/conversations/conversation-tag-picker.tsx:183— conversation-tag-picker.ConversationTagPickerPanel has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
image-diff-view.ImageDiffView (cyclomatic 23) src/components/diff/image-diff-view.tsx:150— image-diff-view.ImageDiffView has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body's own statements and 9 belong to 4 function literals 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.
file-workspace-panel.buildDiffOutline (cyclomatic 23) src/components/files/file-workspace-panel.tsx:303— file-workspace-panel.buildDiffOutline 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.
forge-issue-row.RowChecksMark (cyclomatic 23) src/components/forge/forge-issue-row.tsx:291— forge-issue-row.RowChecksMark 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.
command-rows.CommandLabel (cyclomatic 23) src/components/message/activity/rows/command-rows.tsx:119— command-rows.CommandLabel 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.
use-row-pointing.useRowPointing (cyclomatic 23) src/components/message/activity/use-row-pointing.ts:38— use-row-pointing.useRowPointing has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 45, 88, 58, …). 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.
message-list-view.HistoricalMessageGroup (cyclomatic 23) src/components/message/message-list-view.tsx:1289— message-list-view.HistoricalMessageGroup has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
experts-settings.ExpertsBody (cyclomatic 23) src/components/settings/experts-settings.tsx:35— experts-settings.ExpertsBody has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 98, 122, 52, …). 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.
ai-elements-adapter.groupGoalRuns (cyclomatic 23) src/lib/adapters/ai-elements-adapter.ts:2086— ai-elements-adapter.groupGoalRuns has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tool-kind-classifier.isAgentLikeToolName (cyclomatic 23) src/lib/adapters/tool-kind-classifier.ts:49— tool-kind-classifier.isAgentLikeToolName 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.
codex-visualize.splitCodexVisualizeRefs (cyclomatic 23) src/lib/codex-visualize.ts:97— codex-visualize.splitCodexVisualizeRefs has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
tool-call-normalization.normalizeUncached (cyclomatic 23) REDACTED:614— tool-call-normalization.normalizeUncached 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.
tool-call-normalization.inferLiveToolName (cyclomatic 23) REDACTED:714— tool-call-normalization.inferLiveToolName 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.
OpenAlexSearcher.search (cyclomatic 22) src-tauri/science/skills/citation-management/scripts/search_openalex.py:66— OpenAlexSearcher.search 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.
audit_statistics_reproducibility.audit (cyclomatic 22) src-tauri/science/skills/peer-review/scripts/audit_statistics_reproducibility.py:186— audit_statistics_reproducibility.audit 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.
helper.window.addEventListener("error") (cyclomatic 22) src/browser-injected/helper.js:421— helper.window.addEventListener("error") 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.
message.containerPrefixEnd (cyclomatic 22) src/components/ai-elements/message.tsx:429— message.containerPrefixEnd 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.
cron-builder-dialog.CronBuilderBody (cyclomatic 22) src/components/automations/cron-builder-dialog.tsx:162— cron-builder-dialog.CronBuilderBody has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 4 function literals 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.
use-composer-attachments.useComposerAttachments.appendImageAttachments (cyclomatic 22) src/components/chat/composer/use-composer-attachments.ts:567— use-composer-attachments.useComposerAttachments.appendImageAttachments has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 591, 606, 637, …). 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.
forge-issue-detail-sheet.CommentThread (cyclomatic 22) src/components/forge/forge-issue-detail-sheet.tsx:281— forge-issue-detail-sheet.CommentThread has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 3 function literals 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.
remote-manage-dialog.RemoteManageDialog::handleSave (cyclomatic 22) src/components/layout/remote-manage-dialog.tsx:110— remote-manage-dialog.RemoteManageDialog::handleSave 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.
edit-row.EditRow (cyclomatic 22) src/components/message/activity/rows/edit-row.tsx:60— edit-row.EditRow has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong 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.
context-compaction-card.ContextCompactionCard (cyclomatic 22) src/components/message/context-compaction-card.tsx:181— context-compaction-card.ContextCompactionCard 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.
message-nav-entries.buildMessageNavEntries (cyclomatic 22) src/components/message/message-nav-entries.ts:327— message-nav-entries.buildMessageNavEntries 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.
pet-editor.PetEditor (cyclomatic 22) src/components/settings/pet-editor.tsx:33— pet-editor.PetEditor 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 (handleSubmit, a function literal at line 47, a function literal at line 160, …). 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.
custom-css-dialog.CustomCssDialog (cyclomatic 22) src/components/settings/custom-css-dialog.tsx:34— custom-css-dialog.CustomCssDialog has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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.
required-agent-options.useRequiredOptionsGate (cyclomatic 22) src/components/settings/required-agent-options.tsx:72— required-agent-options.useRequiredOptionsGate has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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.
codex-catalog-source.useCodexProviderList (cyclomatic 22) src/components/settings/codex-catalog-source.tsx:97— codex-catalog-source.useCodexProviderList has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 2 function literals 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.
opencode-permissions-section.PermissionRow (cyclomatic 22) src/components/settings/opencode-permissions-section.tsx:480— opencode-permissions-section.PermissionRow has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
skill-agent-matrix.MatrixCell (cyclomatic 22) src/components/settings/skill-agent-matrix.tsx:998— skill-agent-matrix.MatrixCell 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.
charts.TrendChart (cyclomatic 22) src/components/token-usage/charts.tsx:86— charts.TrendChart has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 4 function literals 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.
chart.ChartTooltipContent (cyclomatic 22) REDACTED:118— chart.ChartTooltipContent 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 2 function literals inside it that branch (lines 201, 148). 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.
ask-question.parseAskQuestionInput (cyclomatic 22) src/lib/ask-question.ts:108— ask-question.parseAskQuestionInput 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.
delegation-card.interpretReport (cyclomatic 22) src/lib/delegation-card.ts:1309— delegation-card.interpretReport 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.
file-open-target.normalizeAbsPath (cyclomatic 22) src/lib/file-open-target.ts:41— file-open-target.normalizeAbsPath 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.
tool-call-normalization.inferFromFreeformName (cyclomatic 22) REDACTED:208— tool-call-normalization.inferFromFreeformName 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.
conversation-runtime-store.resolveLiveToolInput (cyclomatic 22) src/stores/conversation-runtime-store.ts:920— conversation-runtime-store.resolveLiveToolInput 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.
tab-store.persistGroupState (cyclomatic 22) src/stores/tab-store.ts:874— tab-store.persistGroupState has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent 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 22) src/browser-injected/helper.js:421— (anonymous) 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.
Key::parse (cyclomatic 21) src-tauri/src/computer/keys.rs:68— Key::parse has cyclomatic complexity 21 (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.
_capabilities.validate_magic (cyclomatic 21) src-tauri/science/skills/exploratory-data-analysis/scripts/_capabilities.py:472— _capabilities.validate_magic 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.
_structured.inspect_hdf5 (cyclomatic 21) src-tauri/science/skills/exploratory-data-analysis/scripts/_structured.py:248— _structured.inspect_hdf5 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.
automations-page.RunHistory (cyclomatic 21) src/components/automations/automations-page.tsx:1293— automations-page.RunHistory has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1396, a function literal at line 1309, viewConversation, …). 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.
move-conversation-dialog.MoveConversationDialog (cyclomatic 21) src/components/conversations/move-conversation-dialog.tsx:77— move-conversation-dialog.MoveConversationDialog has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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.
sidebar-tag-filter.TagFilterPanel (cyclomatic 21) src/components/conversations/sidebar-tag-filter.tsx:154— sidebar-tag-filter.TagFilterPanel has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 190, 282, 178, …). 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.
unified-diff-preview.DiffFileSection (cyclomatic 21) src/components/diff/unified-diff-preview.tsx:922— unified-diff-preview.DiffFileSection has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
forge-issue-detail-sheet.ChangedFiles (cyclomatic 21) src/components/forge/forge-issue-detail-sheet.tsx:1523— forge-issue-detail-sheet.ChangedFiles has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 3 function literals 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.
aux-panel-tasks-tab.TasksAuxTab (cyclomatic 21) src/components/layout/aux-panel-tasks-tab.tsx:85— aux-panel-tasks-tab.TasksAuxTab has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
activity-row.ActivityMembers (cyclomatic 21) src/components/message/activity/activity-row.tsx:342— activity-row.ActivityMembers has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals 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.
use-agent-call-model.parseTaskOutcomeEnvelope (cyclomatic 21) src/components/message/use-agent-call-model.ts:67— use-agent-call-model.parseTaskOutcomeEnvelope has cyclomatic complexity 21 (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.
use-agent-call-model.useAgentCallModel (cyclomatic 21) src/components/message/use-agent-call-model.ts:193— use-agent-call-model.useAgentCallModel 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.
slide-slot.SlideSlot (cyclomatic 21) src/components/message/slide-slot.tsx:22— slide-slot.SlideSlot has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 43, 51, 64, …). 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.
command-rows.CommandRow (cyclomatic 21) src/components/message/activity/rows/command-rows.tsx:522— command-rows.CommandRow has cyclomatic complexity 21 (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.
antigravity-config-panel.LeakedTempSection (cyclomatic 21) src/components/settings/antigravity-config-panel.tsx:704— antigravity-config-panel.LeakedTempSection has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
add-model-provider-dialog.AddModelProviderDialog (cyclomatic 21) src/components/settings/add-model-provider-dialog.tsx:50— add-model-provider-dialog.AddModelProviderDialog has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 131, 125, 86, …). 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.
desktop-notification-settings.DesktopNotificationSettingsSection (cyclomatic 21) src/components/settings/desktop-notification-settings.tsx:93— desktop-notification-settings.DesktopNotificationSettingsSection has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 6 function literals 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.
deep-link-bootstrap.DeepLinkBootstrap (cyclomatic 21) src/components/workspace/deep-link-bootstrap.tsx:20— deep-link-bootstrap.DeepLinkBootstrap has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 58, 36, 90, …). 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.
use-subsession-sync.useSubsessionSync (cyclomatic 21) src/hooks/use-subsession-sync.ts:57— use-subsession-sync.useSubsessionSync has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 133, 79, 103, …). 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.
exit-meaning.argv (cyclomatic 21) src/lib/activity/exit-meaning.ts:209— exit-meaning.argv 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.
delegation-card.codeModeFindKey (cyclomatic 21) src/lib/delegation-card.ts:647— delegation-card.codeModeFindKey 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.
conversation-runtime-store.applyLateToolCallReports (cyclomatic 21) src/stores/conversation-runtime-store.ts:2300— conversation-runtime-store.applyLateToolCallReports has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2329, 2320, 2337). 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.
tab-store.alignConversationTabFolders (cyclomatic 21) src/stores/tab-store.ts:1437— tab-store.alignConversationTabFolders has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong 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.
OpenAlexSearcher._normalise (cyclomatic 20) src-tauri/science/skills/citation-management/scripts/search_openalex.py:170— OpenAlexSearcher._normalise has cyclomatic complexity 20 (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.
paginate._rxiv_parse (cyclomatic 20) src-tauri/science/skills/paper-lookup/scripts/paginate.py:112— paginate._rxiv_parse 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.
canvas-model.computeDropHint (cyclomatic 20) src/components/canvas/canvas-model.ts:421— canvas-model.computeDropHint has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong 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.
conversation-tag-list-editor.ConversationTagListEditor (cyclomatic 20) src/components/conversations/conversation-tag-list-editor.tsx:118— conversation-tag-list-editor.ConversationTagListEditor has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (submitForm, a function literal at line 169, confirmDelete, …). 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.
sidebar-conversation-grouping.reconcileLayout (cyclomatic 20) src/components/conversations/sidebar-conversation-grouping.ts:763— sidebar-conversation-grouping.reconcileLayout 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.
forge-issue-detail-sheet.MergeBox (cyclomatic 20) src/components/forge/forge-issue-detail-sheet.tsx:2172— forge-issue-detail-sheet.MergeBox has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs 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.
background-task-rows.BackgroundTaskRowView (cyclomatic 20) src/components/message/activity/rows/background-task-rows.tsx:86— background-task-rows.BackgroundTaskRowView has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong 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.
kimi-code-config-panel.validateKimiDraft (cyclomatic 20) src/components/settings/kimi-code-config-panel.tsx:378— kimi-code-config-panel.validateKimiDraft 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.
acp-agent-settings.buildGrokStructuredConfig (cyclomatic 20) src/components/settings/acp-agent-settings.tsx:3419— acp-agent-settings.buildGrokStructuredConfig has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 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.
workspace-background-market-dialog.WorkspaceBackgroundMarketDialog (cyclomatic 20) src/components/settings/workspace-background-market-dialog.tsx:175— workspace-background-market-dialog.WorkspaceBackgroundMarketDialog has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
assistant-avatar-picker.AssistantAvatarPicker (cyclomatic 20) src/components/settings/assistant-avatar-picker.tsx:116— assistant-avatar-picker.AssistantAvatarPicker has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (onFile, a function literal at line 315, a function literal at line 238, …). 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.
remote-connection-context.RemoteConnectionGate (cyclomatic 20) src/contexts/remote-connection-context.tsx:127— remote-connection-context.RemoteConnectionGate has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 3 function literals 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.
summarize.retrySignature (cyclomatic 20) src/lib/activity/summarize.ts:30— summarize.retrySignature 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.
browser-device.fitDeviceFrame (cyclomatic 20) src/lib/browser/browser-device.ts:225— browser-device.fitDeviceFrame has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 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.
collab-collapse.rewriteExecutionBlock (cyclomatic 20) src/lib/collab-collapse.ts:62— collab-collapse.rewriteExecutionBlock 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.
permission-request.extractCommandFromUnknownValue (cyclomatic 20) src/lib/permission-request.ts:316— permission-request.extractCommandFromUnknownValue 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.
RemoteDesktopTransport.handleWsEvent (cyclomatic 20) src/lib/transport/remote-desktop-transport.ts:475— RemoteDesktopTransport.handleWsEvent 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.
window-attention.requestWindowAttention (cyclomatic 20) src/lib/window-attention.ts:181— window-attention.requestWindowAttention 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.
canvas-store.useCanvasStore (cyclomatic 20) src/stores/canvas-store.ts:171— canvas-store.useCanvasStore has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 199, 234, 249, …). 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.
check_operationalization.audit (cyclomatic 19) src-tauri/science/skills/hypothesis-generation/scripts/check_operationalization.py:142— check_operationalization.audit 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.
_common.read_csv_records (cyclomatic 19) src-tauri/science/skills/peer-review/scripts/_common.py:117— _common.read_csv_records 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.
validate_claim_evidence.validate_matrix (cyclomatic 19) src-tauri/science/skills/peer-review/scripts/validate_claim_evidence.py:127— validate_claim_evidence.validate_matrix 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.
image_metadata.inspect_svg (cyclomatic 19) src-tauri/science/skills/scientific-visualization/scripts/image_metadata.py:161— image_metadata.inspect_svg 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.
browser-agent-access.BrowserAgentShareControl (cyclomatic 19) src/components/browser/browser-agent-access.tsx:89— browser-agent-access.BrowserAgentShareControl has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
add-node-menu.AddFileSubmenu (cyclomatic 19) src/components/canvas/add-node-menu.tsx:377— add-node-menu.AddFileSubmenu has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
composer-status-strips.useRetryLineText (cyclomatic 19) src/components/chat/composer-status-strips.tsx:82— composer-status-strips.useRetryLineText has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 84). 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.
use-composer-attachments.useComposerAttachments (cyclomatic 19) src/components/chat/composer/use-composer-attachments.ts:211— use-composer-attachments.useComposerAttachments has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 1184, 1223, 1161, …). 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.
use-composer-attachments.useComposerAttachments.uploadPathsToRemote (cyclomatic 19) src/components/chat/composer/use-composer-attachments.ts:773— use-composer-attachments.useComposerAttachments.uploadPathsToRemote has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 791, 775). 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.
conversation-tags-manager.ConversationTagsManagerDialog (cyclomatic 19) src/components/conversations/conversation-tags-manager.tsx:285— conversation-tags-manager.ConversationTagsManagerDialog has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 4 function literals 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.
conversation-manage-dialog.BranchFilterSelect (cyclomatic 19) src/components/conversations/conversation-manage-dialog.tsx:298— conversation-manage-dialog.BranchFilterSelect has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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.
sidebar-conversation-list.SidebarConversationList (cyclomatic 19) src/components/conversations/sidebar-conversation-list.tsx:961— sidebar-conversation-list.SidebarConversationList 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. This shape REPEATS in the file: 2 other methods here (sidebar-conversation-list.SidebarConversationList::folderHeaderElement, sidebar-conversation-list.SidebarConversationList::renderRow) 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.
diff-viewer.DiffViewer (cyclomatic 19) src/components/diff/diff-viewer.tsx:50— diff-viewer.DiffViewer has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 80, 134, 193, …). 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.
forge-combine-dialog.ForgeCombineDialog (cyclomatic 19) src/components/forge/forge-combine-dialog.tsx:67— forge-combine-dialog.ForgeCombineDialog has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (submit, a function literal at line 168, a function literal at line 186, …). 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.
forge-issue-row.ForgeIssueRowItem (cyclomatic 19) src/components/forge/forge-issue-row.tsx:415— forge-issue-row.ForgeIssueRowItem 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.
i18n-provider.AppI18nProvider (cyclomatic 19) src/components/i18n-provider.tsx:96— i18n-provider.AppI18nProvider has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 137, 218, 121, …). 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.
sidebar-section-order-control.SidebarSectionOrderControl (cyclomatic 19) src/components/layout/sidebar-section-order-control.tsx:51— sidebar-section-order-control.SidebarSectionOrderControl has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 107, label, a function literal at line 93, …). 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.
reply-motion.play (cyclomatic 19) src/components/message/reply-motion.tsx:108— reply-motion.play 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.
mcp-row.McpRow (cyclomatic 19) src/components/message/activity/rows/mcp-row.tsx:45— mcp-row.McpRow has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 2 function literals 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.
conversation-message-nav.VirtualRows (cyclomatic 19) src/components/message/conversation-message-nav.tsx:353— conversation-message-nav.VirtualRows has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 385, a function literal at line 411, a function literal at line 409, …). 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.
acp-agent-settings.tomlLinesInsideMultilineString (cyclomatic 19) src/components/settings/acp-agent-settings.tsx:2721— acp-agent-settings.tomlLinesInsideMultilineString 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.
assistants-panel.AssistantRow (cyclomatic 19) src/components/settings/assistants-panel.tsx:532— assistants-panel.AssistantRow has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 2 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.
office-tools-settings.DetectionCard (cyclomatic 19) src/components/settings/office-tools-settings.tsx:89— office-tools-settings.DetectionCard 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.
opencode-connect-dialog.OpenCodeCustomProviderDialog (cyclomatic 19) src/components/settings/opencode-connect-dialog.tsx:484— opencode-connect-dialog.OpenCodeCustomProviderDialog has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 542, a function literal at line 555, handleSubmit, …). 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.
task-message-composer.TaskMessageComposer (cyclomatic 19) src/components/tasks/task-message-composer.tsx:133— task-message-composer.TaskMessageComposer has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 211, 261, 200, …). 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.
command.parseCliExecutionEnvelope (cyclomatic 19) src/lib/activity/command.ts:229— command.parseCliExecutionEnvelope 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.
describe-tool-call.describeCommand (cyclomatic 19) src/lib/activity/describe-tool-call.ts:340— describe-tool-call.describeCommand 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.
host-rules.parseHostRulePattern (cyclomatic 19) src/lib/browser/host-rules.ts:79— host-rules.parseHostRulePattern 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.
code-highlighter.requestHighlight (cyclomatic 19) src/lib/code-highlighter.ts:154— code-highlighter.requestHighlight has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 179, 206, 188). 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.
codeg-mcp-tool.parseCodegMcpToolCall (cyclomatic 19) src/lib/codeg-mcp-tool.ts:429— codeg-mcp-tool.parseCodegMcpToolCall 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.
delegation-card.parseDelegationMeta (cyclomatic 19) src/lib/delegation-card.ts:127— delegation-card.parseDelegationMeta 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.
delegation-card.parseDelegateTaskId (cyclomatic 19) src/lib/delegation-card.ts:1600— delegation-card.parseDelegateTaskId has cyclomatic complexity 19 (threshold 15). Of this number, 18 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.
keyboard-shortcuts.parseShortcut (cyclomatic 19) src/lib/keyboard-shortcuts.ts:316— keyboard-shortcuts.parseShortcut 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.
release-notes.splitBilingualReleaseNotes (cyclomatic 19) src/lib/release-notes.ts:102— release-notes.splitBilingualReleaseNotes 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.
canvas-store.applyChange (cyclomatic 19) src/stores/canvas-store.ts:91— canvas-store.applyChange has cyclomatic complexity 19 (threshold 15). 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, 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.
conversation-runtime-store.cleanAgentOutput (cyclomatic 19) src/stores/conversation-runtime-store.ts:748— conversation-runtime-store.cleanAgentOutput 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.
tab-store.sanitizeDrafts (cyclomatic 19) src/stores/tab-store.ts:789— tab-store.sanitizeDrafts 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.
Cli::parse_from (cyclomatic 18) src-tauri/src/cli/args.rs:51— Cli::parse_from 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.
GeminiParser::parse_jsonl_chat_value (cyclomatic 18) src-tauri/src/parsers/gemini.rs:197— GeminiParser::parse_jsonl_chat_value 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.
jats_to_text.main (cyclomatic 18) src-tauri/science/skills/paper-lookup/scripts/jats_to_text.py:248— jats_to_text.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.
_common._scan_structure (cyclomatic 18) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:128— _common._scan_structure 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.
_common._validate_scale (cyclomatic 18) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:329— _common._validate_scale 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.
summarize_agreement.read_rows (cyclomatic 18) src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:27— summarize_agreement.read_rows 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.
summarize_agreement.summarize (cyclomatic 18) src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:122— summarize_agreement.summarize 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.
evaluate_matrix.load_criteria (cyclomatic 18) src-tauri/science/skills/scientific-brainstorming/scripts/evaluate_matrix.py:70— evaluate_matrix.load_criteria 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.
ScientificSchematicGenerator.review_image (cyclomatic 18) src-tauri/science/skills/scientific-schematics/scripts/generate_schematic_ai.py:373— ScientificSchematicGenerator.review_image 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.
figure_export.save_for_journal (cyclomatic 18) src-tauri/science/skills/scientific-visualization/scripts/figure_export.py:466— figure_export.save_for_journal 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.
assumption_checks.check_regression_diagnostics (cyclomatic 18) src-tauri/science/skills/statistical-analysis/scripts/assumption_checks.py:251— assumption_checks.check_regression_diagnostics 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.
usePetSessions.usePetSessions (cyclomatic 18) src/app/pet/_hooks/usePetSessions.ts:43— usePetSessions.usePetSessions has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 83, 64, 73, …). 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.
automations-page.AutomationDetail (cyclomatic 18) src/components/automations/automations-page.tsx:1078— automations-page.AutomationDetail has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong 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.
browser-bridge-view.BrowserBridgeView (cyclomatic 18) src/components/browser/browser-bridge-view.tsx:59— browser-bridge-view.BrowserBridgeView has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 5 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.
canvas-model.computeRegionMembers (cyclomatic 18) src/components/canvas/canvas-model.ts:233— canvas-model.computeRegionMembers has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 4 function literals inside it that branch. 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.
forge-start-dialog.ForgeStartDialog (cyclomatic 18) src/components/forge/forge-start-dialog.tsx:95— forge-start-dialog.ForgeStartDialog has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (submit, a function literal at line 120, a function literal at line 198, …). 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.
forge-new-issue-dialog.ForgeNewIssueDialog (cyclomatic 18) src/components/forge/forge-new-issue-dialog.tsx:50— forge-new-issue-dialog.ForgeNewIssueDialog has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 5 function literals 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.
git-log-branch-filter-list.GitLogBranchFilterList::renderRow (cyclomatic 18) src/components/layout/git-log-branch-filter-list.tsx:392— git-log-branch-filter-list.GitLogBranchFilterList::renderRow 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.
command-rows.CommandGroupRow (cyclomatic 18) src/components/message/activity/rows/command-rows.tsx:641— command-rows.CommandGroupRow has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
create-project-dialog.CreateProjectDialog (cyclomatic 18) src/components/project-boot/shadcn/create-project-dialog.tsx:52— create-project-dialog.CreateProjectDialog has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
acp-agent-settings.patchCodexConfigTomlText (cyclomatic 18) src/components/settings/acp-agent-settings.tsx:3313— acp-agent-settings.patchCodexConfigTomlText 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.
workspace-background-market-dialog.MarketCard (cyclomatic 18) src/components/settings/workspace-background-market-dialog.tsx:55— workspace-background-market-dialog.MarketCard 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.
computer-settings.BlocklistRow (cyclomatic 18) src/components/settings/computer-settings.tsx:667— computer-settings.BlocklistRow has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (add, a function literal at line 699, a function literal at line 812, …). 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.
provider-models.ModelIdInputWithFetch (cyclomatic 18) src/components/settings/provider-models.tsx:304— provider-models.ModelIdInputWithFetch has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
task-schedule-dialog.TaskScheduleDialog (cyclomatic 18) src/components/tasks/task-schedule-dialog.tsx:77— task-schedule-dialog.TaskScheduleDialog has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 5 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.
app-workspace-context.AppWorkspaceProvider (cyclomatic 18) src/contexts/app-workspace-context.tsx:46— app-workspace-context.AppWorkspaceProvider has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 233, 143, 64, …). 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.
use-open-url-target.useOpenUrlTarget (cyclomatic 18) src/hooks/use-open-url-target.ts:128— use-open-url-target.useOpenUrlTarget has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 137, 200). 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.
types.parseCodexModelConfig (cyclomatic 18) src/lib/types.ts:5861— types.parseCodexModelConfig has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs 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.
codeg-mcp-tool.readTaskAck (cyclomatic 18) src/lib/codeg-mcp-tool.ts:382— codeg-mcp-tool.readTaskAck 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.
permission-request.extractContentText (cyclomatic 18) src/lib/permission-request.ts:566— permission-request.extractContentText 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.
reference-link.destinationEnd (cyclomatic 18) src/lib/reference-link.ts:174— reference-link.destinationEnd 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.
resolve-link-action.resolveLinkAction (cyclomatic 18) src/lib/resolve-link-action.ts:98— resolve-link-action.resolveLinkAction 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.
session-files.parseUnifiedDiffSections (cyclomatic 18) REDACTED:468— session-files.parseUnifiedDiffSections has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong 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.
_tabular.profile_json_structure (cyclomatic 17) src-tauri/science/skills/exploratory-data-analysis/scripts/_tabular.py:404— _tabular.profile_json_structure 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.
select_reporting_guidelines.assess (cyclomatic 17) src-tauri/science/skills/peer-review/scripts/select_reporting_guidelines.py:248— select_reporting_guidelines.assess 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.
page.PushPageInner (cyclomatic 17) src/app/push/page.tsx:26— page.PushPageInner has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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.owns (cyclomatic 17) src/browser-injected/picker.js:660— picker.owns 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.
picker.fitOverlay (cyclomatic 17) src/browser-injected/picker.js:838— picker.fitOverlay has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
picker.scrollableFrom (cyclomatic 17) src/browser-injected/picker.js:1040— picker.scrollableFrom 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.
markdown-local-image.LocalMarkdownImage (cyclomatic 17) src/components/ai-elements/markdown-local-image.tsx:77— markdown-local-image.LocalMarkdownImage has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals 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.
remark-windows-paths.destinationRange (cyclomatic 17) src/components/ai-elements/remark-windows-paths.ts:256— remark-windows-paths.destinationRange 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.
composer-invocations.ComposerInvocationsPopup (cyclomatic 17) REDACTED:297— composer-invocations.ComposerInvocationsPopup has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 365, 324, 322, …). 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.
conversation-context-bar.ConversationHeaderFolderPicker (cyclomatic 17) src/components/chat/conversation-context-bar.tsx:116— conversation-context-bar.ConversationHeaderFolderPicker has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 3 function literals 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.
quick-actions.QuickActions (cyclomatic 17) src/components/chat/quick-actions.tsx:374— quick-actions.QuickActions has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 387, 421, 463, …). 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.
session-settings-picker.SessionSettingsPicker (cyclomatic 17) src/components/chat/session-settings-picker.tsx:64— session-settings-picker.SessionSettingsPicker has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 188, 92, 132, …). 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.
group-split-handle.GroupSplitHandle (cyclomatic 17) src/components/conversations/group-split-handle.tsx:24— group-split-handle.GroupSplitHandle has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 35, 54, 65, …). 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.
file-path-breadcrumb.DirectoryTree (cyclomatic 17) src/components/files/file-path-breadcrumb.tsx:221— file-path-breadcrumb.DirectoryTree has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 241, 297, 267, …). 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.
forge-auto-settings.ForgeAutoActivity (cyclomatic 17) src/components/forge/forge-auto-settings.tsx:595— forge-auto-settings.ForgeAutoActivity has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 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.
branch-selector-list.BranchSelectorList::renderRow (cyclomatic 17) src/components/layout/branch-selector-list.tsx:601— branch-selector-list.BranchSelectorList::renderRow 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.
use-timeline-window.useTimelineWindow.update (cyclomatic 17) src/components/message/activity/use-timeline-window.ts:364— use-timeline-window.useTimelineWindow.update 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.
add-forge-account-dialog.AddForgeAccountDialog (cyclomatic 17) src/components/settings/add-forge-account-dialog.tsx:115— add-forge-account-dialog.AddForgeAccountDialog has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 4 function literals 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.
agent-diagnostics-dialog.AgentDiagnosticsDialog (cyclomatic 17) src/components/settings/agent-diagnostics-dialog.tsx:108— agent-diagnostics-dialog.AgentDiagnosticsDialog has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 4 function items inside it that branch. 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.
required-agent-options.useRequiredOptionsGate.gate (cyclomatic 17) src/components/settings/required-agent-options.tsx:149— required-agent-options.useRequiredOptionsGate.gate 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.
weixin-qrcode-dialog.WeixinQrcodeContent (cyclomatic 17) src/components/settings/weixin-qrcode-dialog.tsx:29— weixin-qrcode-dialog.WeixinQrcodeContent 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 4 function literals inside it that branch (lines 68, 113, 57, …). 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.
generative-ui-settings.GenerativeUiBody (cyclomatic 17) src/components/settings/generative-ui-settings.tsx:40— generative-ui-settings.GenerativeUiBody has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 104, 56, 128, …). 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.
mcp-settings.parseParameterValues (cyclomatic 17) src/components/settings/mcp-settings.tsx:220— mcp-settings.parseParameterValues 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.
acp-connections-context.applyStreamingAction (cyclomatic 17) src/contexts/acp-connections-context.tsx:1719— acp-connections-context.applyStreamingAction has cyclomatic complexity 17 (threshold 15). Of this number, 16 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.
mcp.mcpResultPayload (cyclomatic 17) src/lib/activity/mcp.ts:118— mcp.mcpResultPayload 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.
types.serializeCodexModelConfig (cyclomatic 17) src/lib/types.ts:5903— types.serializeCodexModelConfig has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
canvas-view-storage.parseDraft (cyclomatic 17) src/lib/canvas-view-storage.ts:302— canvas-view-storage.parseDraft 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.
html-preview-inline.parseSrcset (cyclomatic 17) REDACTED:507— html-preview-inline.parseSrcset 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.
codex-visualize.findHtmlFileMentions (cyclomatic 17) src/lib/codex-visualize.ts:241— codex-visualize.findHtmlFileMentions has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong 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.
kimi-mcp-oauth.updateKimiMcpOAuth (cyclomatic 17) src/lib/kimi-mcp-oauth.ts:110— kimi-mcp-oauth.updateKimiMcpOAuth 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.
line-change-stats.countUnifiedDiffLineChanges (cyclomatic 17) src/lib/line-change-stats.ts:172— line-change-stats.countUnifiedDiffLineChanges 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.
live-runs.collectLiveRuns (cyclomatic 17) src/lib/live-runs.ts:98— live-runs.collectLiveRuns 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.
unified-diff-generator.generateUnifiedDiff (cyclomatic 17) src/lib/unified-diff-generator.ts:10— unified-diff-generator.generateUnifiedDiff 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.
conversation-runtime-store.sameBuiltValue (cyclomatic 17) src/stores/conversation-runtime-store.ts:1695— conversation-runtime-store.sameBuiltValue 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.
folder-tabs-store.useFolderTabsStore (cyclomatic 17) src/stores/folder-tabs-store.ts:75— folder-tabs-store.useFolderTabsStore has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 106, 90, 119, …). 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.
IndexService::start_build (cyclomatic 16) src-tauri/src/commands/workspace_file_search/index_cache.rs:902— IndexService::start_build 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.
AutoProcessor::scan_into (cyclomatic 16) src-tauri/src/forge/auto/mod.rs:476— AutoProcessor::scan_into 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.
MetadataExtractor.metadata_to_bibtex (cyclomatic 16) src-tauri/science/skills/citation-management/scripts/extract_metadata.py:344— MetadataExtractor.metadata_to_bibtex 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.
extract_metadata.main (cyclomatic 16) src-tauri/science/skills/citation-management/scripts/extract_metadata.py:657— extract_metadata.main 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.
_common.read_csv_records (cyclomatic 16) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:153— _common.read_csv_records 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.
page.CommitPageInner (cyclomatic 16) src/app/commit/page.tsx:28— page.CommitPageInner has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.MergePageInner (cyclomatic 16) src/app/merge/page.tsx:26— page.MergePageInner has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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.ensureOverlay (cyclomatic 16) src/browser-injected/picker.js:510— picker.ensureOverlay 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.
reference-text.referenceToMarkdown (cyclomatic 16) src/components/chat/composer/reference-text.ts:104— reference-text.referenceToMarkdown 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.
web-connection-guard.WebConnectionGuard (cyclomatic 16) src/components/connection/web-connection-guard.tsx:41— web-connection-guard.WebConnectionGuard has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals 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.
conversation-detail-panel.ConversationDetailPanel::renderTabWrapper (cyclomatic 16) src/components/conversations/conversation-detail-panel.tsx:2992— conversation-detail-panel.ConversationDetailPanel::renderTabWrapper has cyclomatic complexity 16 (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.
sidebar-folder-group-header.SidebarFolderGroupHeader (cyclomatic 16) src/components/conversations/sidebar-folder-group-header.tsx:63— sidebar-folder-group-header.SidebarFolderGroupHeader has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
unified-diff-preview.classifyRows (cyclomatic 16) src/components/diff/unified-diff-preview.tsx:177— unified-diff-preview.classifyRows 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.
file-workspace-tab-bar.FileWorkspaceTabBar (cyclomatic 16) src/components/files/file-workspace-tab-bar.tsx:61— file-workspace-tab-bar.FileWorkspaceTabBar has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function literals 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.
pattern-list-input.PatternListInput (cyclomatic 16) src/components/forge/pattern-list-input.tsx:25— pattern-list-input.PatternListInput 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 4 function items inside it that branch (a function literal at line 125, commit, a function literal at line 104, …). 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.
aux-panel-file-tree-tab.buildDirectoryGitTree (cyclomatic 16) src/components/layout/aux-panel-file-tree-tab.tsx:376— aux-panel-file-tree-tab.buildDirectoryGitTree has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
commit-untracked-files-dialog.CommitUntrackedFilesDialog (cyclomatic 16) src/components/layout/commit-untracked-files-dialog.tsx:37— commit-untracked-files-dialog.CommitUntrackedFilesDialog has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 5 function literals 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.
edit-row.EditDiff (cyclomatic 16) src/components/message/activity/rows/edit-row.tsx:175— edit-row.EditDiff has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 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.
file-reference-actions.FileReferenceActionsMenu (cyclomatic 16) src/components/message/file-reference-actions.tsx:108— file-reference-actions.FileReferenceActionsMenu 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 6 function items inside it that branch (a function literal at line 152, handleDownload, a function literal at line 123, …). 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.
conversation-message-nav.MessageNavRow (cyclomatic 16) src/components/message/conversation-message-nav.tsx:730— conversation-message-nav.MessageNavRow 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.
custom-agent-skills-toggle.CustomAgentSkillsToggle (cyclomatic 16) src/components/settings/custom-agent-skills-toggle.tsx:40— custom-agent-skills-toggle.CustomAgentSkillsToggle 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 3 function literals inside it that branch (lines 100, 80, 56). 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.
terminal-tab-bar.TerminalTabBar (cyclomatic 16) src/components/terminal/terminal-tab-bar.tsx:38— terminal-tab-bar.TerminalTabBar 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 5 function items inside it that branch (a function literal at line 112, commitRename, a function literal at line 88, …). 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.
deep-link-bootstrap.PetFocusBridge (cyclomatic 16) src/components/workspace/deep-link-bootstrap.tsx:135— deep-link-bootstrap.PetFocusBridge has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 160, 173, 232, …). 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.
acp-connections-context.mergePermissionToolCallWithLiveInfo (cyclomatic 16) src/contexts/acp-connections-context.tsx:1323— acp-connections-context.mergePermissionToolCallWithLiveInfo 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.
use-file-tree.useFileTree (cyclomatic 16) src/hooks/use-file-tree.ts:39— use-file-tree.useFileTree has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 85, 64). 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.
exit-meaning.gitAnswer (cyclomatic 16) src/lib/activity/exit-meaning.ts:407— exit-meaning.gitAnswer 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.
exit-meaning.readCommandExit (cyclomatic 16) src/lib/activity/exit-meaning.ts:482— exit-meaning.readCommandExit has cyclomatic complexity 16 (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.
code-mode.codeModeCalls (cyclomatic 16) src/lib/activity/code-mode.ts:86— code-mode.codeModeCalls 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.
describe-tool-call.describeMonitor (cyclomatic 16) src/lib/activity/describe-tool-call.ts:433— describe-tool-call.describeMonitor 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.
ai-elements-adapter.expandGoalUpdateText (cyclomatic 16) src/lib/adapters/ai-elements-adapter.ts:835— ai-elements-adapter.expandGoalUpdateText has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong 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.
background-task.buildBackgroundTaskRows (cyclomatic 16) REDACTED:708— background-task.buildBackgroundTaskRows 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 2 function items inside it that branch (a function literal at line 759, record). 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.
browser-agent-grant.applyDefaultAgentGrant (cyclomatic 16) src/lib/browser/browser-agent-grant.ts:129— browser-agent-grant.applyDefaultAgentGrant 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.
delegation-status.findTaskIds (cyclomatic 16) src/lib/delegation-status.ts:321— delegation-status.findTaskIds has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
desktop-notification.notifyDesktop (cyclomatic 16) src/lib/desktop-notification.ts:119— desktop-notification.notifyDesktop 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.
export-conversation.blocksToHtml (cyclomatic 16) src/lib/export-conversation.ts:234— export-conversation.blocksToHtml has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 236). 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.
model-api-rates.resolveRate (cyclomatic 16) src/lib/model-api-rates.ts:227— model-api-rates.resolveRate 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.
permission-request.buildDiffPreviewFromChanges (cyclomatic 16) src/lib/permission-request.ts:211— permission-request.buildDiffPreviewFromChanges has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
update-check-storage.readLastCheck (cyclomatic 16) src/lib/update-check-storage.ts:50— update-check-storage.readLastCheck 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.
updater.normalizeAppUpdateError (cyclomatic 16) src/lib/updater.ts:523— updater.normalizeAppUpdateError has cyclomatic complexity 16 (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.
codegConsoleShim (cyclomatic 16) src/browser-injected/console.js:36— codegConsoleShim 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.
XxxComment src-tauri/src/acp/registry.rs:2332— // (xxx) **CLI 2.1.299 and 2.1.300.** What reaches codeg: — 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.
acp-agent-settings.AcpAgentSettings (cognitive 971) src/components/settings/acp-agent-settings.tsx:4973— acp-agent-settings.AcpAgentSettings has cognitive complexity 971 (threshold 15). Drivers by points: ternaries 226 (1267 pts), if/else 243 (521 pts), boolean chains 217, error handling 28 (73 pts), loops 8 (11 pts) (nesting depth added 1367). 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. This shape REPEATS in the file: one other method here (acp-agent-settings.AcpAgentSettings::renderFixButton) 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.
acp-connections-context.AcpConnectionsProvider (cognitive 610) src/contexts/acp-connections-context.tsx:3902— acp-connections-context.AcpConnectionsProvider has cognitive complexity 610 (threshold 15). Drivers by points: if/else 252 (384 pts), boolean chains 71, ternaries 30 (64 pts), loops 44 (62 pts), error handling 18 (25 pts), match/switch 3 (4 pts) (nesting depth added 192). None of this is in the body itself: all 610 points belong to 98 function literals inside it that branch (lines 5279, 7316, 4344, …). 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.
workspace-context.WorkspaceProvider (cognitive 538) src/contexts/workspace-context.tsx:635— workspace-context.WorkspaceProvider has cognitive complexity 538 (threshold 15). Drivers by points: if/else 233 (308 pts), ternaries 81 (106 pts), boolean chains 88, error handling 15 (22 pts), loops 14 (nesting depth added 107). Most of this is not in the body itself: 6 of the 538 points are its own statements and the rest belongs to 128 function literals inside it that branch (lines 2364, 2668, 1126, …). 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.
tab-store.useTabStore (cognitive 378) src/stores/tab-store.ts:1640— tab-store.useTabStore has cognitive complexity 378 (threshold 15). Drivers by points: if/else 160 (224 pts), ternaries 42 (68 pts), boolean chains 64, loops 13 (16 pts), error handling 4 (6 pts) (nesting depth added 95). None of this is in the body itself: all 378 points belong to 74 function literals inside it that branch (lines 1757, 2257, 2407, …). 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.
aux-panel-file-tree-tab.FileTreeTab (cognitive 345) src/components/layout/aux-panel-file-tree-tab.tsx:1136— aux-panel-file-tree-tab.FileTreeTab has cognitive complexity 345 (threshold 15). Drivers by points: if/else 147 (185 pts), ternaries 44 (71 pts), boolean chains 41, loops 25 (33 pts), error handling 13 (14 pts), match/switch 1 (nesting depth added 74). Of this number, 51 points are the body's own statements and 294 belong to 83 function literals 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.
acp-connections-context.connectionsReducer (cognitive 308) src/contexts/acp-connections-context.tsx:1982— acp-connections-context.connectionsReducer has cognitive complexity 308 (threshold 15). Drivers by points: if/else 110 (228 pts), ternaries 15 (37 pts), boolean chains 33, loops 4 (9 pts), match/switch 1 (nesting depth added 145). Of this number, 305 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
message-input.MessageInput (cognitive 293) REDACTED:332— message-input.MessageInput has cognitive complexity 293 (threshold 15). Drivers by points: if/else 145 (165 pts), boolean chains 68, ternaries 34 (57 pts), error handling 3 (nesting depth added 43). Of this number, 54 points are the body's own statements and 239 belong to 60 function literals 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.
canvas-view.CanvasFlow (cognitive 278) src/components/canvas/canvas-view.tsx:192— canvas-view.CanvasFlow has cognitive complexity 278 (threshold 15). Drivers by points: if/else 114 (152 pts), boolean chains 51, ternaries 38 (47 pts), loops 18 (19 pts), error handling 9 (nesting depth added 48). Most of this is not in the body itself: 13 of the 278 points are its own statements and the rest belongs to 82 function literals inside it that branch (lines 1914, 1229, 1769, …). 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.
forge-page.ForgePage (cognitive 239) src/components/forge/forge-page.tsx:630— forge-page.ForgePage has cognitive complexity 239 (threshold 15). Drivers by points: ternaries 55 (113 pts), if/else 63 (73 pts), boolean chains 42, loops 7, error handling 4 (nesting depth added 68). Of this number, 98 points are the body's own statements and 141 belong to 47 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.
task-detail-sheet.TaskDetailSheet (cognitive 238) src/components/tasks/task-detail-sheet.tsx:219— task-detail-sheet.TaskDetailSheet has cognitive complexity 238 (threshold 15). Drivers by points: ternaries 71 (137 pts), if/else 36 (53 pts), boolean chains 42, error handling 3, match/switch 1 (3 pts) (nesting depth added 85). Of this number, 186 points are the body's own statements and 52 belong to 21 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.
conversation-detail-panel.ConversationTabView (cognitive 205) src/components/conversations/conversation-detail-panel.tsx:271— conversation-detail-panel.ConversationTabView has cognitive complexity 205 (threshold 15). Drivers by points: if/else 83 (89 pts), ternaries 39 (61 pts), boolean chains 48, error handling 5, loops 1, match/switch 1 (nesting depth added 28). Of this number, 74 points are the body's own statements and 131 belong to 51 function literals 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.
mcp-settings.McpSettings (cognitive 202) src/components/settings/mcp-settings.tsx:412— mcp-settings.McpSettings has cognitive complexity 202 (threshold 15). Drivers by points: ternaries 52 (138 pts), if/else 35 (39 pts), boolean chains 15, error handling 9 (10 pts) (nesting depth added 91). Of this number, 103 points are the body's own statements and 99 belong to 27 function literals inside it that branch. 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.
conversation-runtime-store.buildStreamingTurnsFromLiveMessage (cognitive 200) src/stores/conversation-runtime-store.ts:1138— conversation-runtime-store.buildStreamingTurnsFromLiveMessage has cognitive complexity 200 (threshold 15). Drivers by points: if/else 37 (116 pts), ternaries 16 (55 pts), boolean chains 18, loops 5 (9 pts), match/switch 1 (2 pts) (nesting depth added 123). Of this number, 189 points are the body's own statements and 11 belong to 3 function items inside it that branch. 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.
ClaudeRecordAccumulator::feed_value (cognitive 197) src-tauri/src/parsers/claude.rs:2020— ClaudeRecordAccumulator::feed_value has cognitive complexity 197 (threshold 15). Drivers by points: if/else 66 (166 pts), loops 3 (13 pts), match/switch 5 (12 pts), boolean chains 6 (nesting depth added 117). 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.
aux-panel-git-changes-tab.GitChangesTab (cognitive 184) src/components/layout/aux-panel-git-changes-tab.tsx:505— aux-panel-git-changes-tab.GitChangesTab has cognitive complexity 184 (threshold 15). Drivers by points: if/else 58 (66 pts), ternaries 32 (59 pts), boolean chains 44, loops 7 (9 pts), error handling 6 (nesting depth added 37). Of this number, 66 points are the body's own statements and 118 belong to 43 function literals 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.
file-workspace-panel.FileWorkspacePanelBody (cognitive 183) src/components/files/file-workspace-panel.tsx:779— file-workspace-panel.FileWorkspacePanelBody has cognitive complexity 183 (threshold 15). Drivers by points: if/else 68 (73 pts), ternaries 29 (54 pts), boolean chains 53, loops 2 (3 pts) (nesting depth added 31). Of this number, 88 points are the body's own statements and 95 belong to 44 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.
conversation-runtime-store.reducer (cognitive 176) src/stores/conversation-runtime-store.ts:2363— conversation-runtime-store.reducer has cognitive complexity 176 (threshold 15). Drivers by points: if/else 43 (92 pts), ternaries 19 (41 pts), boolean chains 33, loops 4 (9 pts), match/switch 1 (nesting depth added 76). Of this number, 151 points are the body's own statements and 25 belong to 6 function items inside it that branch. 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.
aux-panel-git-log-tab.GitLogTab (cognitive 167) src/components/layout/aux-panel-git-log-tab.tsx:1295— aux-panel-git-log-tab.GitLogTab has cognitive complexity 167 (threshold 15). Drivers by points: if/else 58 (72 pts), ternaries 18 (55 pts), boolean chains 32, error handling 8 (nesting depth added 51). Of this number, 24 points are the body's own statements and 143 belong to 31 function literals 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.
terminal-view.TerminalView (cognitive 167) src/components/terminal/terminal-view.tsx:118— terminal-view.TerminalView has cognitive complexity 167 (threshold 15). Drivers by points: if/else 82 (105 pts), boolean chains 43, ternaries 11 (15 pts), error handling 1 (2 pts), loops 2 (nesting depth added 28). Most of this is not in the body itself: 9 of the 167 points are its own statements and the rest belongs to 40 function items inside it that branch (a function literal at line 284, a function literal at line 353, a function literal at line 654, …). 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.
pi-config-panel.PiConfigPanel (cognitive 158) src/components/settings/pi-config-panel.tsx:306— pi-config-panel.PiConfigPanel has cognitive complexity 158 (threshold 15). Drivers by points: boolean chains 73, ternaries 34 (45 pts), if/else 28 (30 pts), error handling 8, loops 1 (2 pts) (nesting depth added 14). Of this number, 85 points are the body's own statements and 73 belong to 29 function literals 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.
ai-elements-adapter.adaptMessageTurn (cognitive 150) src/lib/adapters/ai-elements-adapter.ts:2452— ai-elements-adapter.adaptMessageTurn has cognitive complexity 150 (threshold 15). Drivers by points: ternaries 21 (76 pts), if/else 20 (54 pts), boolean chains 19, loops 1 (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
workspace-upload-dialog.WorkspaceUploadDialog (cognitive 145) src/components/layout/workspace-upload-dialog.tsx:153— workspace-upload-dialog.WorkspaceUploadDialog has cognitive complexity 145 (threshold 15). Drivers by points: if/else 47 (59 pts), ternaries 21 (39 pts), boolean chains 31, error handling 3 (8 pts), loops 3 (6 pts), match/switch 2 (nesting depth added 38). Of this number, 21 points are the body's own statements and 124 belong to 44 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.
skills-settings.SkillsSettings (cognitive 138) src/components/settings/skills-settings.tsx:166— skills-settings.SkillsSettings has cognitive complexity 138 (threshold 15). Drivers by points: ternaries 27 (64 pts), if/else 30 (34 pts), boolean chains 33, error handling 6, loops 1 (nesting depth added 41). Of this number, 79 points are the body's own statements and 59 belong to 29 function literals 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.
import-sessions-window.ImportSessionsWindow (cognitive 134) src/components/import-sessions/import-sessions-window.tsx:85— import-sessions-window.ImportSessionsWindow has cognitive complexity 134 (threshold 15). Drivers by points: if/else 40 (69 pts), loops 16 (24 pts), boolean chains 21, ternaries 13 (18 pts), error handling 2 (nesting depth added 42). Of this number, 31 points are the body's own statements and 103 belong to 24 function literals 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.
LarkBackend::start_ws_receiver (cognitive 128) src-tauri/src/chat_channel/backends/lark.rs:257— LarkBackend::start_ws_receiver has cognitive complexity 128 (threshold 15). Drivers by points: if/else 16 (91 pts), match/switch 8 (24 pts), loops 3 (12 pts), boolean chains 1 (nesting depth added 100). 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.
cursor-config-panel.CursorConfigPanel (cognitive 128) src/components/settings/cursor-config-panel.tsx:333— cursor-config-panel.CursorConfigPanel has cognitive complexity 128 (threshold 15). Drivers by points: ternaries 47 (86 pts), boolean chains 21, if/else 14 (15 pts), error handling 6 (nesting depth added 40). Of this number, 82 points are the body's own statements and 46 belong to 15 function literals 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.
message-list-view.MessageListView (cognitive 124) src/components/message/message-list-view.tsx:1525— message-list-view.MessageListView has cognitive complexity 124 (threshold 15). Drivers by points: if/else 32 (47 pts), ternaries 32 (37 pts), boolean chains 32, loops 7, match/switch 1 (nesting depth added 20). Of this number, 37 points are the body's own statements and 87 belong to 23 function literals 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.
validate_register.validate_register (cognitive 117) src-tauri/science/skills/scientific-brainstorming/scripts/validate_register.py:164— validate_register.validate_register has cognitive complexity 117 (threshold 15). Drivers by points: if/else 40 (86 pts), loops 10 (17 pts), boolean chains 7, error handling 2 (7 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tasks-page.TasksPage (cognitive 116) src/components/tasks/tasks-page.tsx:116— tasks-page.TasksPage has cognitive complexity 116 (threshold 15). Drivers by points: ternaries 18 (61 pts), if/else 16 (26 pts), boolean chains 25, error handling 1 (2 pts), loops 2 (nesting depth added 54). Of this number, 25 points are the body's own statements and 91 belong to 22 function items inside it that branch. 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.
update-provider.UpdateProvider (cognitive 114) src/components/providers/update-provider.tsx:181— update-provider.UpdateProvider has cognitive complexity 114 (threshold 15). Drivers by points: if/else 59 (72 pts), boolean chains 20, error handling 11 (15 pts), loops 4 (6 pts), ternaries 1 (nesting depth added 19). Most of this is not in the body itself: 4 of the 114 points are its own statements and the rest belongs to 24 function literals inside it that branch (lines 734, 544, 856, …). 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.
token-usage-page.TokenUsagePage (cognitive 114) src/components/token-usage/token-usage-page.tsx:328— token-usage-page.TokenUsagePage has cognitive complexity 114 (threshold 15). Drivers by points: boolean chains 42, if/else 34 (38 pts), ternaries 26 (31 pts), error handling 3 (nesting depth added 9). Of this number, 45 points are the body's own statements and 69 belong to 26 function literals 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.
config-sync-settings.ConfigSyncSettings (cognitive 113) src/components/settings/config-sync-settings.tsx:140— config-sync-settings.ConfigSyncSettings has cognitive complexity 113 (threshold 15). Drivers by points: if/else 41 (45 pts), ternaries 27 (44 pts), error handling 13, boolean chains 11 (nesting depth added 21). Of this number, 48 points are the body's own statements and 65 belong to 22 function literals 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.
agent-row.AgentRow (cognitive 112) src/components/message/activity/rows/agent-row.tsx:47— agent-row.AgentRow has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 40 (73 pts), boolean chains 26, if/else 8 (13 pts) (nesting depth added 38). Of this number, 71 points are the body's own statements and 41 belong to 4 function literals 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.
task-deliver-pr-dialog.TaskDeliverPrDialog (cognitive 112) src/components/tasks/task-deliver-pr-dialog.tsx:90— task-deliver-pr-dialog.TaskDeliverPrDialog has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 48 (113 pts), boolean chains 21, if/else 7 (9 pts), error handling 1 (nesting depth added 67). 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. This shape REPEATS in the file: one other method here (task-deliver-pr-dialog.TaskDeliverPrDialog::submit) 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.
TelegramBackend::start (cognitive 109) src-tauri/src/chat_channel/backends/telegram.rs:204— TelegramBackend::start has cognitive complexity 109 (threshold 15). Drivers by points: if/else 21 (99 pts), loops 2 (6 pts), match/switch 2 (4 pts) (nesting depth added 84). 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.
codex-model-list-editor.CodexModelListEditor (cognitive 108) src/components/settings/codex-model-list-editor.tsx:246— codex-model-list-editor.CodexModelListEditor has cognitive complexity 108 (threshold 15). Drivers by points: ternaries 36 (50 pts), boolean chains 39, if/else 11 (13 pts), loops 4 (6 pts) (nesting depth added 18). Of this number, 49 points are the body's own statements and 59 belong to 24 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.
exit-meaning.splitCommandLine (cognitive 107) src/lib/activity/exit-meaning.ts:78— exit-meaning.splitCommandLine has cognitive complexity 107 (threshold 15). Drivers by points: if/else 35 (86 pts), boolean chains 16, loops 2 (4 pts), ternaries 1 (nesting depth added 53). Of this number, 104 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
conversation-runtime-store.useConversationRuntimeStore (cognitive 104) src/stores/conversation-runtime-store.ts:4418— conversation-runtime-store.useConversationRuntimeStore has cognitive complexity 104 (threshold 15). Drivers by points: if/else 59 (69 pts), boolean chains 32, loops 3 (nesting depth added 10). None of this is in the body itself: all 104 points belong to 31 function items inside it that branch (loadOlderTurnsThrough, syncTurnMetadata::trySync, a function literal at line 4744, …). 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.
_common.validate_rubric (cognitive 103) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:393— _common.validate_rubric has cognitive complexity 103 (threshold 15). Drivers by points: if/else 37 (77 pts), loops 6 (14 pts), boolean chains 9, ternaries 2 (3 pts) (nesting depth added 49). 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.
commit-dialog.CommitWorkspace (cognitive 101) src/components/layout/commit-dialog.tsx:240— commit-dialog.CommitWorkspace has cognitive complexity 101 (threshold 15). Drivers by points: if/else 37 (39 pts), boolean chains 28, ternaries 19 (23 pts), error handling 10 (11 pts) (nesting depth added 7). Of this number, 29 points are the body's own statements and 72 belong to 29 function literals 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.
command-manage-dialog.CommandManageDialog (cognitive 94) src/components/layout/command-manage-dialog.tsx:202— command-manage-dialog.CommandManageDialog has cognitive complexity 94 (threshold 15). Drivers by points: if/else 33 (47 pts), ternaries 17 (33 pts), boolean chains 10, error handling 4 (nesting depth added 30). Of this number, 18 points are the body's own statements and 76 belong to 22 function literals 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.
workspace-chrome-controller.WorkspaceChromeController (cognitive 94) src/components/layout/workspace-chrome-controller.tsx:53— workspace-chrome-controller.WorkspaceChromeController has cognitive complexity 94 (threshold 15). Drivers by points: if/else 44 (74 pts), ternaries 5 (13 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 39). None of this is in the body itself: all 94 points belong to 6 function literals inside it that branch (lines 211, 135, 99, …). 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.
delegation-card.templateLiteralTextEnd (cognitive 93) src/lib/delegation-card.ts:785— delegation-card.templateLiteralTextEnd has cognitive complexity 93 (threshold 15). Drivers by points: if/else 36 (84 pts), loops 2 (6 pts), boolean chains 3 (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.
conversation-manage-dialog.ConversationManageDialog (cognitive 92) src/components/conversations/conversation-manage-dialog.tsx:517— conversation-manage-dialog.ConversationManageDialog has cognitive complexity 92 (threshold 15). Drivers by points: ternaries 17 (47 pts), if/else 18 (21 pts), boolean chains 10, loops 7 (10 pts), error handling 3, match/switch 1 (nesting depth added 36). Of this number, 22 points are the body's own statements and 70 belong to 20 function literals 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.
forge-issue-detail-sheet.ForgeIssueDetailSheet (cognitive 89) src/components/forge/forge-issue-detail-sheet.tsx:2506— forge-issue-detail-sheet.ForgeIssueDetailSheet has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 34 (52 pts), if/else 17 (18 pts), boolean chains 16, error handling 3 (nesting depth added 19). Of this number, 64 points are the body's own statements and 25 belong to 10 function literals 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.
custom-skills-settings.CustomSkillsBody (cognitive 89) src/components/settings/custom-skills-settings.tsx:134— custom-skills-settings.CustomSkillsBody has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 17 (32 pts), if/else 26 (29 pts), boolean chains 15, error handling 9 (10 pts), loops 2, match/switch 1 (nesting depth added 19). Of this number, 27 points are the body's own statements and 62 belong to 21 function literals 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.
backup-settings.BackupSettings (cognitive 88) src/components/settings/backup-settings.tsx:118— backup-settings.BackupSettings has cognitive complexity 88 (threshold 15). Drivers by points: boolean chains 40, if/else 26 (29 pts), error handling 10, ternaries 7 (9 pts) (nesting depth added 5). Of this number, 39 points are the body's own statements and 49 belong to 21 function literals inside it that branch. 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.
system-network-settings.SystemNetworkSettings (cognitive 88) src/components/settings/system-network-settings.tsx:108— system-network-settings.SystemNetworkSettings has cognitive complexity 88 (threshold 15). Drivers by points: ternaries 20 (33 pts), boolean chains 31, if/else 20, error handling 4 (nesting depth added 13). Of this number, 54 points are the body's own statements and 34 belong to 16 function literals 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.
delegation-card.codeModeCallSite (cognitive 88) src/lib/delegation-card.ts:429— delegation-card.codeModeCallSite has cognitive complexity 88 (threshold 15). Drivers by points: if/else 26 (65 pts), boolean chains 16, loops 2 (4 pts), ternaries 1 (3 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.
workspace-folder-dialog.WorkspaceFolderDialog (cognitive 87) src/components/layout/workspace-folder-dialog.tsx:98— workspace-folder-dialog.WorkspaceFolderDialog has cognitive complexity 87 (threshold 15). Drivers by points: ternaries 28 (45 pts), if/else 18 (19 pts), boolean chains 15, error handling 7, loops 1 (nesting depth added 18). Of this number, 42 points are the body's own statements and 45 belong to 19 function literals 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.
grep-no-match.pipelineStages (cognitive 86) src/lib/grep-no-match.ts:179— grep-no-match.pipelineStages has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (67 pts), boolean chains 13, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 44). Of this number, 81 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.
three-pane-merge-editor.ThreePaneMergeEditor (cognitive 85) src/components/merge/three-pane-merge-editor.tsx:53— three-pane-merge-editor.ThreePaneMergeEditor has cognitive complexity 85 (threshold 15). Drivers by points: if/else 32 (50 pts), ternaries 6 (14 pts), boolean chains 13, loops 8 (nesting depth added 26). Most of this is not in the body itself: 4 of the 85 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 251, 181, 216, …). 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.
unified-diff-preview.parseUnifiedDiff (cognitive 84) src/components/diff/unified-diff-preview.tsx:271— unified-diff-preview.parseUnifiedDiff has cognitive complexity 84 (threshold 15). Drivers by points: if/else 32 (73 pts), boolean chains 10, loops 1 (nesting depth added 41). Of this number, 79 points are the body's own statements and 5 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.
use-open-file-tabs-watch.useOpenFileTabsWatch (cognitive 84) src/hooks/use-open-file-tabs-watch.ts:185— use-open-file-tabs-watch.useOpenFileTabsWatch has cognitive complexity 84 (threshold 15). Drivers by points: if/else 44 (65 pts), boolean chains 13, loops 5 (6 pts) (nesting depth added 22). None of this is in the body itself: all 84 points belong to 14 function literals inside it that branch (lines 238, 426, 206, …). 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.
chat-html-markdown.createChatHtmlProcessor.<returned closure> (cognitive 84) REDACTED:197— chat-html-markdown.createChatHtmlProcessor.<returned closure> has cognitive complexity 84 (threshold 15). Drivers by points: if/else 23 (44 pts), boolean chains 24, loops 5 (12 pts), ternaries 2 (4 pts) (nesting depth added 30). Of this number, 77 points are the body's own statements and 7 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.
commit-message-settings-dialog.CommitMessageSettingsBody (cognitive 83) src/components/layout/commit-message-settings-dialog.tsx:161— commit-message-settings-dialog.CommitMessageSettingsBody has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 30 (49 pts), boolean chains 18, if/else 14 (15 pts), error handling 1 (nesting depth added 20). Of this number, 41 points are the body's own statements and 42 belong to 12 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.
suggestion-popup.SuggestionPopup (cognitive 81) src/components/chat/composer/suggestion/suggestion-popup.tsx:147— suggestion-popup.SuggestionPopup has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 24 (30 pts), if/else 19 (27 pts), boolean chains 20, loops 1 (3 pts), match/switch 1 (nesting depth added 16). Of this number, 26 points are the body's own statements and 55 belong to 16 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.
appearance-provider.AppearanceProvider (cognitive 80) src/components/appearance-provider.tsx:399— appearance-provider.AppearanceProvider has cognitive complexity 80 (threshold 15). Drivers by points: if/else 44 (46 pts), ternaries 19 (20 pts), boolean chains 9, error handling 5 (nesting depth added 3). Most of this is not in the body itself: 1 of the 80 points is its own statement and the rest belongs to 30 function literals inside it that branch (lines 1039, 894, 943, …). 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.
browser-surface-host.NativeSurfaceHost (cognitive 79) src/components/browser/browser-surface-host.tsx:200— browser-surface-host.NativeSurfaceHost has cognitive complexity 79 (threshold 15). Drivers by points: if/else 33 (52 pts), boolean chains 21, ternaries 5 (6 pts) (nesting depth added 20). Of this number, 22 points are the body's own statements and 57 belong to 12 function literals 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.
SessionState::apply_event_inner (cognitive 78) src-tauri/src/acp/session_state.rs:1206— SessionState::apply_event_inner has cognitive complexity 78 (threshold 15). Drivers by points: if/else 28 (61 pts), loops 3 (7 pts), match/switch 3 (6 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.
export_plan.validate_against_plan (cognitive 75) src-tauri/science/skills/scientific-visualization/scripts/export_plan.py:153— export_plan.validate_against_plan has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 16 (38 pts), if/else 21 (24 pts), boolean chains 10, loops 1 (2 pts), error handling 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.
qoder-config-panel.QoderConfigPanel (cognitive 75) src/components/settings/qoder-config-panel.tsx:94— qoder-config-panel.QoderConfigPanel has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 26 (47 pts), if/else 11 (13 pts), boolean chains 11, error handling 4 (nesting depth added 23). Of this number, 54 points are the body's own statements and 21 belong to 5 function literals 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.
directory-browser.DirectoryBrowser (cognitive 75) src/components/shared/directory-browser.tsx:138— directory-browser.DirectoryBrowser has cognitive complexity 75 (threshold 15). Drivers by points: if/else 34 (39 pts), boolean chains 22, ternaries 8 (10 pts), error handling 4 (nesting depth added 7). Most of this is not in the body itself: 5 of the 75 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 473, a function literal at line 302, a function literal at line 398, …). 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.
layout.FolderWorkspaceShell (cognitive 74) src/app/workspace/layout.tsx:779— layout.FolderWorkspaceShell has cognitive complexity 74 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 22, ternaries 20, error handling 2 (nesting depth added 5). Of this number, 19 points are the body's own statements and 55 belong to 11 function literals 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.
canvas-model.deriveFlowGraph (cognitive 73) src/components/canvas/canvas-model.ts:891— canvas-model.deriveFlowGraph has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 18 (47 pts), if/else 7 (14 pts), boolean chains 7, loops 3 (5 pts) (nesting depth added 38). Of this number, 70 points are the body's own statements and 3 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.
actJson (cognitive 73) REDACTED:526— actJson has cognitive complexity 73 (threshold 15). Drivers by points: loops 23 (26 pts), ternaries 12 (21 pts), if/else 10 (16 pts), boolean chains 9, other 1 (nesting depth added 18). Of this number, 69 points are the body's own statements and 4 belong to 13 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.
agent-selector.AgentSelector (cognitive 72) src/components/chat/agent-selector.tsx:71— agent-selector.AgentSelector has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (27 pts), boolean chains 21, ternaries 17 (21 pts), loops 3 (nesting depth added 7). Most of this is not in the body itself: 8 of the 72 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 165, 376, 131, …). 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.
app-workspace-store.useAppWorkspaceStore (cognitive 72) src/stores/app-workspace-store.ts:328— app-workspace-store.useAppWorkspaceStore has cognitive complexity 72 (threshold 15). Drivers by points: if/else 40 (49 pts), ternaries 8 (9 pts), error handling 7, boolean chains 5, loops 2 (nesting depth added 10). None of this is in the body itself: all 72 points belong to 29 function literals inside it that branch (lines 665, 344, 822, …). 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.
add-custom-agent-dialog.AddCustomAgentDialog (cognitive 70) src/components/settings/add-custom-agent-dialog.tsx:227— add-custom-agent-dialog.AddCustomAgentDialog has cognitive complexity 70 (threshold 15). Drivers by points: boolean chains 32, ternaries 18 (22 pts), if/else 13, error handling 3 (nesting depth added 4). Of this number, 30 points are the body's own statements and 40 belong to 17 function literals 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.
pdf-viewer.PdfViewer (cognitive 69) src/components/files/pdf-viewer.tsx:104— pdf-viewer.PdfViewer has cognitive complexity 69 (threshold 15). Drivers by points: if/else 33, boolean chains 24, ternaries 8 (12 pts) (nesting depth added 4). Of this number, 25 points are the body's own statements and 44 belong to 21 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.
live-tool-output.isJsonContainerPrefix (cognitive 69) src/lib/live-tool-output.ts:29— live-tool-output.isJsonContainerPrefix has cognitive complexity 69 (threshold 15). Drivers by points: if/else 23 (51 pts), boolean chains 13, loops 2 (4 pts), ternaries 1 (nesting depth added 30). Of this number, 68 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.
opencode-permissions.globCovers (cognitive 68) src/lib/opencode-permissions.ts:445— opencode-permissions.globCovers has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (45 pts), loops 11 (19 pts), boolean chains 4 (nesting depth added 34). Of this number, 50 points are the body's own statements and 18 belong to 4 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.
branch-dropdown.BranchDropdown (cognitive 67) src/components/layout/branch-dropdown.tsx:136— branch-dropdown.BranchDropdown has cognitive complexity 67 (threshold 15). Drivers by points: if/else 35 (41 pts), boolean chains 10, ternaries 8 (10 pts), match/switch 4, error handling 1, loops 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 67 points are its own statements and the rest belongs to 27 function items inside it that branch (runLeafAction, a function literal at line 299, handleConfirm, …). 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.
git-credential-context.GitCredentialProvider (cognitive 66) src/contexts/git-credential-context.tsx:174— git-credential-context.GitCredentialProvider has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 13 (19 pts), boolean chains 10, error handling 5 (7 pts), loops 1 (2 pts) (nesting depth added 22). Of this number, 19 points are the body's own statements and 47 belong to 10 function literals 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.
use-session-feedback.useSessionFeedback (cognitive 66) src/hooks/use-session-feedback.ts:130— use-session-feedback.useSessionFeedback has cognitive complexity 66 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 20, ternaries 9 (13 pts), loops 1 (2 pts), error handling 1, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 8 of the 66 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 375, 272, 212, …). 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.
ConnectionManager::send_prompt_linked_full (cognitive 65) src-tauri/src/acp/manager.rs:1511— ConnectionManager::send_prompt_linked_full has cognitive complexity 65 (threshold 15). Drivers by points: if/else 29 (47 pts), match/switch 6 (15 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.
deepseek-model-list-editor.DeepSeekModelListEditor (cognitive 65) src/components/settings/deepseek-model-list-editor.tsx:302— deepseek-model-list-editor.DeepSeekModelListEditor has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 12 (34 pts), boolean chains 25, if/else 3, error handling 2, match/switch 1 (nesting depth added 22). Of this number, 30 points are the body's own statements and 35 belong to 10 function items inside it that branch. 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.
chat-html-markdown.htmlEnd (cognitive 65) REDACTED:107— chat-html-markdown.htmlEnd has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (56 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edit.describeEditFiles (cognitive 64) src/lib/activity/edit.ts:495— edit.describeEditFiles has cognitive complexity 64 (threshold 15). Drivers by points: if/else 13 (31 pts), ternaries 9 (23 pts), boolean chains 8, loops 2 (nesting depth added 32). Of this number, 49 points are the body's own statements and 15 belong to 2 function literals inside it that branch. 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.
branch-selector-rows.buildBranchRows (cognitive 64) src/lib/branch-selector-rows.ts:299— branch-selector-rows.buildBranchRows has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (45 pts), loops 5 (14 pts), boolean chains 3, ternaries 1 (2 pts) (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.
computer-window-picker.ComputerWindowPicker (cognitive 60) src/components/computer/computer-window-picker.tsx:348— computer-window-picker.ComputerWindowPicker has cognitive complexity 60 (threshold 15). Drivers by points: boolean chains 23, ternaries 9 (16 pts), if/else 10 (13 pts), error handling 6, loops 2 (nesting depth added 10). Of this number, 31 points are the body's own statements and 29 belong to 13 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.
pet-manager-section.PetManagerSection (cognitive 60) src/components/settings/pet-manager-section.tsx:61— pet-manager-section.PetManagerSection has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 14 (32 pts), if/else 10 (15 pts), boolean chains 9, error handling 4 (nesting depth added 23). Most of this is not in the body itself: 9 of the 60 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 87, 283, 107, …). 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.
status-bar-update.StatusBarUpdate (cognitive 59) src/components/layout/status-bar-update.tsx:115— status-bar-update.StatusBarUpdate has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 18 (26 pts), boolean chains 25, if/else 8 (nesting depth added 8). Of this number, 57 points are the body's own statements and 2 belong to one function literal 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.
kimi-code-config-panel.KimiCodeConfigPanel (cognitive 59) src/components/settings/kimi-code-config-panel.tsx:479— kimi-code-config-panel.KimiCodeConfigPanel has cognitive complexity 59 (threshold 15). Drivers by points: boolean chains 27, ternaries 22 (26 pts), if/else 5, error handling 1 (nesting depth added 4). Of this number, 37 points are the body's own statements and 22 belong to 12 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.
skill-agent-matrix.SkillAgentMatrix (cognitive 59) src/components/settings/skill-agent-matrix.tsx:188— skill-agent-matrix.SkillAgentMatrix has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (23 pts), ternaries 10 (19 pts), boolean chains 10, loops 4 (5 pts), error handling 2 (nesting depth added 11). Of this number, 17 points are the body's own statements and 42 belong to 22 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.
canvas-conversation-surface.CanvasConversationSurface (cognitive 58) src/components/canvas/canvas-conversation-surface.tsx:181— canvas-conversation-surface.CanvasConversationSurface has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23, boolean chains 20, ternaries 11 (12 pts), error handling 3 (nesting depth added 1). Of this number, 18 points are the body's own statements and 40 belong to 17 function literals inside it that branch. 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.
lint_causal_claims.lint (cognitive 57) src-tauri/science/skills/hypothesis-generation/scripts/lint_causal_claims.py:58— lint_causal_claims.lint has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 4 (9 pts), boolean chains 6, ternaries 1 (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.
session-files.computeLineDiff (cognitive 57) REDACTED:625— session-files.computeLineDiff has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 5 (10 pts), boolean chains 5, loops 1 (4 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.
_common.validate_evaluation (cognitive 56) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:750— _common.validate_evaluation has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (47 pts), loops 3 (5 pts), boolean chains 4 (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.
power._resolve (cognitive 56) src-tauri/science/skills/statistical-power/scripts/power.py:88— power._resolve has cognitive complexity 56 (threshold 15). Drivers by points: if/else 27 (43 pts), boolean chains 9, ternaries 2 (4 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.
ask-question-card.AskQuestionCard (cognitive 56) src/components/chat/ask-question-card.tsx:86— ask-question-card.AskQuestionCard has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 26, ternaries 13 (16 pts), if/else 12 (13 pts), error handling 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 36 belong to 14 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.
push-workspace.PushWorkspace (cognitive 55) src/components/layout/push-workspace.tsx:293— push-workspace.PushWorkspace has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 10 (22 pts), if/else 17 (20 pts), boolean chains 10, error handling 3 (nesting depth added 15). Of this number, 25 points are the body's own statements and 30 belong to 12 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.
use-timeline-window.useTimelineWindow (cognitive 55) src/components/message/activity/use-timeline-window.ts:285— use-timeline-window.useTimelineWindow has cognitive complexity 55 (threshold 15). Drivers by points: if/else 28 (36 pts), boolean chains 11, loops 5 (7 pts), ternaries 1 (nesting depth added 10). Of this number, 19 points are the body's own statements and 36 belong to 8 function literals 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.
tab-bar.TabBar (cognitive 55) src/components/tabs/tab-bar.tsx:53— tab-bar.TabBar has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 18, if/else 15 (17 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 55 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 235, 353, 161, …). 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.
D2 · Cognitive Complexity· format (cognitive 55) · ×1
format (cognitive 55) src/browser-injected/console.js:241— format has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (23 pts), ternaries 7 (12 pts), boolean chains 8, loops 4 (7 pts), error handling 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.
check_falsification_controls.audit (cognitive 54) src-tauri/science/skills/hypothesis-generation/scripts/check_falsification_controls.py:302— check_falsification_controls.audit has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (43 pts), loops 4 (8 pts), ternaries 2, boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge-diff.computeMergeHunks (cognitive 53) src/components/merge/merge-diff.ts:170— merge-diff.computeMergeHunks has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 7 (23 pts), if/else 9 (21 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 29). Of this number, 52 points are the body's own statements and 1 belongs 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.
delegation-status-row.DelegationStatusRow (cognitive 53) src/components/message/delegation-status-row.tsx:90— delegation-status-row.DelegationStatusRow has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 20 (25 pts), boolean chains 23, if/else 5 (nesting depth added 5). Of this number, 40 points are the body's own statements and 13 belong to 6 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.
selection-action-bubble.SelectionActionBubble (cognitive 53) src/components/message/selection-action-bubble.tsx:103— selection-action-bubble.SelectionActionBubble has cognitive complexity 53 (threshold 15). Drivers by points: if/else 27 (31 pts), boolean chains 16, ternaries 6 (nesting depth added 4). Most of this is not in the body itself: 7 of the 53 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 147, 217, 446, …). 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.
_structured.inspect_hdf5 (cognitive 52) src-tauri/science/skills/exploratory-data-analysis/scripts/_structured.py:248— _structured.inspect_hdf5 has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (30 pts), ternaries 4 (15 pts), error handling 3, loops 2 (3 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
automations-page.AutomationsPage (cognitive 52) src/components/automations/automations-page.tsx:223— automations-page.AutomationsPage has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 18 (31 pts), boolean chains 10, if/else 6 (8 pts), loops 2, error handling 1 (nesting depth added 15). Of this number, 25 points are the body's own statements and 27 belong to 11 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.
acp-agent-settings.extractCodexTomlImportantValues (cognitive 52) src/components/settings/acp-agent-settings.tsx:2426— acp-agent-settings.extractCodexTomlImportantValues has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 9, loops 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.
rich-composer.RichComposer (cognitive 51) src/components/chat/composer/rich-composer.tsx:254— rich-composer.RichComposer has cognitive complexity 51 (threshold 15). Drivers by points: if/else 31 (35 pts), boolean chains 10, ternaries 4 (6 pts) (nesting depth added 6). Most of this is not in the body itself: 4 of the 51 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 412, 533, 607, …). 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.
sidebar-conversation-list.FolderHeader (cognitive 51) src/components/conversations/sidebar-conversation-list.tsx:227— sidebar-conversation-list.FolderHeader has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 19 (25 pts), boolean chains 18, if/else 6 (8 pts) (nesting depth added 8). Of this number, 35 points are the body's own statements and 16 belong to 8 function literals 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.
antigravity-config-panel.HeadlessSignIn (cognitive 51) src/components/settings/antigravity-config-panel.tsx:242— antigravity-config-panel.HeadlessSignIn has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 11 (20 pts), boolean chains 5, error handling 2 (nesting depth added 14). Of this number, 23 points are the body's own statements and 28 belong to 9 function literals 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.
acp-agent-settings.upsertTomlSectionBooleanKey (cognitive 51) src/components/settings/acp-agent-settings.tsx:2925— acp-agent-settings.upsertTomlSectionBooleanKey has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (13 pts), ternaries 5 (10 pts), boolean chains 6 (nesting depth added 27). Of this number, 50 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
edit.editDiffText (cognitive 51) src/lib/activity/edit.ts:694— edit.editDiffText has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 8, ternaries 5 (8 pts), loops 1 (3 pts) (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.
terminal-context.TerminalProvider (cognitive 50) src/contexts/terminal-context.tsx:229— terminal-context.TerminalProvider has cognitive complexity 50 (threshold 15). Drivers by points: if/else 29 (33 pts), boolean chains 6, loops 5, ternaries 4 (5 pts), error handling 1 (nesting depth added 5). None of this is in the body itself: all 50 points belong to 27 function literals inside it that branch (lines 619, 419, 247, …). 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.
tab-store.applyGroupInvariants (cognitive 50) src/stores/tab-store.ts:1193— tab-store.applyGroupInvariants has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 5 (10 pts), boolean chains 8, ternaries 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.
act.defaultActionFor (cognitive 49) browser-agent/src/act.ts:1109— act.defaultActionFor has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 11, error handling 2 (5 pts), ternaries 2 (4 pts), match/switch 1 (nesting depth added 19). 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.
file-workspace-tab-bar.FileWorkspaceTabItem (cognitive 49) src/components/files/file-workspace-tab-bar.tsx:373— file-workspace-tab-bar.FileWorkspaceTabItem has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 24 (34 pts), boolean chains 15 (nesting depth added 10). Of this number, 47 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.
command-dropdown.CommandDropdown (cognitive 49) src/components/layout/command-dropdown.tsx:58— command-dropdown.CommandDropdown has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (21 pts), ternaries 11 (20 pts), error handling 4 (5 pts), boolean chains 3 (nesting depth added 11). Most of this is not in the body itself: 11 of the 49 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 198, 152, 134, …). 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.
remote-workspace-manage-dialog.RemoteWorkspaceManageDialog (cognitive 49) src/components/layout/remote-workspace-manage-dialog.tsx:160— remote-workspace-manage-dialog.RemoteWorkspaceManageDialog has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 16 (23 pts), if/else 12 (15 pts), boolean chains 7, error handling 4 (nesting depth added 10). Of this number, 19 points are the body's own statements and 30 belong to 20 function literals 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.
virtualized-message-thread.VirtualizedMessageThreadImpl (cognitive 49) src/components/message/virtualized-message-thread.tsx:201— virtualized-message-thread.VirtualizedMessageThreadImpl has cognitive complexity 49 (threshold 15). Drivers by points: if/else 26 (27 pts), ternaries 9 (11 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 6 of the 49 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 393, renderRow, a function literal at line 346, …). 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.
acp-agent-settings.buildAgentDraft (cognitive 49) src/components/settings/acp-agent-settings.tsx:3907— acp-agent-settings.buildAgentDraft has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 24 (41 pts), boolean chains 8 (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.
codex-catalog-source.CodexCatalogStatusLine (cognitive 49) src/components/settings/codex-catalog-source.tsx:464— codex-catalog-source.CodexCatalogStatusLine has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 15, ternaries 5 (10 pts), error handling 1 (nesting depth added 9). Of this number, 42 points are the body's own statements and 7 belong to 4 function literals 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.
delegation-agent-defaults.DelegationAgentDefaultsPanel (cognitive 49) src/components/settings/delegation-agent-defaults.tsx:115— delegation-agent-defaults.DelegationAgentDefaultsPanel has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 16 (19 pts), if/else 15 (17 pts), boolean chains 12, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 15 of the 49 points are its own statements and the rest belongs to 11 function items inside it that branch (options, a function literal at line 151, a function literal at line 230, …). 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.
html-preview-inline.inlineHtmlResources (cognitive 49) REDACTED:567— html-preview-inline.inlineHtmlResources has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (31 pts), ternaries 2 (7 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 16). Of this number, 27 points are the body's own statements and 22 belong to 9 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.
agent-tools-settings.AgentToolsSettingsSection (cognitive 48) src/components/settings/agent-tools-settings.tsx:135— agent-tools-settings.AgentToolsSettingsSection has cognitive complexity 48 (threshold 15). Drivers by points: if/else 28, ternaries 11, boolean chains 9. Most of this is not in the body itself: 3 of the 48 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 162, 361, 470, …). 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.
use-connection-lifecycle.useConnectionLifecycle (cognitive 48) src/hooks/use-connection-lifecycle.ts:136— use-connection-lifecycle.useConnectionLifecycle has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 16, ternaries 9 (13 pts) (nesting depth added 5). Of this number, 17 points are the body's own statements and 31 belong to 7 function literals 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.
forge-settings-dialog.ForgeSettingsScope (cognitive 47) src/components/forge/forge-settings-dialog.tsx:163— forge-settings-dialog.ForgeSettingsScope has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 24 (37 pts), boolean chains 7, if/else 2, error handling 1 (nesting depth added 13). Of this number, 29 points are the body's own statements and 18 belong to 6 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.
use-agent-call-model.useAgentCallModel (cognitive 47) src/components/message/use-agent-call-model.ts:193— use-agent-call-model.useAgentCallModel has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 11 (41 pts), boolean chains 6 (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.
opencode-connect-dialog.OpenCodeConnectDialog (cognitive 47) src/components/settings/opencode-connect-dialog.tsx:99— opencode-connect-dialog.OpenCodeConnectDialog has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 22, ternaries 12 (17 pts), if/else 7, error handling 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 25 belong to 7 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.
branch-picker.BranchPicker (cognitive 47) src/components/shared/branch-picker.tsx:96— branch-picker.BranchPicker has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 11 (13 pts), boolean chains 6, error handling 2 (nesting depth added 15). Of this number, 28 points are the body's own statements and 19 belong to 7 function literals 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.
session-files.buildDiffChunk (cognitive 47) REDACTED:1061— session-files.buildDiffChunk has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 5 (11 pts), loops 1 (2 pts), boolean chains 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.
CitationValidator.validate_file (cognitive 46) src-tauri/science/skills/citation-management/scripts/validate_citations.py:360— CitationValidator.validate_file has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 6 (11 pts), boolean chains 7 (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.
file-workspace-panel.buildDiffOutline (cognitive 46) src/components/files/file-workspace-panel.tsx:303— file-workspace-panel.buildDiffOutline has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 4, loops 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.
task-settings-dialog.TaskSettingsBody (cognitive 46) src/components/tasks/task-settings-dialog.tsx:189— task-settings-dialog.TaskSettingsBody has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 19 (25 pts), boolean chains 14, if/else 5 (6 pts), error handling 1 (nesting depth added 7). Most of this is not in the body itself: 9 of the 46 points are its own statements and the rest belongs to 10 function items inside it that branch (save, a function literal at line 254, a function literal at line 600, …). 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.
activity-header.ActivityHeader (cognitive 45) src/components/message/activity/activity-header.tsx:47— activity-header.ActivityHeader has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 19 (33 pts), boolean chains 9, if/else 2 (3 pts) (nesting depth added 15). Of this number, 41 points are the body's own statements and 4 belong to 2 function literals 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.
codeg-mcp-tool-card.CodegMcpToolCard (cognitive 45) src/components/message/codeg-mcp-tool-card.tsx:117— codeg-mcp-tool-card.CodegMcpToolCard has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 18 (33 pts), boolean chains 11, match/switch 1 (nesting depth added 15). Of this number, 30 points are the body's own statements and 15 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.
channel-list-tab.ChannelListTab (cognitive 45) src/components/settings/channel-list-tab.tsx:57— channel-list-tab.ChannelListTab has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 11, if/else 8 (9 pts), error handling 7 (nesting depth added 12). Most of this is not in the body itself: 6 of the 45 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 248, 131, 115, …). 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.
acp-connections-context.sameConfigOptions (cognitive 45) src/contexts/acp-connections-context.tsx:1519— acp-connections-context.sameConfigOptions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 4 (8 pts), boolean chains 4 (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.
image_metadata.screen_metadata (cognitive 44) src-tauri/science/skills/scientific-visualization/scripts/image_metadata.py:493— image_metadata.screen_metadata has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 6 (14 pts), boolean chains 8, 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.
computer-settings.ComputerSettingsSection (cognitive 44) src/components/settings/computer-settings.tsx:208— computer-settings.ComputerSettingsSection has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 23, boolean chains 13, if/else 6, error handling 2. Most of this is not in the body itself: 13 of the 44 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 376, 295, 330, …). 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.
logs-settings.LogsSettings (cognitive 44) src/components/settings/logs-settings.tsx:272— logs-settings.LogsSettings has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20, boolean chains 12, ternaries 9, error handling 3. Most of this is not in the body itself: 15 of the 44 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 472, 616, 349, …). 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.
web-service-settings.WebServiceSettings (cognitive 44) src/components/settings/web-service-settings.tsx:288— web-service-settings.WebServiceSettings has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 15, if/else 13 (15 pts), ternaries 7 (8 pts), error handling 6 (nesting depth added 3). Most of this is not in the body itself: 13 of the 44 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 323, handleStart, a function literal at line 426, …). 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.
task-editor-dialog.TaskEditorBody (cognitive 44) src/components/tasks/task-editor-dialog.tsx:97— task-editor-dialog.TaskEditorBody has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15, ternaries 11 (14 pts), boolean chains 12, error handling 3 (nesting depth added 3). Of this number, 17 points are the body's own statements and 27 belong to 12 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.
delegation-card.parseToolOutput (cognitive 44) src/lib/delegation-card.ts:1477— delegation-card.parseToolOutput has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 8, ternaries 2 (6 pts), error handling 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.
conversation-tags-store.useConversationTagsStore (cognitive 44) src/stores/conversation-tags-store.ts:161— conversation-tags-store.useConversationTagsStore has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 8, error handling 4, ternaries 2 (3 pts), loops 2 (nesting depth added 10). None of this is in the body itself: all 44 points belong to 8 function literals inside it that branch (lines 170, 271, 242, …). 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.
evaluate_matrix.load_scores (cognitive 43) src-tauri/science/skills/scientific-brainstorming/scripts/evaluate_matrix.py:153— evaluate_matrix.load_scores has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
completed-turn-content.CompletedTurnContent (cognitive 43) src/components/message/completed-turn-content.tsx:77— completed-turn-content.CompletedTurnContent has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 19, ternaries 13, if/else 10 (11 pts) (nesting depth added 1). Of this number, 36 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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.
antigravity-config-panel.AntigravityConfigPanel (cognitive 43) src/components/settings/antigravity-config-panel.tsx:927— antigravity-config-panel.AntigravityConfigPanel has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 19 (27 pts), if/else 8, boolean chains 6, error handling 2 (nesting depth added 8). Of this number, 29 points are the body's own statements and 14 belong to 4 function literals 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.
_common.parse_bibtex (cognitive 42) src-tauri/science/skills/citation-management/scripts/_common.py:97— _common.parse_bibtex has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 5 (9 pts), boolean chains 4, ternaries 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.
lint_review.lint (cognitive 42) src-tauri/science/skills/peer-review/scripts/lint_review.py:113— lint_review.lint has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 5 (8 pts), boolean chains 4, ternaries 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_traceability.validate_manifest (cognitive 42) src-tauri/science/skills/scholar-evaluation/scripts/check_traceability.py:26— check_traceability.validate_manifest has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 2 (4 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.
composer-context-usage.ComposerContextUsage (cognitive 42) src/components/chat/composer-context-usage.tsx:34— composer-context-usage.ComposerContextUsage has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 18 (25 pts), boolean chains 12, if/else 5 (nesting depth added 7). Of this number, 35 points are the body's own statements and 7 belong to 5 function literals 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.
session-details-content.SessionDetailsContent (cognitive 42) src/components/conversations/session-details-content.tsx:512— session-details-content.SessionDetailsContent has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 15 (22 pts), boolean chains 17, if/else 3 (nesting depth added 7). Of this number, 37 points are the body's own statements and 5 belong to 4 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.
office-preview.OfficePreview (cognitive 42) REDACTED:79— office-preview.OfficePreview has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 11, ternaries 4 (6 pts) (nesting depth added 6). Of this number, 21 points are the body's own statements and 21 belong to 12 function literals 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.
generic-row.GenericRow (cognitive 42) src/components/message/activity/rows/generic-row.tsx:48— generic-row.GenericRow has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 19 (33 pts), boolean chains 7, if/else 1, match/switch 1 (nesting depth added 14). Most of this is not in the body itself: 6 of the 42 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 195, 86, 68, …). 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.
codex-visualize-card.CodexVisualizeCard (cognitive 42) src/components/message/codex-visualize-card.tsx:436— codex-visualize-card.CodexVisualizeCard has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 18 (21 pts), boolean chains 14, if/else 7 (nesting depth added 3). Of this number, 27 points are the body's own statements and 15 belong to 5 function literals 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.
exit-meaning.answerOf (cognitive 42) src/lib/activity/exit-meaning.ts:435— exit-meaning.answerOf has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 6 (17 pts), if/else 9 (16 pts), boolean chains 9 (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.
delegation-card.skipJsTemplate (cognitive 42) src/lib/delegation-card.ts:309— delegation-card.skipJsTemplate has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 5, 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.
CitationValidator.validate_entry (cognitive 41) src-tauri/science/skills/citation-management/scripts/validate_citations.py:89— CitationValidator.validate_entry has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-screenshot-markup.ScreenshotMarkupDialog (cognitive 41) src/components/browser/browser-screenshot-markup.tsx:68— browser-screenshot-markup.ScreenshotMarkupDialog has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (26 pts), boolean chains 11, ternaries 4 (nesting depth added 1). Most of this is not in the body itself: 4 of the 41 points are its own statements and the rest belongs to 18 function items inside it that branch (onKeyDown, a function literal at line 131, onPointerUp, …). 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.
doc-guest-preview.DocGuestPreview (cognitive 41) src/components/files/doc-guest-preview.tsx:76— doc-guest-preview.DocGuestPreview has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 16 (25 pts), boolean chains 13, if/else 2, error handling 1 (nesting depth added 9). Of this number, 32 points are the body's own statements and 9 belong to 4 function literals 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.
collab-agent-row.CollabAgentRow (cognitive 41) src/components/message/activity/rows/collab-agent-row.tsx:43— collab-agent-row.CollabAgentRow has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 22 (29 pts), boolean chains 11, match/switch 1 (nesting depth added 7). Of this number, 29 points are the body's own statements and 12 belong to 3 function literals 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.
acp-agent-settings.buildVersionCheck (cognitive 41) src/components/settings/acp-agent-settings.tsx:4439— acp-agent-settings.buildVersionCheck has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 14 (16 pts), boolean chains 6 (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.
quick-messages-settings.QuickMessagesSettings (cognitive 41) src/components/settings/quick-messages-settings.tsx:121— quick-messages-settings.QuickMessagesSettings has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 10 (12 pts), boolean chains 10, error handling 5 (nesting depth added 3). Most of this is not in the body itself: 14 of the 41 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 430, 190, 200, …). 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.
task-card.TaskCard (cognitive 41) src/components/tasks/task-card.tsx:411— task-card.TaskCard has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 19 (23 pts), boolean chains 16, if/else 2 (nesting depth added 4). Of this number, 38 points are the body's own statements and 3 belong to one function literal 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.
ai-elements-adapter.groupGoalRuns (cognitive 41) src/lib/adapters/ai-elements-adapter.ts:2086— ai-elements-adapter.groupGoalRuns has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 6, loops 1 (nesting depth added 17). Of this number, 36 points are the body's own statements and 5 belong to 4 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.
codex-visualize.splitCodexVisualizeRefs (cognitive 41) src/lib/codex-visualize.ts:97— codex-visualize.splitCodexVisualizeRefs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (31 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 18). Of this number, 40 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.
sequence_inspector.inspect_sequence_file (cognitive 40) src-tauri/science/skills/exploratory-data-analysis/scripts/sequence_inspector.py:71— sequence_inspector.inspect_sequence_file has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 7 (15 pts), boolean chains 3, error handling 3, 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.
weight_sensitivity.analyze (cognitive 40) src-tauri/science/skills/scholar-evaluation/scripts/weight_sensitivity.py:47— weight_sensitivity.analyze has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 4 (7 pts), ternaries 3 (7 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
layout.WorkspaceContent (cognitive 40) src/app/workspace/layout.tsx:282— layout.WorkspaceContent has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 25, if/else 9, ternaries 5, error handling 1. Of this number, 25 points are the body's own statements and 15 belong to 5 function literals inside it that branch. 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.
automations-page.RunHistory (cognitive 40) src/components/automations/automations-page.tsx:1293— automations-page.RunHistory has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (30 pts), if/else 5, boolean chains 3, error handling 2 (nesting depth added 19). Most of this is not in the body itself: 4 of the 40 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1396, a function literal at line 1309, cancel, …). 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.
sidebar-conversation-card.SidebarConversationCard (cognitive 40) src/components/conversations/sidebar-conversation-card.tsx:222— sidebar-conversation-card.SidebarConversationCard has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 19, ternaries 9 (15 pts), if/else 6 (nesting depth added 6). Of this number, 32 points are the body's own statements and 8 belong to 7 function literals 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.
aux-panel-file-tree-tab.RenderNode (cognitive 40) src/components/layout/aux-panel-file-tree-tab.tsx:640— aux-panel-file-tree-tab.RenderNode has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (11 pts), ternaries 8 (10 pts), error handling 4 (6 pts) (nesting depth added 7). Of this number, 23 points are the body's own statements and 17 belong to 10 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.
describe-tool-call.describeUncached (cognitive 40) src/lib/activity/describe-tool-call.ts:631— describe-tool-call.describeUncached has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 16 (33 pts), boolean chains 6, 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.
summarize.summarizeActivity (cognitive 40) src/lib/activity/summarize.ts:96— summarize.summarizeActivity has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 5, loops 3 (5 pts), match/switch 2, ternaries 1 (2 pts) (nesting depth added 12). Most of this is not in the body itself: 7 of the 40 points are its own statements and the rest belongs to one function literal inside it that branches (line 109). 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.
LockedHome::commit (cognitive 39) src-tauri/src/acp/codex_catalog_commit/mod.rs:1876— LockedHome::commit has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (23 pts), match/switch 6 (8 pts), boolean chains 5, loops 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.
canvas-model.computeAlignment (cognitive 39) src/components/canvas/canvas-model.ts:531— canvas-model.computeAlignment has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (11 pts), boolean chains 6, ternaries 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.
region-node.RegionNode (cognitive 39) src/components/canvas/nodes/region-node.tsx:34— region-node.RegionNode has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 13 (20 pts), boolean chains 14, if/else 3 (5 pts) (nesting depth added 9). Of this number, 30 points are the body's own statements and 9 belong to 4 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.
forge-issue-row.RowChecksMark (cognitive 39) src/components/forge/forge-issue-row.tsx:291— forge-issue-row.RowChecksMark has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 10 (15 pts), boolean chains 5 (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.
aux-panel-tasks-tab.TasksAuxTab (cognitive 39) src/components/layout/aux-panel-tasks-tab.tsx:85— aux-panel-tasks-tab.TasksAuxTab has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 11 (29 pts), boolean chains 5, if/else 4, loops 1 (nesting depth added 18). Of this number, 22 points are the body's own statements and 17 belong to 6 function literals inside it that branch. 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.
acp-agent-settings.tomlLinesInsideMultilineString (cognitive 39) src/components/settings/acp-agent-settings.tsx:2721— acp-agent-settings.tomlLinesInsideMultilineString has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 4 (12 pts), boolean chains 4 (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.
conversation-runtime-store.computeTimelinePrefix (cognitive 39) src/stores/conversation-runtime-store.ts:3914— conversation-runtime-store.computeTimelinePrefix has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (14 pts), ternaries 6, loops 3 (5 pts) (nesting depth added 7). Of this number, 34 points are the body's own statements and 5 belong to 5 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.
validate_hypothesis_schema.validate_record (cognitive 38) src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:783— validate_hypothesis_schema.validate_record has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (22 pts), loops 10, boolean chains 4, ternaries 2 (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.
audit_statistics_reproducibility.audit (cognitive 38) src-tauri/science/skills/peer-review/scripts/audit_statistics_reproducibility.py:186— audit_statistics_reproducibility.audit has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 3, ternaries 2, 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.
figure_export.export_figure (cognitive 38) src-tauri/science/skills/scientific-visualization/scripts/figure_export.py:167— figure_export.export_figure has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 8, ternaries 3 (6 pts), loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-call-normalization.inferFromInput (cognitive 38) REDACTED:409— tool-call-normalization.inferFromInput has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 8, ternaries 2 (4 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.
index.act (cognitive 37) browser-agent/src/index.ts:480— index.act has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 4 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 17). Of this number, 36 points are the body's own statements and 1 belongs 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.
edit-model-provider-dialog.EditModelProviderDialog (cognitive 37) src/components/settings/edit-model-provider-dialog.tsx:53— edit-model-provider-dialog.EditModelProviderDialog has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 10 (13 pts), boolean chains 6, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 12 of the 37 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 147, 77, 111, …). 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.
general-settings.GeneralSettings (cognitive 37) src/components/settings/general-settings.tsx:75— general-settings.GeneralSettings has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 13, if/else 11 (12 pts), error handling 6, ternaries 4 (6 pts) (nesting depth added 3). Most of this is not in the body itself: 14 of the 37 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 128, 189, 251, …). 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.
version-control-settings.VersionControlSettings (cognitive 37) src/components/settings/version-control-settings.tsx:226— version-control-settings.VersionControlSettings has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, ternaries 9 (10 pts), error handling 6 (nesting depth added 3). Most of this is not in the body itself: 13 of the 37 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 366, 301, 343, …). 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.
delegation-card.codeModeArgsTransparent (cognitive 37) src/lib/delegation-card.ts:910— delegation-card.codeModeArgsTransparent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 7, 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.
tab-store.applyRemoteSnapshot (cognitive 37) src/stores/tab-store.ts:3441— tab-store.applyRemoteSnapshot has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 11, ternaries 5, loops 2 (nesting depth added 4). Of this number, 29 points are the body's own statements and 8 belong to 4 function literals 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.
validate_review_intake.validate_intake (cognitive 36) src-tauri/science/skills/peer-review/scripts/validate_review_intake.py:74— validate_review_intake.validate_intake has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 7, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
sidebar-conversation-grouping.reconcileLayout (cognitive 36) src/components/conversations/sidebar-conversation-grouping.ts:763— sidebar-conversation-grouping.reconcileLayout has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 6 (9 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
command-rows.CommandDetail (cognitive 36) src/components/message/activity/rows/command-rows.tsx:357— command-rows.CommandDetail has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 21 (27 pts), boolean chains 9 (nesting depth added 6). Of this number, 34 points are the body's own statements and 2 belong to 2 function literals 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.
pet-marketplace-dialog.PetMarketplaceDialog (cognitive 36) src/components/settings/pet-marketplace-dialog.tsx:66— pet-marketplace-dialog.PetMarketplaceDialog has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 10, if/else 8 (9 pts), error handling 2 (nesting depth added 7). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 110, 185, 139, …). 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.
ScientificSchematicGenerator.generate_iterative (cognitive 35) src-tauri/science/skills/scientific-schematics/scripts/generate_schematic_ai.py:561— ScientificSchematicGenerator.generate_iterative has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 7, ternaries 1 (3 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.
file-workspace-header.FileWorkspaceHeader (cognitive 35) src/components/files/file-workspace-header.tsx:72— file-workspace-header.FileWorkspaceHeader has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 22, if/else 7, ternaries 4 (5 pts), error handling 1 (nesting depth added 1). Of this number, 27 points are the body's own statements and 8 belong to 4 function items inside it that branch. 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.
task-detail-sheet.timelineDetail (cognitive 35) src/components/tasks/task-detail-sheet.tsx:2030— task-detail-sheet.timelineDetail has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 11, if/else 2 (3 pts), match/switch 1 (nesting depth added 11). Of this number, 32 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
html-preview-inline.scanStartTags (cognitive 35) REDACTED:121— html-preview-inline.scanStartTags has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (28 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.
summarize_agreement.read_rows (cognitive 34) src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:27— summarize_agreement.read_rows has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), error handling 1 (3 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.
usePetDrag.usePetDrag (cognitive 34) src/app/pet/_hooks/usePetDrag.ts:56— usePetDrag.usePetDrag has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 4). None of this is in the body itself: all 34 points belong to 7 function literals inside it that branch (lines 130, 97, 182, …). 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.
composer-connection-status.ComposerConnectionStatus (cognitive 34) src/components/chat/composer-connection-status.tsx:92— composer-connection-status.ComposerConnectionStatus has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 19 (23 pts), boolean chains 9, if/else 2 (nesting depth added 4). Of this number, 29 points are the body's own statements and 5 belong to 5 function literals 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.
status-bar-mcp.StatusBarMcp (cognitive 34) src/components/layout/status-bar-mcp.tsx:85— status-bar-mcp.StatusBarMcp has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (10 pts), ternaries 6 (7 pts), error handling 3 (nesting depth added 4). Of this number, 19 points are the body's own statements and 15 belong to 5 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.
status-bar-web-service.StatusBarWebService (cognitive 34) src/components/layout/status-bar-web-service.tsx:94— status-bar-web-service.StatusBarWebService has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 16 (20 pts), if/else 6, boolean chains 5, error handling 3 (nesting depth added 4). Of this number, 25 points are the body's own statements and 9 belong to 7 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.
merge-workspace.MergeWorkspace (cognitive 34) src/components/merge/merge-workspace.tsx:45— merge-workspace.MergeWorkspace has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 14, ternaries 7 (10 pts), error handling 5, if/else 5 (nesting depth added 3). Of this number, 18 points are the body's own statements and 16 belong to 8 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.
assistant-editor-dialog.AssistantEditorBody::save (cognitive 34) src/components/settings/assistant-editor-dialog.tsx:262— assistant-editor-dialog.AssistantEditorBody::save has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (20 pts), ternaries 4 (10 pts), boolean chains 3, error handling 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. This shape REPEATS in the file: one other method here (assistant-editor-dialog.AssistantEditorBody) 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.
build-activity.collectSteps (cognitive 34) src/lib/activity/build-activity.ts:247— build-activity.collectSteps has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 10, if/else 4 (8 pts), match/switch 1 (nesting depth added 11). None of this is in the body itself: all 34 points belong to 2 function items inside it that branch (a function literal at line 261, note). 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.
delegation-card.codeModeFindKey (cognitive 34) src/lib/delegation-card.ts:647— delegation-card.codeModeFindKey has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 6, 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.
line-change-stats.countUnifiedDiffLineChanges (cognitive 34) src/lib/line-change-stats.ts:172— line-change-stats.countUnifiedDiffLineChanges has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAlexSearcher.search (cognitive 33) src-tauri/science/skills/citation-management/scripts/search_openalex.py:66— OpenAlexSearcher.search has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, loops 2 (3 pts), error handling 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.
check_operationalization.audit (cognitive 33) src-tauri/science/skills/hypothesis-generation/scripts/check_operationalization.py:142— check_operationalization.audit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (5 pts), boolean chains 2, 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.
summarize_agreement.summarize (cognitive 33) src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:122— summarize_agreement.summarize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-toolbar.BrowserToolbar (cognitive 33) src/components/browser/browser-toolbar.tsx:179— browser-toolbar.BrowserToolbar has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 9, boolean chains 8 (nesting depth added 2). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 10 function items inside it that branch (submit, a function literal at line 388, onKeyDown, …). 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.
chat-width-handles.WidthHandle (cognitive 33) src/components/chat/chat-width-handles.tsx:140— chat-width-handles.WidthHandle has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (21 pts), ternaries 5 (7 pts), boolean chains 5 (nesting depth added 4). Most of this is not in the body itself: 3 of the 33 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 247, 197, 284, …). 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.
model-option-list.ModelOptionList (cognitive 33) src/components/chat/model-option-list.tsx:72— model-option-list.ModelOptionList has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 6 (9 pts), boolean chains 5, match/switch 1 (nesting depth added 11). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 157, 293, 219, …). 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.
permission-dialog.PermissionDialog (cognitive 33) src/components/chat/permission-dialog.tsx:62— permission-dialog.PermissionDialog has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 24, ternaries 5, if/else 2 (3 pts), loops 1 (nesting depth added 1). Of this number, 28 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
conversation-detail-header.ConversationDetailHeader (cognitive 33) src/components/conversations/conversation-detail-header.tsx:96— conversation-detail-header.ConversationDetailHeader has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14, ternaries 8 (9 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 2). Most of this is not in the body itself: 8 of the 33 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 200, 174, 194, …). 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.
search-command-dialog.SearchCommandDialog (cognitive 33) src/components/conversations/search-command-dialog.tsx:44— search-command-dialog.SearchCommandDialog has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 14, if/else 8 (9 pts), ternaries 8 (9 pts), error handling 1 (nesting depth added 2). Of this number, 19 points are the body's own statements and 14 belong to 8 function literals 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.
remote-manage-dialog.RemoteManageDialog::handleSave (cognitive 33) src/components/layout/remote-manage-dialog.tsx:110— remote-manage-dialog.RemoteManageDialog::handleSave has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 4 (9 pts), boolean chains 4, loops 4 (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.
server-file-browser-dialog.ServerFileBrowserDialog (cognitive 33) src/components/shared/server-file-browser-dialog.tsx:35— server-file-browser-dialog.ServerFileBrowserDialog has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 8, error handling 3, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 225, a function literal at line 142, a function literal at line 187, …). 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.
use-subsession-sync.useSubsessionSync (cognitive 33) src/hooks/use-subsession-sync.ts:57— use-subsession-sync.useSubsessionSync has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (25 pts), loops 4 (7 pts), ternaries 1 (nesting depth added 10). None of this is in the body itself: all 33 points belong to 8 function literals inside it that branch (lines 133, 79, 103, …). 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.
file-open-target.normalizeAbsPath (cognitive 33) src/lib/file-open-target.ts:41— file-open-target.normalizeAbsPath has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 6 (12 pts), boolean chains 5, 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.
conversation-runtime-store.applyLateToolCallReports (cognitive 33) src/stores/conversation-runtime-store.ts:2300— conversation-runtime-store.applyLateToolCallReports has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 12). Most of this is not in the body itself: 12 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2329, 2320, 2337). 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.
_structured._array_report (cognitive 32) src-tauri/science/skills/exploratory-data-analysis/scripts/_structured.py:85— _structured._array_report has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (24 pts), if/else 7 (8 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.
_common._scan_structure (cognitive 32) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:128— _common._scan_structure has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (7 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.
browser-events-bridge.BrowserEventsBridge (cognitive 32) src/components/browser/browser-events-bridge.tsx:115— browser-events-bridge.BrowserEventsBridge has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (23 pts), loops 2 (3 pts), boolean chains 2, error handling 2, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 32 points belong to 11 function literals inside it that branch (lines 170, 301, 206, …). 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.
browser-status-layer.BrowserNoticeBar (cognitive 32) src/components/browser/browser-status-layer.tsx:139— browser-status-layer.BrowserNoticeBar has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 7, if/else 3 (7 pts) (nesting depth added 11). Of this number, 26 points are the body's own statements and 6 belong to 2 function literals 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.
unstash-dialog.StashWorkspace (cognitive 32) src/components/layout/unstash-dialog.tsx:184— unstash-dialog.StashWorkspace has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 6 (12 pts), error handling 5 (6 pts), boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (handleSelectFile, handleToggleStash, handleDrop, …). 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.
subagent-session-dialog.SubagentSessionDialog (cognitive 32) src/components/message/subagent-session-dialog.tsx:114— subagent-session-dialog.SubagentSessionDialog has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 9 (11 pts), boolean chains 8, error handling 1 (nesting depth added 7). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 151, 194, 189, …). 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.
turn-stats.TurnStats (cognitive 32) src/components/message/turn-stats.tsx:56— turn-stats.TurnStats has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 19, if/else 8, ternaries 4 (5 pts) (nesting depth added 1). Of this number, 25 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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.
mcp-settings.parseParameterValues (cognitive 32) src/components/settings/mcp-settings.tsx:220— mcp-settings.parseParameterValues has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
conversation-runtime-store.cleanAgentOutput (cognitive 32) src/stores/conversation-runtime-store.ts:748— conversation-runtime-store.cleanAgentOutput has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (5 pts), error handling 2 (4 pts), ternaries 1 (2 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.
unified-diff-preview.classifyRows (cognitive 31) src/components/diff/unified-diff-preview.tsx:177— unified-diff-preview.classifyRows has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 6 (12 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
command-rows.CommandLabel (cognitive 31) src/components/message/activity/rows/command-rows.tsx:119— command-rows.CommandLabel has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 16 (26 pts), if/else 3, 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.
command.parseCliExecutionEnvelope (cognitive 31) src/lib/activity/command.ts:229— command.parseCliExecutionEnvelope has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ai-elements-adapter.splitUserTextAndResources (cognitive 31) src/lib/adapters/ai-elements-adapter.ts:1393— ai-elements-adapter.splitUserTextAndResources has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (5 pts), loops 2 (4 pts), boolean chains 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.
file-tab-id.parseFileTabId (cognitive 31) src/lib/file-tab-id.ts:112— file-tab-id.parseFileTabId has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 8 (11 pts), boolean chains 3, 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.
session-files.parseUnifiedDiffSections (cognitive 31) REDACTED:468— session-files.parseUnifiedDiffSections has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, loops 1 (nesting depth added 14). Of this number, 27 points are the body's own statements and 4 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.
tab-store.alignConversationTabFolders (cognitive 31) src/stores/tab-store.ts:1437— tab-store.alignConversationTabFolders has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 15). Of this number, 29 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
jats_to_text.main (cognitive 30) src-tauri/science/skills/paper-lookup/scripts/jats_to_text.py:248— jats_to_text.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_claim_evidence.validate_matrix (cognitive 30) src-tauri/science/skills/peer-review/scripts/validate_claim_evidence.py:127— validate_claim_evidence.validate_matrix has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 4, ternaries 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.
html-code-preview.HtmlCodePreview (cognitive 30) src/components/ai-elements/html-code-preview.tsx:122— html-code-preview.HtmlCodePreview has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 9, if/else 8 (nesting depth added 3). Of this number, 18 points are the body's own statements and 12 belong to 6 function literals 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.
message.containerPrefixEnd (cognitive 30) src/components/ai-elements/message.tsx:429— message.containerPrefixEnd has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 7, loops 3 (6 pts), ternaries 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.
agent-config-section.AgentConfigSection (cognitive 30) src/components/automations/agent-config-section.tsx:63— agent-config-section.AgentConfigSection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 7 (11 pts), boolean chains 7 (nesting depth added 7). Of this number, 27 points are the body's own statements and 3 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.
browser-page-handoff.BrowserSendToChatControl (cognitive 30) src/components/browser/browser-page-handoff.tsx:83— browser-page-handoff.BrowserSendToChatControl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15, boolean chains 9, ternaries 5 (6 pts) (nesting depth added 1). Most of this is not in the body itself: 9 of the 30 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 118, 104, 149, …). 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.
sidebar-section-header.SidebarSectionHeader (cognitive 30) src/components/conversations/sidebar-section-header.tsx:43— sidebar-section-header.SidebarSectionHeader has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, ternaries 8 (14 pts) (nesting depth added 6). Of this number, 24 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
reply-motion.play (cognitive 30) src/components/message/reply-motion.tsx:108— reply-motion.play has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edit-row.EditRow (cognitive 30) src/components/message/activity/rows/edit-row.tsx:60— edit-row.EditRow has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 13 (22 pts), boolean chains 8 (nesting depth added 9). Of this number, 28 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.
hyperframes-launcher.HyperframesLauncher (cognitive 30) src/components/project-boot/hyperframes/hyperframes-launcher.tsx:63— hyperframes-launcher.HyperframesLauncher has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 8, error handling 5, if/else 2 (nesting depth added 4). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (handleCreate, a function literal at line 284, a function literal at line 375, …). 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.
acp-agent-settings.AcpAgentSettings::renderFixButton (cognitive 30) src/components/settings/acp-agent-settings.tsx:6319— acp-agent-settings.AcpAgentSettings::renderFixButton has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (22 pts), boolean chains 8 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (acp-agent-settings.AcpAgentSettings) 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.
computer-settings.StopShortcutRow (cognitive 30) src/components/settings/computer-settings.tsx:893— computer-settings.StopShortcutRow has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8, ternaries 4 (7 pts) (nesting depth added 5). Of this number, 23 points are the body's own statements and 7 belong to 2 function literals 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.
delegation-settings.DelegationSettingsSection (cognitive 30) src/components/settings/delegation-settings.tsx:92— delegation-settings.DelegationSettingsSection has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11, boolean chains 9, if/else 9, error handling 1. Of this number, 16 points are the body's own statements and 14 belong to 11 function literals inside it that branch. 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.
tab-item.TabItem (cognitive 30) src/components/tabs/tab-item.tsx:92— tab-item.TabItem has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 9, if/else 5 (nesting depth added 3). Of this number, 25 points are the body's own statements and 5 belong to 5 function literals 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.
task-actions.buildTaskActions (cognitive 30) src/components/tasks/task-actions.ts:116— task-actions.buildTaskActions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exit-meaning.argv (cognitive 30) src/lib/activity/exit-meaning.ts:209— exit-meaning.argv has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (10 pts), boolean chains 6 (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.
RemoteDesktopTransport.handleWsEvent (cognitive 30) src/lib/transport/remote-desktop-transport.ts:475— RemoteDesktopTransport.handleWsEvent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 2 (6 pts), loops 3 (6 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.
conversation-runtime-store.resolveLiveToolInput (cognitive 30) src/stores/conversation-runtime-store.ts:920— conversation-runtime-store.resolveLiveToolInput has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 2 (6 pts), boolean chains 5 (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.
_common.read_csv_records (cognitive 29) src-tauri/science/skills/peer-review/scripts/_common.py:117— _common.read_csv_records has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (4 pts), loops 2 (3 pts), error handling 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.
PetWindow.PetWindow (cognitive 29) src/app/pet/_components/PetWindow.tsx:57— PetWindow.PetWindow has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (22 pts), error handling 4, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 214, a function literal at line 152, a function literal at line 249, …). 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.
eval-render.__codegEvalRender (cognitive 29) src/browser-injected/eval-render.js:82— eval-render.__codegEvalRender has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 7 (10 pts), boolean chains 5, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
inline-dollar-math.normalizeInlineDollarMath (cognitive 29) src/components/ai-elements/inline-dollar-math.ts:58— inline-dollar-math.normalizeInlineDollarMath has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4 (8 pts), boolean chains 7 (nesting depth added 8). Of this number, 21 points are the body's own statements and 8 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.
forge-issue-row.ForgeIssueRowItem (cognitive 29) src/components/forge/forge-issue-row.tsx:415— forge-issue-row.ForgeIssueRowItem has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 16 (27 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.
activity-timeline.ActivityTimeline (cognitive 29) src/components/message/activity/activity-timeline.tsx:150— activity-timeline.ActivityTimeline has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, ternaries 11 (12 pts), if/else 2 (nesting depth added 1). Of this number, 23 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
opencode-plugins-modal.OpencodePluginsModal (cognitive 29) src/components/settings/opencode-plugins-modal.tsx:43— opencode-plugins-modal.OpencodePluginsModal has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 12, ternaries 6 (11 pts), if/else 4, error handling 2 (nesting depth added 5). Of this number, 17 points are the body's own statements and 12 belong to 6 function literals 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.
channel-events-tab.ChannelEventsTab (cognitive 29) src/components/settings/channel-events-tab.tsx:187— channel-events-tab.ChannelEventsTab has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12, boolean chains 7, ternaries 6 (7 pts), error handling 3 (nesting depth added 1). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 346, 241, 289, …). 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.
codex-model-list-editor.CodexCustomRow (cognitive 29) src/components/settings/codex-model-list-editor.tsx:895— codex-model-list-editor.CodexCustomRow has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 12, if/else 2 (nesting depth added 1). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (renderEnum, setField, setOverrides, …). 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.
html-preview-inline.parseSrcset (cognitive 29) REDACTED:507— html-preview-inline.parseSrcset has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (11 pts), boolean chains 5 (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.
delegation-card.parseDelegateTaskId (cognitive 29) src/lib/delegation-card.ts:1600— delegation-card.parseDelegateTaskId has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 13). Of this number, 28 points are the body's own statements and 1 belongs 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.
act.selectIn (cognitive 28) browser-agent/src/act.ts:1445— act.selectIn has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), ternaries 4 (7 pts), loops 3 (nesting depth added 6). Of this number, 23 points are the body's own statements and 5 belong to 4 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.
message-thread.EscapeLockOnUserScroll (cognitive 28) src/components/ai-elements/message-thread.tsx:143— message-thread.EscapeLockOnUserScroll has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17, boolean chains 10, ternaries 1. None of this is in the body itself: all 28 points belong to 8 function literals inside it that branch (lines 199, 176, 150, …). 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.
browser-device-stage.BrowserDeviceStage (cognitive 28) src/components/browser/browser-device-stage.tsx:72— browser-device-stage.BrowserDeviceStage has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 10, if/else 2 (nesting depth added 2). Of this number, 21 points are the body's own statements and 7 belong to 4 function literals 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.
use-composer-attachments.useComposerAttachments.appendImageAttachments (cognitive 28) src/components/chat/composer/use-composer-attachments.ts:567— use-composer-attachments.useComposerAttachments.appendImageAttachments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (5 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 637, 591, 606, …). 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.
use-reference-search.useReferenceSearch (cognitive 28) src/components/chat/composer/use-reference-search.ts:251— use-reference-search.useReferenceSearch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 6, ternaries 5 (nesting depth added 6). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 318, 411, 322, …). 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.
use-rail-growth.useRailGrowth (cognitive 28) src/components/message/activity/use-rail-growth.ts:68— use-rail-growth.useRailGrowth has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, loops 4 (5 pts), ternaries 1 (nesting depth added 5). None of this is in the body itself: all 28 points belong to 8 function literals inside it that branch (lines 103, 84, 74, …). 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.
background-task-rows.BackgroundTaskRowView (cognitive 28) src/components/message/activity/rows/background-task-rows.tsx:86— background-task-rows.BackgroundTaskRowView has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 17 (27 pts), boolean chains 1 (nesting depth added 10). Of this number, 22 points are the body's own statements and 6 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.
delegation-rows.DelegationStepRow (cognitive 28) src/components/message/activity/rows/delegation-rows.tsx:174— delegation-rows.DelegationStepRow has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 12, if/else 1 (nesting depth added 1). Of this number, 23 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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.
message-list-view.mergeConsecutiveAssistantTurns::flush (cognitive 28) src/components/message/message-list-view.tsx:1034— message-list-view.mergeConsecutiveAssistantTurns::flush has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), ternaries 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.
antigravity-config-panel.LeakedTempSection (cognitive 28) src/components/settings/antigravity-config-panel.tsx:704— antigravity-config-panel.LeakedTempSection has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 4, if/else 3, error handling 2 (nesting depth added 8). Of this number, 20 points are the body's own statements and 8 belong to 4 function literals 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.
host-rules.parseHostRulePattern (cognitive 28) src/lib/browser/host-rules.ts:79— host-rules.parseHostRulePattern has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (26 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.
collab-collapse.collapseLiveCollabBlocks (cognitive 28) src/lib/collab-collapse.ts:119— collab-collapse.collapseLiveCollabBlocks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (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.
file-tree-keyboard.resolveTreeKeyboardAction (cognitive 28) src/lib/file-tree-keyboard.ts:102— file-tree-keyboard.resolveTreeKeyboardAction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 4 (6 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.
permission-request.extractCommandFromUnknownValue (cognitive 28) src/lib/permission-request.ts:316— permission-request.extractCommandFromUnknownValue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (8 pts), boolean chains 4, error handling 1 (2 pts), loops 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.
session-files.buildSessionFileDiff (cognitive 28) REDACTED:988— session-files.buildSessionFileDiff has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (3 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.
D2 · Cognitive Complexity· held (cognitive 28) · ×1
held (cognitive 28) REDACTED:60— held has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 5, ternaries 5, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 16 function items inside it that branch (relay, connect, a function literal at line 99, …). 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.
CompactIndex::scan (cognitive 27) src-tauri/src/commands/workspace_file_search.rs:196— CompactIndex::scan has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3, loops 2 (3 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.
_capabilities.validate_magic (cognitive 27) src-tauri/science/skills/exploratory-data-analysis/scripts/_capabilities.py:472— _capabilities.validate_magic has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evaluate_matrix.calculate_matrix (cognitive 27) src-tauri/science/skills/scientific-brainstorming/scripts/evaluate_matrix.py:312— evaluate_matrix.calculate_matrix has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 pts), ternaries 1 (4 pts), boolean chains 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.
reference-uri.parseCodegReferenceUri (cognitive 27) src/components/chat/composer/reference-uri.ts:81— reference-uri.parseCodegReferenceUri has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 7, ternaries 3 (6 pts), error handling 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.
sidebar-conversation-list.SidebarConversationList (cognitive 27) src/components/conversations/sidebar-conversation-list.tsx:961— sidebar-conversation-list.SidebarConversationList has cognitive complexity 27 (threshold 15). Drivers by points: if/else 94 (117 pts), ternaries 57 (101 pts), boolean chains 53, loops 19 (23 pts), error handling 12 (13 pts) (nesting depth added 72). To reduce it, split the body into named stages: move each independent 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 (sidebar-conversation-list.SidebarConversationList::folderHeaderElement, sidebar-conversation-list.SidebarConversationList::renderRow) 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.
message-nav-entries.buildMessageNavEntries (cognitive 27) src/components/message/message-nav-entries.ts:327— message-nav-entries.buildMessageNavEntries has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 5 (7 pts), boolean chains 6, 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.
assistant-editor-dialog.AssistantEditorBody (cognitive 27) src/components/settings/assistant-editor-dialog.tsx:108— assistant-editor-dialog.AssistantEditorBody has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 27 (34 pts), if/else 19 (23 pts), boolean chains 12, error handling 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (assistant-editor-dialog.AssistantEditorBody::save) 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.
browser-settings.BrowserSettings (cognitive 27) src/components/settings/browser-settings.tsx:522— browser-settings.BrowserSettings has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 7, boolean chains 4, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 562, a function literal at line 1013, a function literal at line 1049, …). 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.
skill-agent-matrix.MatrixCell (cognitive 27) src/components/settings/skill-agent-matrix.tsx:998— skill-agent-matrix.MatrixCell has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (19 pts), boolean chains 8 (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.
task-merge-dialog.TaskMergeDialog (cognitive 27) src/components/tasks/task-merge-dialog.tsx:56— task-merge-dialog.TaskMergeDialog has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 7, if/else 6, error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 12 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.
cron-humanize.describeCron (cognitive 27) src/lib/cron-humanize.ts:29— cron-humanize.describeCron has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, ternaries 2 (5 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.
reference-link.destinationEnd (cognitive 27) src/lib/reference-link.ts:174— reference-link.destinationEnd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 1 (4 pts), boolean chains 3, 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.
tab-store.persistGroupState (cognitive 27) src/stores/tab-store.ts:874— tab-store.persistGroupState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 6, loops 3 (4 pts), boolean chains 3, error handling 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 9 belong to 3 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.
PubMedSearcher._extract_metadata_from_xml (cognitive 26) src-tauri/science/skills/citation-management/scripts/search_pubmed.py:198— PubMedSearcher._extract_metadata_from_xml has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
select_reporting_guidelines.assess (cognitive 26) src-tauri/science/skills/peer-review/scripts/select_reporting_guidelines.py:248— select_reporting_guidelines.assess has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
evaluate_matrix.load_criteria (cognitive 26) src-tauri/science/skills/scientific-brainstorming/scripts/evaluate_matrix.py:70— evaluate_matrix.load_criteria has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (4 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.
use-composer-attachments.useComposerAttachments.uploadPathsToRemote (cognitive 26) src/components/chat/composer/use-composer-attachments.ts:773— use-composer-attachments.useComposerAttachments.uploadPathsToRemote has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 791, 775). 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.
pi-project-trust-banner.PiProjectTrustBanner (cognitive 26) src/components/chat/pi-project-trust-banner.tsx:89— pi-project-trust-banner.PiProjectTrustBanner has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (21 pts), boolean chains 20, if/else 13 (15 pts), error handling 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (pi-project-trust-banner.PiProjectTrustBanner::decide) 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.
file-viewer-drawer.FileViewerBody (cognitive 26) src/components/files/file-viewer-drawer.tsx:122— file-viewer-drawer.FileViewerBody has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 9, ternaries 6. Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 188, 204, 259, …). 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.
ask-question-result-card.AskQuestionResultCard (cognitive 26) src/components/message/ask-question-result-card.tsx:46— ask-question-result-card.AskQuestionResultCard has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 6 (9 pts), boolean chains 7 (nesting depth added 5). Of this number, 16 points are the body's own statements and 10 belong to 6 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.
office-tools-settings.OfficeToolsBody (cognitive 26) src/components/settings/office-tools-settings.tsx:221— office-tools-settings.OfficeToolsBody has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 5, ternaries 4 (5 pts), boolean chains 3, match/switch 2 (nesting depth added 3). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 283, 296, 432, …). 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.
provider-models.ModelPickerDialog (cognitive 26) src/components/settings/provider-models.tsx:434— provider-models.ModelPickerDialog has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, ternaries 7 (9 pts), if/else 3 (nesting depth added 2). Of this number, 16 points are the body's own statements and 10 belong to 6 function items inside it that branch. 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.
session-files.extractReplyFileChanges (cognitive 26) REDACTED:918— session-files.extractReplyFileChanges has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (6 pts), ternaries 1 (nesting depth added 16). Of this number, 25 points are the body's own statements and 1 belongs 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.
_common.read_csv_records (cognitive 25) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:153— _common.read_csv_records has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (3 pts), ternaries 1 (3 pts), error handling 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.
remark-windows-paths.visit (cognitive 25) src/components/ai-elements/remark-windows-paths.ts:293— remark-windows-paths.visit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (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.
browser-agent-access.BrowserAgentShareControl (cognitive 25) src/components/browser/browser-agent-access.tsx:89— browser-agent-access.BrowserAgentShareControl has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (20 pts), if/else 3, boolean chains 2 (nesting depth added 8). Of this number, 15 points are the body's own statements and 10 belong to 3 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.
canvas-model.computeRegionMembers (cognitive 25) src/components/canvas/canvas-model.ts:233— canvas-model.computeRegionMembers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), boolean chains 5, match/switch 1 (nesting depth added 11). Of this number, 21 points are the body's own statements and 4 belong to 4 function literals inside it that branch. 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.
canvas-model.computeDropHint (cognitive 25) src/components/canvas/canvas-model.ts:421— canvas-model.computeDropHint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, loops 2 (nesting depth added 8). Of this number, 24 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.
conversation-tag-list-editor.ConversationTagListEditor (cognitive 25) src/components/conversations/conversation-tag-list-editor.tsx:118— conversation-tag-list-editor.ConversationTagListEditor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (6 pts), boolean chains 4, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (submitForm, a function literal at line 169, confirmDelete, …). 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.
aux-panel-file-tree-tab.buildDirectoryGitTree (cognitive 25) src/components/layout/aux-panel-file-tree-tab.tsx:376— aux-panel-file-tree-tab.buildDirectoryGitTree has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). Of this number, 18 points are the body's own statements and 7 belong to 5 function literals 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.
aux-panel-git-log-tab.AuthorFilter (cognitive 25) src/components/layout/aux-panel-git-log-tab.tsx:935— aux-panel-git-log-tab.AuthorFilter has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 15, if/else 6 (7 pts), ternaries 3 (nesting depth added 1). Of this number, 20 points are the body's own statements and 5 belong to 4 function items inside it that branch. 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.
conflict-dialog.ConflictDialog (cognitive 25) src/components/layout/conflict-dialog.tsx:34— conflict-dialog.ConflictDialog has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 9, error handling 4, ternaries 2. Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 61, a function literal at line 127, handleAbort, …). 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.
ai-elements-adapter.expandInlineToolText (cognitive 25) src/lib/adapters/ai-elements-adapter.ts:690— ai-elements-adapter.expandInlineToolText has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 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.
ask-question.parseAskQuestionInput (cognitive 25) src/lib/ask-question.ts:108— ask-question.parseAskQuestionInput has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), ternaries 3 (7 pts), error handling 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.
codex-visualize.findHtmlFileMentions (cognitive 25) src/lib/codex-visualize.ts:241— codex-visualize.findHtmlFileMentions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 10). Of this number, 20 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.
live-runs.collectLiveRuns (cognitive 25) src/lib/live-runs.ts:98— live-runs.collectLiveRuns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4, ternaries 2 (4 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.
opencode-permissions.legacyRules (cognitive 25) src/lib/opencode-permissions.ts:233— opencode-permissions.legacyRules has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts), ternaries 1 (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.
release-notes.splitBilingualReleaseNotes (cognitive 25) src/lib/release-notes.ts:102— release-notes.splitBilingualReleaseNotes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 5, loops 1, ternaries 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.
tab-store.sanitizeDrafts (cognitive 25) src/stores/tab-store.ts:789— tab-store.sanitizeDrafts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 4 (8 pts), boolean chains 7, 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.
scrollableFrom (cognitive 25) src/browser-injected/picker.js:1040— scrollableFrom has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 6, ternaries 2 (6 pts), error handling 2 (5 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.
doi_to_bibtex.main (cognitive 24) src-tauri/science/skills/citation-management/scripts/doi_to_bibtex.py:105— doi_to_bibtex.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), error handling 3 (6 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.
generate_report_scaffold.generate_scaffold (cognitive 24) src-tauri/science/skills/scholar-evaluation/scripts/generate_report_scaffold.py:36— generate_report_scaffold.generate_scaffold has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 8, ternaries 8, if/else 5 (6 pts), 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.
remark-windows-paths.destinationRange (cognitive 24) src/components/ai-elements/remark-windows-paths.ts:256— remark-windows-paths.destinationRange has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (6 pts), boolean chains 5, 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.
browser-tab-view.NativeBrowserTabView (cognitive 24) src/components/browser/browser-tab-view.tsx:122— browser-tab-view.NativeBrowserTabView has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (10 pts), if/else 4 (nesting depth added 3). Of this number, 13 points are the body's own statements and 11 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.
composer-add-menu.ComposerAddMenu (cognitive 24) src/components/chat/composer/composer-add-menu.tsx:78— composer-add-menu.ComposerAddMenu has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 3). Of this number, 13 points are the body's own statements and 11 belong to 5 function literals 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.
computer-indicator.ComputerIndicator (cognitive 24) src/components/computer/computer-indicator.tsx:66— computer-indicator.ComputerIndicator has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 8, ternaries 5, error handling 1. Of this number, 15 points are the body's own statements and 9 belong to 6 function items inside it that branch. 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.
sidebar-tag-filter.TagFilterPanel (cognitive 24) src/components/conversations/sidebar-tag-filter.tsx:154— sidebar-tag-filter.TagFilterPanel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 6 (8 pts), ternaries 6, boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 190, 182, 282, …). 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.
image-diff-view.ImageDiffView (cognitive 24) src/components/diff/image-diff-view.tsx:150— image-diff-view.ImageDiffView has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 8, boolean chains 6 (nesting depth added 3). Of this number, 15 points are the body's own statements and 9 belong to 4 function literals 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.
aux-panel.AuxPanel (cognitive 24) src/components/layout/aux-panel.tsx:107— aux-panel.AuxPanel has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 6, if/else 3, match/switch 1 (nesting depth added 1). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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.
git-log-branch-filter-list.GitLogBranchFilterList::renderRow (cognitive 24) src/components/layout/git-log-branch-filter-list.tsx:392— git-log-branch-filter-list.GitLogBranchFilterList::renderRow has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 6, if/else 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.
status-bar-computer.ComputerPopover (cognitive 24) src/components/layout/status-bar-computer.tsx:173— status-bar-computer.ComputerPopover has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, error handling 4, ternaries 3, if/else 1. Of this number, 18 points are the body's own statements and 6 belong to 8 function items inside it that branch. 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.
activity-row.ActivityRow (cognitive 24) src/components/message/activity/activity-row.tsx:59— activity-row.ActivityRow has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 9, if/else 4 (nesting depth added 1). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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.
live-turn-stats.extractEditStats (cognitive 24) src/components/message/live-turn-stats.tsx:165— live-turn-stats.extractEditStats has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, if/else 3 (7 pts), loops 1 (2 pts) (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.
custom-style-section.CustomStyleSection (cognitive 24) src/components/settings/custom-style-section.tsx:157— custom-style-section.CustomStyleSection has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, ternaries 7, if/else 6, error handling 1, loops 1. Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 252, 214, 221, …). 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.
assistants-panel.AssistantsPanel (cognitive 24) src/components/settings/assistants-panel.tsx:145— assistants-panel.AssistantsPanel has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 6 (7 pts), boolean chains 5 (nesting depth added 3). Of this number, 15 points are the body's own statements and 9 belong to 6 function literals 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.
task-row.TaskRow (cognitive 24) src/components/tasks/task-row.tsx:90— task-row.TaskRow has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 9, if/else 2 (nesting depth added 3). Of this number, 21 points are the body's own statements and 3 belong to one function literal 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.
app-workspace-context.AppWorkspaceProvider (cognitive 24) src/contexts/app-workspace-context.tsx:46— app-workspace-context.AppWorkspaceProvider has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 2, boolean chains 1, error handling 1 (nesting depth added 2). None of this is in the body itself: all 24 points belong to 10 function literals inside it that branch (lines 233, 143, 64, …). 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.
use-long-press-drag.useLongPressDrag (cognitive 24) src/hooks/use-long-press-drag.ts:20— use-long-press-drag.useLongPressDrag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 5 (nesting depth added 1). None of this is in the body itself: all 24 points belong to 8 function literals inside it that branch (lines 74, 164, 133, …). 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.
edit.parseApplyPatchDetailed (cognitive 24) src/lib/activity/edit.ts:49— edit.parseApplyPatchDetailed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 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.
tool-call-normalization.inferLiveToolName (cognitive 24) REDACTED:714— tool-call-normalization.inferLiveToolName has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 1, 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.
AutoProcessor::scan_into (cognitive 23) src-tauri/src/forge/auto/mod.rs:476— AutoProcessor::scan_into has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 5 (7 pts), loops 3 (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.
paginate.walk (cognitive 23) src-tauri/science/skills/paper-lookup/scripts/paginate.py:329— paginate.walk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (4 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.
_common._validate_scale (cognitive 23) src-tauri/science/skills/scholar-evaluation/scripts/_common.py:329— _common._validate_scale has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
image_metadata.inspect_svg (cognitive 23) src-tauri/science/skills/scientific-visualization/scripts/image_metadata.py:161— image_metadata.inspect_svg has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, error handling 2 (3 pts), ternaries 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-agent-access.BrowserAgentActivityControl::scrollList (cognitive 23) src/components/browser/browser-agent-access.tsx:387— browser-agent-access.BrowserAgentActivityControl::scrollList has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (21 pts), if/else 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
conversation-context-bar.ConversationFolderBranchPicker (cognitive 23) src/components/chat/conversation-context-bar.tsx:270— conversation-context-bar.ConversationFolderBranchPicker has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 7, boolean chains 5, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 287, 342, 381, …). 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.
image-preview.ImagePreview (cognitive 23) src/components/files/image-preview.tsx:41— image-preview.ImagePreview has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 7, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 96, 47, 86, …). 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.
goal-tool-call.GoalCard (cognitive 23) src/components/message/goal-tool-call.tsx:212— goal-tool-call.GoalCard has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 21, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
context-compaction-card.ContextCompactionCard (cognitive 23) src/components/message/context-compaction-card.tsx:181— context-compaction-card.ContextCompactionCard has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 5, if/else 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.
add-model-provider-dialog.AddModelProviderDialog (cognitive 23) src/components/settings/add-model-provider-dialog.tsx:50— add-model-provider-dialog.AddModelProviderDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, ternaries 6 (9 pts), boolean chains 3, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 131, 125, 86, …). 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.
workspace-background-market-dialog.WorkspaceBackgroundMarketDialog (cognitive 23) src/components/settings/workspace-background-market-dialog.tsx:175— workspace-background-market-dialog.WorkspaceBackgroundMarketDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (8 pts), boolean chains 5, error handling 2 (nesting depth added 4). Of this number, 12 points are the body's own statements and 11 belong to 5 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.
assistant-avatar-picker.AssistantAvatarPicker (cognitive 23) src/components/settings/assistant-avatar-picker.tsx:116— assistant-avatar-picker.AssistantAvatarPicker has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 6 (9 pts), boolean chains 4, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (onFile, a function literal at line 315, pickColor, …). 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.
computer-use-settings.DriverSection (cognitive 23) src/components/settings/computer-use-settings.tsx:149— computer-use-settings.DriverSection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 7, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 18 points are the body's own statements and 5 belong to 3 function items inside it that branch. 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.
close-request-dialog.CloseRequestDialog (cognitive 23) src/components/workspace/close-request-dialog.tsx:65— close-request-dialog.CloseRequestDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 6, ternaries 3, error handling 1, loops 1. Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 107, 136, 150, …). 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.
acp-connections-context.applyStreamingAction (cognitive 23) src/contexts/acp-connections-context.tsx:1719— acp-connections-context.applyStreamingAction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5 (nesting depth added 5). Of this number, 22 points are the body's own statements and 1 belongs 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.
codeg-mcp-tool.readTaskAck (cognitive 23) src/lib/codeg-mcp-tool.ts:382— codeg-mcp-tool.readTaskAck has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (7 pts), error handling 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.
delegation-card.interpretReport (cognitive 23) src/lib/delegation-card.ts:1309— delegation-card.interpretReport has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 3, if/else 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.
keyboard-shortcuts.parseShortcut (cognitive 23) src/lib/keyboard-shortcuts.ts:316— keyboard-shortcuts.parseShortcut has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 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.
plan-parse.parsePlanEntriesArray (cognitive 23) src/lib/plan-parse.ts:41— plan-parse.parsePlanEntriesArray has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 2 (4 pts), loops 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.
tool-call-normalization.normalizeUncached (cognitive 23) REDACTED:614— tool-call-normalization.normalizeUncached has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22 (23 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.
unified-diff-generator.buildUnifiedHunks (cognitive 23) src/lib/unified-diff-generator.ts:120— unified-diff-generator.buildUnifiedHunks has cognitive complexity 23 (threshold 15). Drivers by points: loops 7 (15 pts), ternaries 2 (4 pts), if/else 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
task-rounds.extractRounds (cognitive 23) src/lib/task-rounds.ts:41— task-rounds.extractRounds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 4 (9 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.
GoogleScholarSearcher.search (cognitive 22) src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:56— GoogleScholarSearcher.search has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (3 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.
check_process.check_process (cognitive 22) src-tauri/science/skills/scholar-evaluation/scripts/check_process.py:139— check_process.check_process has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (6 pts), ternaries 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.
page.PushPageInner (cognitive 22) src/app/push/page.tsx:26— page.PushPageInner has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 3, if/else 3, error handling 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 4 belong to 4 function literals 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.
picker.ensureOverlay (cognitive 22) src/browser-injected/picker.js:510— picker.ensureOverlay has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, error handling 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.
automations-page.AutomationDetail (cognitive 22) src/components/automations/automations-page.tsx:1078— automations-page.AutomationDetail has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 5, error handling 1 (nesting depth added 5). Of this number, 19 points are the body's own statements and 3 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.
sidebar.Sidebar (cognitive 22) src/components/layout/sidebar.tsx:172— sidebar.Sidebar has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9, if/else 7 (8 pts), boolean chains 5 (nesting depth added 1). Of this number, 13 points are the body's own statements and 9 belong to 10 function literals inside it that branch. 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.
use-timeline-window.useTimelineWindow.update (cognitive 22) src/components/message/activity/use-timeline-window.ts:364— use-timeline-window.useTimelineWindow.update has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 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.
reply-artifacts.ReplyArtifacts (cognitive 22) src/components/message/reply-artifacts.tsx:62— reply-artifacts.ReplyArtifacts has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, if/else 5 (6 pts), loops 1, ternaries 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 7 belong to 5 function items inside it that branch. 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.
message-list-view.extractMessageDelegationSources (cognitive 22) src/components/message/message-list-view.tsx:711— message-list-view.extractMessageDelegationSources has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
acp-agent-settings.comparePrerelease (cognitive 22) src/components/settings/acp-agent-settings.tsx:4206— acp-agent-settings.comparePrerelease has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (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.
required-agent-options.useRequiredOptionsGate.gate (cognitive 22) src/components/settings/required-agent-options.tsx:149— required-agent-options.useRequiredOptionsGate.gate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, ternaries 1 (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.
chart.ChartTooltipContent (cognitive 22) REDACTED:118— chart.ChartTooltipContent has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (9 pts), if/else 4 (nesting depth added 3). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 201, 148). 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.
mcp.mcpResultPayload (cognitive 22) src/lib/activity/mcp.ts:118— mcp.mcpResultPayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (8 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.
permission-request.extractContentText (cognitive 22) src/lib/permission-request.ts:566— permission-request.extractContentText has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-files.extractFilePaths (cognitive 22) REDACTED:560— session-files.extractFilePaths has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 22) src/browser-injected/helper.js:421— (anonymous) has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 4 (5 pts), error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MetadataExtractor.extract_from_arxiv (cognitive 21) src-tauri/science/skills/citation-management/scripts/extract_metadata.py:258— MetadataExtractor.extract_from_arxiv has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (8 pts), loops 1 (2 pts), error handling 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.
ScientificSchematicGenerator.review_image (cognitive 21) src-tauri/science/skills/scientific-schematics/scripts/generate_schematic_ai.py:373— ScientificSchematicGenerator.review_image has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (6 pts), boolean chains 5, loops 1 (2 pts), error handling 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.
page.CommitPageInner (cognitive 21) src/app/commit/page.tsx:28— page.CommitPageInner has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 3, boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 17 points are the body's own statements and 4 belong to 4 function literals 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.
page.MergePageInner (cognitive 21) src/app/merge/page.tsx:26— page.MergePageInner has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 3, boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 17 points are the body's own statements and 4 belong to 4 function literals 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.
use-composer-attachments.useComposerAttachments (cognitive 21) src/components/chat/composer/use-composer-attachments.ts:211— use-composer-attachments.useComposerAttachments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 1184, 1223, 1161, …). 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.
sidebar-conversation-grouping.applyLayoutMove (cognitive 21) src/components/conversations/sidebar-conversation-grouping.ts:643— sidebar-conversation-grouping.applyLayoutMove has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 6). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals 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.
branch-selector-list.BranchSelectorList::renderRow (cognitive 21) src/components/layout/branch-selector-list.tsx:601— branch-selector-list.BranchSelectorList::renderRow has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 5, if/else 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. This shape REPEATS in the file: one other method here (branch-selector-list.BranchSelectorList) 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.
activity-timeline.estimateItemHeight (cognitive 21) src/components/message/activity/activity-timeline.tsx:86— activity-timeline.estimateItemHeight has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (9 pts), ternaries 3 (7 pts), if/else 2 (4 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.
message-list-view.collectDelegationSources (cognitive 21) src/components/message/message-list-view.tsx:535— message-list-view.collectDelegationSources has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
add-chat-channel-dialog.AddChatChannelDialog (cognitive 21) src/components/settings/add-chat-channel-dialog.tsx:34— add-chat-channel-dialog.AddChatChannelDialog has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 5, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 75, 68). 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.
custom-css-dialog.CustomCssDialog (cognitive 21) src/components/settings/custom-css-dialog.tsx:34— custom-css-dialog.CustomCssDialog has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (7 pts), ternaries 3 (nesting depth added 1). Of this number, 14 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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.
assistants-panel.AssistantRow (cognitive 21) src/components/settings/assistants-panel.tsx:532— assistants-panel.AssistantRow has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 5, if/else 5 (nesting depth added 3). Of this number, 14 points are the body's own statements and 7 belong to 2 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.
computer-use-settings.MacPermissions (cognitive 21) src/components/settings/computer-use-settings.tsx:298— computer-use-settings.MacPermissions has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 6 (nesting depth added 7). Of this number, 11 points are the body's own statements and 10 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.
office-tools-settings.DetectionCard (cognitive 21) src/components/settings/office-tools-settings.tsx:89— office-tools-settings.DetectionCard has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 7 (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.
opencode-permissions-section.OpenCodePermissionsSection (cognitive 21) src/components/settings/opencode-permissions-section.tsx:103— opencode-permissions-section.OpenCodePermissionsSection has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (7 pts), if/else 3 (nesting depth added 1). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 135, 214, 172, …). 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.
task-deliver-pr-dialog.TaskDeliverPrDialog::submit (cognitive 21) src/components/tasks/task-deliver-pr-dialog.tsx:207— task-deliver-pr-dialog.TaskDeliverPrDialog::submit has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (17 pts), boolean chains 2, error handling 1, if/else 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. This shape REPEATS in the file: one other method here (task-deliver-pr-dialog.TaskDeliverPrDialog) 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.
describe-tool-call.describeCommand (cognitive 21) src/lib/activity/describe-tool-call.ts:340— describe-tool-call.describeCommand has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (17 pts), boolean chains 4 (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.
code-highlighter.requestHighlight (cognitive 21) src/lib/code-highlighter.ts:154— code-highlighter.requestHighlight has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, error handling 2 (3 pts), ternaries 3, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 179, 206, 188). 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.
collab-collapse.rewriteExecutionBlock (cognitive 21) src/lib/collab-collapse.ts:62— collab-collapse.rewriteExecutionBlock has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (6 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
permission-request.buildDiffPreviewFromChanges (cognitive 21) src/lib/permission-request.ts:211— permission-request.buildDiffPreviewFromChanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). Of this number, 17 points are the body's own statements and 4 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.
session-failures.mergeSessionFailures (cognitive 21) src/lib/session-failures.ts:52— session-failures.mergeSessionFailures has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-call-normalization.inferFromFreeformName (cognitive 21) REDACTED:208— tool-call-normalization.inferFromFreeformName has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. 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.
conversation-runtime-store.collectSteeredPersistedCopyIds (cognitive 21) src/stores/conversation-runtime-store.ts:4237— conversation-runtime-store.collectSteeredPersistedCopyIds has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 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.
extract_metadata.main (cognitive 20) src-tauri/science/skills/citation-management/scripts/extract_metadata.py:657— extract_metadata.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), error handling 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OpenAlexSearcher._normalise (cognitive 20) src-tauri/science/skills/citation-management/scripts/search_openalex.py:170— OpenAlexSearcher._normalise has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, if/else 4. 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.
validate_prediction_matrix.validate_matrix (cognitive 20) src-tauri/science/skills/hypothesis-generation/scripts/validate_prediction_matrix.py:124— validate_prediction_matrix.validate_matrix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
paginate._rxiv_parse (cognitive 20) src-tauri/science/skills/paper-lookup/scripts/paginate.py:112— paginate._rxiv_parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 3 (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.
generate_schematic.resolve_api_key (cognitive 20) src-tauri/science/skills/scientific-schematics/scripts/generate_schematic.py:43— generate_schematic.resolve_api_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate_schematic_ai._resolve_api_key (cognitive 20) src-tauri/science/skills/scientific-schematics/scripts/generate_schematic_ai.py:113— generate_schematic_ai._resolve_api_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.StashPageInner (cognitive 20) src/app/stash/page.tsx:22— page.StashPageInner has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 3, boolean chains 2 (nesting depth added 6). Of this number, 17 points are the body's own statements and 3 belong to 3 function literals 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.
helper.window.addEventListener("error") (cognitive 20) src/browser-injected/helper.js:421— helper.window.addEventListener("error") has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 3, error handling 1 (2 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.
json-tree.defaultExpanded (cognitive 20) src/components/ai-elements/json-tree.tsx:92— json-tree.defaultExpanded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), ternaries 1 (5 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.
cron-builder-dialog.CronBuilderBody (cognitive 20) src/components/automations/cron-builder-dialog.tsx:162— cron-builder-dialog.CronBuilderBody has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 14 (15 pts), if/else 3, boolean chains 2 (nesting depth added 1). Of this number, 15 points are the body's own statements and 5 belong to 4 function literals inside it that branch. 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.
automation-editor.AutomationEditor::submit (cognitive 20) src/components/automations/automation-editor.tsx:228— automation-editor.AutomationEditor::submit has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 5, boolean chains 4, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
use-reference-search.buildReferenceGroups (cognitive 20) src/components/chat/composer/use-reference-search.ts:105— use-reference-search.buildReferenceGroups has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). Of this number, 19 points are the body's own statements and 1 belongs 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.
conversation-tag-picker.ConversationTagPickerPanel (cognitive 20) src/components/conversations/conversation-tag-picker.tsx:183— conversation-tag-picker.ConversationTagPickerPanel has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 7 (nesting depth added 4). Of this number, 18 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.
conversation-manage-dialog.BranchFilterSelect (cognitive 20) src/components/conversations/conversation-manage-dialog.tsx:298— conversation-manage-dialog.BranchFilterSelect has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 4, if/else 3 (nesting depth added 2). Of this number, 13 points are the body's own statements and 7 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.
unified-diff-preview.toSplitRows (cognitive 20) src/components/diff/unified-diff-preview.tsx:571— unified-diff-preview.toSplitRows has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (7 pts), ternaries 2 (6 pts), if/else 2 (4 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.
unified-diff-preview.DiffFileSection (cognitive 20) src/components/diff/unified-diff-preview.tsx:922— unified-diff-preview.DiffFileSection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 7, if/else 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals 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.
forge-start-dialog.ForgeStartDialog (cognitive 20) src/components/forge/forge-start-dialog.tsx:95— forge-start-dialog.ForgeStartDialog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 3, error handling 1, match/switch 1 (nesting depth added 5). Of this number, 10 points are the body's own statements and 10 belong to 4 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.
forge-combine-dialog.ForgeCombineDialog (cognitive 20) src/components/forge/forge-combine-dialog.tsx:67— forge-combine-dialog.ForgeCombineDialog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 5, error handling 1, if/else 1, match/switch 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 10 belong to 4 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.
forge-issue-detail-sheet.ChangedFiles (cognitive 20) src/components/forge/forge-issue-detail-sheet.tsx:1523— forge-issue-detail-sheet.ChangedFiles has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 4, if/else 3 (4 pts), error handling 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 7 belong to 3 function literals 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.
merge-diff.computeLineDiff (cognitive 20) src/components/merge/merge-diff.ts:97— merge-diff.computeLineDiff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), ternaries 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.
merge-diff.buildResult (cognitive 20) src/components/merge/merge-diff.ts:308— merge-diff.buildResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 pts), ternaries 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.
use-row-pointing.useRowPointing (cognitive 20) src/components/message/activity/use-row-pointing.ts:38— use-row-pointing.useRowPointing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 8, ternaries 3. None of this is in the body itself: all 20 points belong to 8 function literals inside it that branch (lines 45, 58, 88, …). 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.
acp-agent-settings.parseTomlStringLiteral (cognitive 20) src/components/settings/acp-agent-settings.tsx:2353— acp-agent-settings.parseTomlStringLiteral has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (4 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edit-chat-channel-dialog.EditChatChannelDialog (cognitive 20) src/components/settings/edit-chat-channel-dialog.tsx:33— edit-chat-channel-dialog.EditChatChannelDialog has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). Of this number, 10 points are the body's own statements and 10 belong to 2 function literals inside it that branch. 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.
ai-elements-adapter.createMessageTurnAdapter.adapt (cognitive 20) src/lib/adapters/ai-elements-adapter.ts:2863— ai-elements-adapter.createMessageTurnAdapter.adapt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-device.fitDeviceFrame (cognitive 20) src/lib/browser/browser-device.ts:225— browser-device.fitDeviceFrame has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 5, loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 3 belong to 2 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.
delegation-card.codeModeToolsCallOpen (cognitive 20) src/lib/delegation-card.ts:543— delegation-card.codeModeToolsCallOpen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
delegation-card.matchingClose (cognitive 20) src/lib/delegation-card.ts:581— delegation-card.matchingClose has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, 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.
notify.notify (cognitive 20) src/lib/notify.ts:57— notify.notify has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 2, if/else 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.
search-output.parseSearchOutput (cognitive 20) src/lib/search-output.ts:79— search-output.parseSearchOutput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cli::parse_from (cognitive 19) src-tauri/src/cli/args.rs:51— Cli::parse_from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 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.
UserTurnFingerprint::from_response_item (cognitive 19) src-tauri/src/parsers/codex.rs:6490— UserTurnFingerprint::from_response_item has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 1 (3 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.
CitationValidator.verify_doi (cognitive 19) src-tauri/science/skills/citation-management/scripts/validate_citations.py:195— CitationValidator.verify_doi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_citations.main (cognitive 19) src-tauri/science/skills/citation-management/scripts/validate_citations.py:593— validate_citations.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (6 pts), boolean chains 2 (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.
picker.accessibleName (cognitive 19) src/browser-injected/picker.js:331— picker.accessibleName has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (3 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.
add-node-menu.AddFileSubmenu (cognitive 19) src/components/canvas/add-node-menu.tsx:377— add-node-menu.AddFileSubmenu has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 7, if/else 3 (nesting depth added 3). Of this number, 12 points are the body's own statements and 7 belong to 4 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.
async-task-row.AsyncTaskRow (cognitive 19) src/components/chat/async-task-row.tsx:66— async-task-row.AsyncTaskRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 6, if/else 3, match/switch 1 (nesting depth added 2). Of this number, 12 points are the body's own statements and 7 belong to 3 function literals 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.
composer-status-strips.useRetryLineText (cognitive 19) src/components/chat/composer-status-strips.tsx:82— composer-status-strips.useRetryLineText has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 6, if/else 2 (nesting depth added 2). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 84). 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.
from-prompt-blocks.blocksToRestoredDraft (cognitive 19) src/components/chat/composer/from-prompt-blocks.ts:44— from-prompt-blocks.blocksToRestoredDraft has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 1 (4 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.
move-conversation-dialog.MoveConversationDialog (cognitive 19) src/components/conversations/move-conversation-dialog.tsx:77— move-conversation-dialog.MoveConversationDialog has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 6, if/else 4, error handling 1. Of this number, 12 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
sidebar-conversation-grouping.selectRecentConversationsWithReuse (cognitive 19) src/components/conversations/sidebar-conversation-grouping.ts:345— sidebar-conversation-grouping.selectRecentConversationsWithReuse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file-path-breadcrumb.DirectoryTree (cognitive 19) src/components/files/file-path-breadcrumb.tsx:221— file-path-breadcrumb.DirectoryTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3 (4 pts), boolean chains 1, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 297, 241, 267, …). 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.
file-workspace-panel.computeLcsMatches (cognitive 19) src/components/files/file-workspace-panel.tsx:511— file-workspace-panel.computeLcsMatches has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (6 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.
html-preview.InlineHtmlPreview (cognitive 19) src/components/files/html-preview.tsx:140— html-preview.InlineHtmlPreview has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 7, if/else 2 (nesting depth added 2). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 177, 216, 202, …). 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.
forge-issue-detail-sheet.CommentThread (cognitive 19) src/components/forge/forge-issue-detail-sheet.tsx:281— forge-issue-detail-sheet.CommentThread has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 4 (5 pts), boolean chains 4, error handling 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 8 belong to 3 function literals 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.
forge-issue-detail-sheet.MergeBox (cognitive 19) src/components/forge/forge-issue-detail-sheet.tsx:2172— forge-issue-detail-sheet.MergeBox has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 5 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function literal 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.
remark-gitlab-images.remarkGitlabImages.<returned closure> (cognitive 19) src/components/forge/remark-gitlab-images.ts:37— remark-gitlab-images.remarkGitlabImages.<returned closure> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 1 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 6). None of this is in the body itself: all 19 points belong to 2 function literals inside it that branch (lines 44, 40). 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.
forge-new-issue-dialog.ForgeNewIssueDialog (cognitive 19) src/components/forge/forge-new-issue-dialog.tsx:50— forge-new-issue-dialog.ForgeNewIssueDialog has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 93, 119, 156, …). 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.
slide-slot.SlideSlot (cognitive 19) src/components/message/slide-slot.tsx:22— slide-slot.SlideSlot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 9. Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 43, 51, 64, …). 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.
mcp-row.McpRow (cognitive 19) src/components/message/activity/rows/mcp-row.tsx:45— mcp-row.McpRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 7, if/else 2 (nesting depth added 2). Of this number, 11 points are the body's own statements and 8 belong to 2 function literals 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.
conversation-message-nav.VirtualRows (cognitive 19) src/components/message/conversation-message-nav.tsx:353— conversation-message-nav.VirtualRows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (7 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 385, a function literal at line 411, a function literal at line 409, …). 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.
conversation-message-nav.MessageNavRow (cognitive 19) src/components/message/conversation-message-nav.tsx:730— conversation-message-nav.MessageNavRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 8, if/else 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.
live-turn-stats.parseApplyPatchStats (cognitive 19) src/components/message/live-turn-stats.tsx:129— live-turn-stats.parseApplyPatchStats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
create-project-dialog.CreateProjectDialog (cognitive 19) src/components/project-boot/shadcn/create-project-dialog.tsx:52— create-project-dialog.CreateProjectDialog has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 5, error handling 3, if/else 2 (nesting depth added 4). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (handleCreate, a function literal at line 222, a function literal at line 72, …). 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.
acp-agent-settings.buildGrokStructuredConfig (cognitive 19) src/components/settings/acp-agent-settings.tsx:3419— acp-agent-settings.buildGrokStructuredConfig has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 9, if/else 1. Of this number, 15 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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.
add-custom-agent-dialog.parseManualSpec (cognitive 19) src/components/settings/add-custom-agent-dialog.tsx:76— add-custom-agent-dialog.parseManualSpec has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (6 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pet-editor.PetEditor::handleSubmit (cognitive 19) src/components/settings/pet-editor.tsx:76— pet-editor.PetEditor::handleSubmit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-catalog-source.useCodexProviderList (cognitive 19) src/components/settings/codex-catalog-source.tsx:97— codex-catalog-source.useCodexProviderList has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7, if/else 5 (6 pts), boolean chains 5, error handling 1 (nesting depth added 1). Of this number, 11 points are the body's own statements and 8 belong to 2 function literals inside it that branch. 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.
charts.TrendChart (cognitive 19) src/components/token-usage/charts.tsx:86— charts.TrendChart has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (6 pts), if/else 5 (nesting depth added 1). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 123, 113, 206, …). 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.
deep-link-bootstrap.DeepLinkBootstrap (cognitive 19) src/components/workspace/deep-link-bootstrap.tsx:20— deep-link-bootstrap.DeepLinkBootstrap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 5, error handling 2 (3 pts), ternaries 2 (nesting depth added 1). None of this is in the body itself: all 19 points belong to 4 function literals inside it that branch (lines 58, 36, 50, …). 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.
remote-connection-context.RemoteConnectionGate (cognitive 19) src/contexts/remote-connection-context.tsx:127— remote-connection-context.RemoteConnectionGate has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 4. Of this number, 15 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
use-open-url-target.useOpenUrlTarget (cognitive 19) src/hooks/use-open-url-target.ts:128— use-open-url-target.useOpenUrlTarget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 6). None of this is in the body itself: all 19 points belong to 2 function literals inside it that branch (lines 137, 200). 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.
use-switch-to-branch.useSwitchToBranch (cognitive 19) src/hooks/use-switch-to-branch.ts:49— use-switch-to-branch.useSwitchToBranch has cognitive complexity 19 (threshold 15). Drivers by points: error handling 5 (11 pts), if/else 5 (7 pts), match/switch 1 (nesting depth added 8). None of this is in the body itself: all 19 points belong to 2 function literals inside it that branch (lines 58, 102). 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.
ai-elements-adapter.expandProposedPlanText (cognitive 19) src/lib/adapters/ai-elements-adapter.ts:627— ai-elements-adapter.expandProposedPlanText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
ai-elements-adapter.expandGoalUpdateText (cognitive 19) src/lib/adapters/ai-elements-adapter.ts:835— ai-elements-adapter.expandGoalUpdateText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3, ternaries 2 (3 pts), boolean chains 2 (nesting depth added 4). Of this number, 16 points are the body's own statements and 3 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.
types.parseCodexModelConfig (cognitive 19) src/lib/types.ts:5861— types.parseCodexModelConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function literal 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.
background-task.buildBackgroundTaskRows (cognitive 19) REDACTED:708— background-task.buildBackgroundTaskRows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 759, record). 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.
codeg-mcp-tool.parseCodegMcpToolCall (cognitive 19) src/lib/codeg-mcp-tool.ts:429— codeg-mcp-tool.parseCodegMcpToolCall has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 8 (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.
model-api-rates.resolveRate (cognitive 19) src/lib/model-api-rates.ts:227— model-api-rates.resolveRate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3, 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.
session-files.extractSessionFiles (cognitive 19) REDACTED:1157— session-files.extractSessionFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
canvas-store.applyChange (cognitive 19) src/stores/canvas-store.ts:91— canvas-store.applyChange has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (6 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 6). 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.
_tabular.audit_missingness_and_leakage (cognitive 18) src-tauri/science/skills/exploratory-data-analysis/scripts/_tabular.py:679— _tabular.audit_missingness_and_leakage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), ternaries 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jats_to_text.extract_metadata (cognitive 18) src-tauri/science/skills/paper-lookup/scripts/jats_to_text.py:158— jats_to_text.extract_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_common.write_json (cognitive 18) src-tauri/science/skills/scientific-brainstorming/scripts/_common.py:217— _common.write_json has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 4 (6 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.
act.clickAt (cognitive 18) browser-agent/src/act.ts:543— act.clickAt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, ternaries 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
streamdown-plugins.stripMathFencePad (cognitive 18) src/components/ai-elements/streamdown-plugins.ts:122— streamdown-plugins.stripMathFencePad has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
markdown-link.MarkdownLink (cognitive 18) src/components/ai-elements/markdown-link.tsx:66— markdown-link.MarkdownLink has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 1 belongs 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.
agent-config-section.snapshotLabels (cognitive 18) src/components/automations/agent-config-section.tsx:328— agent-config-section.snapshotLabels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
composer-invocations.useComposerInvocations.onKeyDown (cognitive 18) REDACTED:228— composer-invocations.useComposerInvocations.onKeyDown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals 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.
browser-bridge-view.BrowserBridgeView (cognitive 18) src/components/browser/browser-bridge-view.tsx:59— browser-bridge-view.BrowserBridgeView has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 3, if/else 3, error handling 1 (nesting depth added 2). Of this number, 10 points are the body's own statements and 8 belong to 5 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.
file-node.FileNode (cognitive 18) src/components/canvas/nodes/file-node.tsx:59— file-node.FileNode has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 5. Of this number, 10 points are the body's own statements and 8 belong to 7 function literals inside it that branch. 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-settings-picker.SessionSettingsPicker (cognitive 18) src/components/chat/session-settings-picker.tsx:64— session-settings-picker.SessionSettingsPicker has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 4, if/else 3 (nesting depth added 3). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 188, 92, 132, …). 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.
group-split-handle.GroupSplitHandle (cognitive 18) src/components/conversations/group-split-handle.tsx:24— group-split-handle.GroupSplitHandle has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 6, boolean chains 1 (nesting depth added 2). Of this number, 9 points are the body's own statements and 9 belong to 4 function literals 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.
diff-viewer.DiffViewer (cognitive 18) src/components/diff/diff-viewer.tsx:50— diff-viewer.DiffViewer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 80, 193, 134, …). 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.
forge-auto-settings.ForgeAutoActivity (cognitive 18) src/components/forge/forge-auto-settings.tsx:595— forge-auto-settings.ForgeAutoActivity has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 4, error handling 1 (nesting depth added 3). 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: 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.
forge-issue-detail-sheet.WorkflowApprovalStrip (cognitive 18) src/components/forge/forge-issue-detail-sheet.tsx:1177— forge-issue-detail-sheet.WorkflowApprovalStrip has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 1 (nesting depth added 6). Of this number, 16 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.
i18n-provider.AppI18nProvider (cognitive 18) src/components/i18n-provider.tsx:96— i18n-provider.AppI18nProvider has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, ternaries 4, boolean chains 2, error handling 1. Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 137, 218, 121, …). 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.
workspace-folder-dialog.LinkRow (cognitive 18) src/components/layout/workspace-folder-dialog.tsx:721— workspace-folder-dialog.LinkRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 3 (6 pts), boolean chains 4 (nesting depth added 5). Of this number, 12 points are the body's own statements and 6 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.
sidebar-section-order-control.SidebarSectionOrderControl (cognitive 18) src/components/layout/sidebar-section-order-control.tsx:51— sidebar-section-order-control.SidebarSectionOrderControl has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 4 (5 pts) (nesting depth added 1). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 107, label, a function literal at line 93, …). 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.
conflict-parser.parseConflictMarkers (cognitive 18) src/components/merge/conflict-parser.ts:18— conflict-parser.parseConflictMarkers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 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.
activity-row.ActivityMembers (cognitive 18) src/components/message/activity/activity-row.tsx:342— activity-row.ActivityMembers has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, if/else 3. Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
kimi-code-config-panel.validateKimiDraft (cognitive 18) src/components/settings/kimi-code-config-panel.tsx:378— kimi-code-config-panel.validateKimiDraft has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 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.
acp-agent-settings.patchEnvText (cognitive 18) src/components/settings/acp-agent-settings.tsx:621— acp-agent-settings.patchEnvText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 3 (5 pts), ternaries 3 (5 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.
pet-importer.PetImporter (cognitive 18) src/components/settings/pet-importer.tsx:26— pet-importer.PetImporter has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6, boolean chains 2, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (toggle, toggleAll, handleImport, …). 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.
required-agent-options.useRequiredOptionsGate (cognitive 18) src/components/settings/required-agent-options.tsx:72— required-agent-options.useRequiredOptionsGate has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 7 (8 pts), if/else 1 (nesting depth added 1). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. 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.
custom-agent-skills-toggle.CustomAgentSkillsToggle (cognitive 18) src/components/settings/custom-agent-skills-toggle.tsx:40— custom-agent-skills-toggle.CustomAgentSkillsToggle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 80, 100, 56). 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.
model-provider-settings.ModelProviderSettings (cognitive 18) src/components/settings/model-provider-settings.tsx:38— model-provider-settings.ModelProviderSettings has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6 (7 pts), error handling 2 (nesting depth added 5). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 69, 49, 64, …). 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.
science-settings.ScienceBody (cognitive 18) src/components/settings/science-settings.tsx:39— science-settings.ScienceBody has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (5 pts), boolean chains 3, match/switch 2, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 145, 56, 71, …). 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.
task-message-composer.TaskMessageComposer (cognitive 18) src/components/tasks/task-message-composer.tsx:133— task-message-composer.TaskMessageComposer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 211, 200, 261, …). 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.
task-schedule-dialog.TaskScheduleDialog (cognitive 18) src/components/tasks/task-schedule-dialog.tsx:77— task-schedule-dialog.TaskScheduleDialog has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 5, if/else 4, error handling 1 (nesting depth added 1). Of this number, 9 points are the body's own statements and 9 belong to 5 function items inside it that branch. 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.
acp-connections-context.mergePermissionToolCallWithLiveInfo (cognitive 18) src/contexts/acp-connections-context.tsx:1323— acp-connections-context.mergePermissionToolCallWithLiveInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
command.commandOutputFromJsonString (cognitive 18) src/lib/activity/command.ts:147— command.commandOutputFromJsonString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 2, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
feedback-check.parseFeedbackCheckOutcome (cognitive 18) src/lib/feedback-check.ts:92— feedback-check.parseFeedbackCheckOutcome has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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.
mention-panel-prefs.parseMentionPanelPrefs (cognitive 18) src/lib/mention-panel-prefs.ts:82— mention-panel-prefs.parseMentionPanelPrefs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 6). Of this number, 14 points are the body's own statements and 4 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.
session-files.findStringFieldDeep (cognitive 18) REDACTED:136— session-files.findStringFieldDeep has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 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.
session-files.parseApplyPatchSections (cognitive 18) REDACTED:407— session-files.parseApplyPatchSections has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 4 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.
text-token-at.trimWrappers (cognitive 18) src/lib/text-token-at.ts:143— text-token-at.trimWrappers has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), boolean chains 4, if/else 1 (4 pts) (nesting depth added 8). 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.
conversation-runtime-store.mainProseContinuations (cognitive 18) src/stores/conversation-runtime-store.ts:1058— conversation-runtime-store.mainProseContinuations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, 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.
conversation-runtime-store.sameBuiltValue (cognitive 18) src/stores/conversation-runtime-store.ts:1695— conversation-runtime-store.sameBuiltValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
conversation-runtime-store.collectInFlightPersistedToolCalls (cognitive 18) src/stores/conversation-runtime-store.ts:3856— conversation-runtime-store.collectInFlightPersistedToolCalls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 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.
anchorFrom (cognitive 18) src/browser-injected/helper.js:150— anchorFrom has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (6 pts), error handling 2 (3 pts), 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.
Builder::push (cognitive 17) src-tauri/src/commands/workspace_file_search.rs:273— Builder::push has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, match/switch 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.
ResponseItemPromotion::note_record (cognitive 17) src-tauri/src/parsers/codex.rs:6697— ResponseItemPromotion::note_record has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 1 (2 pts), match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HermesParser::load_sqlite_messages (cognitive 17) src-tauri/src/parsers/hermes.rs:234— HermesParser::load_sqlite_messages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TerminalManager::spawn_with_id (cognitive 17) src-tauri/src/terminal/manager.rs:438— TerminalManager::spawn_with_id has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetadataExtractor.extract_from_doi (cognitive 17) src-tauri/science/skills/citation-management/scripts/extract_metadata.py:120— MetadataExtractor.extract_from_doi has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 4, if/else 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PubMedSearcher.fetch_metadata (cognitive 17) src-tauri/science/skills/citation-management/scripts/search_pubmed.py:124— PubMedSearcher.fetch_metadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CitationValidator.detect_duplicates (cognitive 17) src-tauri/science/skills/citation-management/scripts/validate_citations.py:258— CitationValidator.detect_duplicates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (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.
audit_evidence_ledger.audit (cognitive 17) src-tauri/science/skills/hypothesis-generation/scripts/audit_evidence_ledger.py:228— audit_evidence_ledger.audit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (7 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.
arxiv_atom.main (cognitive 17) src-tauri/science/skills/paper-lookup/scripts/arxiv_atom.py:134— arxiv_atom.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, error handling 2, loops 1, ternaries 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.
openalex_abstract.reconstruct (cognitive 17) src-tauri/science/skills/paper-lookup/scripts/openalex_abstract.py:30— openalex_abstract.reconstruct 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.
figure_export.save_for_journal (cognitive 17) src-tauri/science/skills/scientific-visualization/scripts/figure_export.py:466— figure_export.save_for_journal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 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.
assumption_checks.check_regression_diagnostics (cognitive 17) src-tauri/science/skills/statistical-analysis/scripts/assumption_checks.py:251— assumption_checks.check_regression_diagnostics has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, 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.
act.isParkedOutsideTheDocument (cognitive 17) browser-agent/src/act.ts:215— act.isParkedOutsideTheDocument has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), loops 1 (nesting depth added 4). 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.
remark-cjk-autolink-tail.isTrail (cognitive 17) src/components/ai-elements/remark-cjk-autolink-tail.ts:60— remark-cjk-autolink-tail.isTrail 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.
automations-page.AutomationListItem (cognitive 17) src/components/automations/automations-page.tsx:796— automations-page.AutomationListItem has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 3 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs 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.
use-composer-attachments.useComposerAttachments.uploadAndAppendFiles (cognitive 17) src/components/chat/composer/use-composer-attachments.ts:443— use-composer-attachments.useComposerAttachments.uploadAndAppendFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 6). 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 literal inside it that branches (line 468). 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.
web-connection-guard.WebConnectionGuard (cognitive 17) src/components/connection/web-connection-guard.tsx:41— web-connection-guard.WebConnectionGuard has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 4, boolean chains 3 (nesting depth added 3). Of this number, 14 points are the body's own statements and 3 belong to 3 function literals 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.
conversation-detail-panel.ConversationDetailPanel::renderTabWrapper (cognitive 17) src/components/conversations/conversation-detail-panel.tsx:2992— conversation-detail-panel.ConversationDetailPanel::renderTabWrapper has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (8 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.
branch-selector-list.BranchSelectorList (cognitive 17) src/components/layout/branch-selector-list.tsx:182— branch-selector-list.BranchSelectorList has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 21 (34 pts), if/else 22 (26 pts), boolean chains 21, match/switch 4 (5 pts), 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. This shape REPEATS in the file: one other method here (branch-selector-list.BranchSelectorList::renderRow) 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.
commit-dialog.buildFileTree (cognitive 17) src/components/layout/commit-dialog.tsx:118— commit-dialog.buildFileTree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). Of this number, 14 points are the body's own statements and 3 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.
commit-untracked-files-dialog.CommitUntrackedFilesDialog (cognitive 17) src/components/layout/commit-untracked-files-dialog.tsx:37— commit-untracked-files-dialog.CommitUntrackedFilesDialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 5 (nesting depth added 1). Of this number, 9 points are the body's own statements and 8 belong to 5 function literals inside it that branch. 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.
unstash-dialog.buildFileTree (cognitive 17) src/components/layout/unstash-dialog.tsx:79— unstash-dialog.buildFileTree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). Of this number, 14 points are the body's own statements and 3 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.
use-agent-call-model.parseTaskOutcomeEnvelope (cognitive 17) src/components/message/use-agent-call-model.ts:67— use-agent-call-model.parseTaskOutcomeEnvelope has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 1 (2 pts), error handling 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.
plan-mode-card.usePlanModeMarker (cognitive 17) src/components/message/plan-mode-card.tsx:125— plan-mode-card.usePlanModeMarker has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 6). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 143). 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.
add-forge-account-dialog.AddForgeAccountDialog (cognitive 17) src/components/settings/add-forge-account-dialog.tsx:115— add-forge-account-dialog.AddForgeAccountDialog has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 5, if/else 3, error handling 2 (nesting depth added 1). Of this number, 10 points are the body's own statements and 7 belong to 4 function literals inside it that branch. 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.
agent-diagnostics-dialog.AgentDiagnosticsDialog (cognitive 17) src/components/settings/agent-diagnostics-dialog.tsx:108— agent-diagnostics-dialog.AgentDiagnosticsDialog has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 3 (5 pts), if/else 4, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 118, verdictLabel, a function literal at line 131, …). 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.
settings-section.SettingsSection (cognitive 17) src/components/shared/settings-section.tsx:81— settings-section.SettingsSection has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 2, if/else 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.
task-restart-dialog.TaskRestartDialog (cognitive 17) src/components/tasks/task-restart-dialog.tsx:55— task-restart-dialog.TaskRestartDialog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (6 pts), boolean chains 1, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (submit, a function literal at line 76). 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.
delegation-context.DelegationProvider (cognitive 17) src/contexts/delegation-context.tsx:133— delegation-context.DelegationProvider has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4, ternaries 1 (2 pts) (nesting depth added 4). None of this is in the body itself: all 17 points belong to 7 function literals inside it that branch (lines 295, 306, 285, …). 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.
tasks-view-context.notifyFlips (cognitive 17) src/contexts/tasks-view-context.tsx:170— tasks-view-context.notifyFlips has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (7 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.
command.extractCommandFromUnknownInput (cognitive 17) src/lib/activity/command.ts:50— command.extractCommandFromUnknownInput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
command.commandFromUnknownValue (cognitive 17) src/lib/activity/command.ts:84— command.commandFromUnknownValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals 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.
edit.extractApplyPatchTextFromUnknownInput (cognitive 17) src/lib/activity/edit.ts:138— edit.extractApplyPatchTextFromUnknownInput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exit-meaning.decidingCommand (cognitive 17) src/lib/activity/exit-meaning.ts:278— exit-meaning.decidingCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 4, ternaries 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.
code-mode.codeModeCalls (cognitive 17) src/lib/activity/code-mode.ts:86— code-mode.codeModeCalls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 4, 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.
describe-tool-call.toolStepKind (cognitive 17) src/lib/activity/describe-tool-call.ts:98— describe-tool-call.toolStepKind has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, ternaries 3 (6 pts), match/switch 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.
build-activity.linkLaterDelegationPolls (cognitive 17) src/lib/activity/build-activity.ts:206— build-activity.linkLaterDelegationPolls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 5). None of this is in the body itself: all 17 points belong to 2 function items inside it that branch (a function literal at line 215, tasksIn). 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.
ai-elements-adapter.markdownCodeSpans (cognitive 17) src/lib/adapters/ai-elements-adapter.ts:485— ai-elements-adapter.markdownCodeSpans has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-agent-grant.applyDefaultAgentGrant (cognitive 17) src/lib/browser/browser-agent-grant.ts:129— browser-agent-grant.applyDefaultAgentGrant has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
canvas-view-storage.parseDraft (cognitive 17) src/lib/canvas-view-storage.ts:302— canvas-view-storage.parseDraft has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 3 (4 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.
delegation-status.findTaskIds (cognitive 17) src/lib/delegation-status.ts:321— delegation-status.findTaskIds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
keyboard-shortcuts.normalizeSettings (cognitive 17) src/lib/keyboard-shortcuts.ts:264— keyboard-shortcuts.normalizeSettings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs 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.
kimi-mcp-oauth.updateKimiMcpOAuth (cognitive 17) src/lib/kimi-mcp-oauth.ts:110— kimi-mcp-oauth.updateKimiMcpOAuth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tab-group-layout.computeRects (cognitive 17) src/lib/tab-group-layout.ts:349— tab-group-layout.computeRects has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 2, boolean chains 1 (nesting depth added 5). None of this is in the body itself: all 17 points belong to 3 function items inside it that branch (a function literal at line 371, walk, a function literal at line 366). 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.
window-attention.requestWindowAttention (cognitive 17) src/lib/window-attention.ts:181— window-attention.requestWindowAttention has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 2, 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.
canvas-store.useCanvasStore (cognitive 17) src/stores/canvas-store.ts:171— canvas-store.useCanvasStore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, loops 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 7 function literals inside it that branch (lines 199, 234, 249, …). 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.
conversation-runtime-store.keepUnchangedStreamingTurns (cognitive 17) src/stores/conversation-runtime-store.ts:1733— conversation-runtime-store.keepUnchangedStreamingTurns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 9). Of this number, 11 points are the body's own statements and 6 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.
folder-tabs-store.useFolderTabsStore (cognitive 17) src/stores/folder-tabs-store.ts:75— folder-tabs-store.useFolderTabsStore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, ternaries 5 (6 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 7 function literals inside it that branch (lines 106, 90, 119, …). 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.
formatArgs (cognitive 17) src/browser-injected/console.js:355— formatArgs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 363). 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.
Standalone::until_ready (cognitive 16) src-tauri/src/cli/standalone.rs:168— Standalone::until_ready has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (6 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.
figure_export._atomic_savefig (cognitive 16) src-tauri/science/skills/scientific-visualization/scripts/figure_export.py:97— figure_export._atomic_savefig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 4 (5 pts), boolean chains 3 (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.
power.mde (cognitive 16) src-tauri/science/skills/statistical-power/scripts/power.py:344— power.mde has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 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.
usePetSessions.usePetSessions (cognitive 16) src/app/pet/_hooks/usePetSessions.ts:43— usePetSessions.usePetSessions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, loops 1. None of this is in the body itself: all 16 points belong to 9 function literals inside it that branch (lines 83, 64, 73, …). 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.
picker.owns (cognitive 16) src/browser-injected/picker.js:660— picker.owns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
remark-cjk-autolink-tail.autolinkEnd (cognitive 16) src/components/ai-elements/remark-cjk-autolink-tail.ts:94— remark-cjk-autolink-tail.autolinkEnd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
composer-invocations.ComposerInvocationsPopup (cognitive 16) REDACTED:297— composer-invocations.ComposerInvocationsPopup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 4. Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 365, 324, 322, …). 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.
browser-status-layer.noticeText (cognitive 16) src/components/browser/browser-status-layer.tsx:54— browser-status-layer.noticeText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (7 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.
conversation-context-bar.ConversationHeaderFolderPicker (cognitive 16) src/components/chat/conversation-context-bar.tsx:116— conversation-context-bar.ConversationHeaderFolderPicker has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 4, if/else 3, error handling 2. Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
pi-project-trust-banner.PiProjectTrustBanner::decide (cognitive 16) src/components/chat/pi-project-trust-banner.tsx:193— pi-project-trust-banner.PiProjectTrustBanner::decide has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 5 (6 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (pi-project-trust-banner.PiProjectTrustBanner) 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.
quick-actions.QuickActions (cognitive 16) src/components/chat/quick-actions.tsx:374— quick-actions.QuickActions has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (5 pts), if/else 4 (nesting depth added 1). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 421, 463, 387, …). 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.
selector-tooltip.SelectorTooltip (cognitive 16) src/components/chat/selector-tooltip.tsx:69— selector-tooltip.SelectorTooltip has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 6, if/else 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs 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.
conversation-tag-form-dialog.TagFormBody (cognitive 16) src/components/conversations/conversation-tag-form-dialog.tsx:190— conversation-tag-form-dialog.TagFormBody has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 3, boolean chains 2, error handling 1 (nesting depth added 2). Of this number, 10 points are the body's own statements and 6 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.
conversation-tags-manager.ConversationTagsManagerDialog (cognitive 16) src/components/conversations/conversation-tags-manager.tsx:285— conversation-tags-manager.ConversationTagsManagerDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 5, boolean chains 4. Of this number, 8 points are the body's own statements and 8 belong to 4 function literals inside it that branch. 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.
compact-diff.CompactDiff (cognitive 16) src/components/diff/compact-diff.tsx:276— compact-diff.CompactDiff has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 3, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 358, 296, 300, …). 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.
pattern-list-input.PatternListInput (cognitive 16) src/components/forge/pattern-list-input.tsx:25— pattern-list-input.PatternListInput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3, boolean chains 2, loops 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (commit, a function literal at line 125, a function literal at line 104, …). 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.
command-rows.CommandGroupRow (cognitive 16) src/components/message/activity/rows/command-rows.tsx:641— command-rows.CommandGroupRow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 7 (8 pts) (nesting depth added 1). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
edit-row.EditDiff (cognitive 16) src/components/message/activity/rows/edit-row.tsx:175— edit-row.EditDiff has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 7, if/else 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to 3 function items inside it that branch. 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.
file-reference-actions.FileReferenceActionsMenu (cognitive 16) src/components/message/file-reference-actions.tsx:108— file-reference-actions.FileReferenceActionsMenu has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, error handling 2, ternaries 2. Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 152, handleDownload, a function literal at line 123, …). 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.
json-render-charts.barRadius (cognitive 16) src/components/message/json-render-charts.tsx:143— json-render-charts.barRadius has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 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.
message-list-view.HistoricalMessageGroup (cognitive 16) src/components/message/message-list-view.tsx:1289— message-list-view.HistoricalMessageGroup has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
deepseek-model-list-editor.validateDeepSeekModels (cognitive 16) src/components/settings/deepseek-model-list-editor.tsx:71— deepseek-model-list-editor.validateDeepSeekModels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
acp-agent-settings.extractImportantConfigValues (cognitive 16) src/components/settings/acp-agent-settings.tsx:1213— acp-agent-settings.extractImportantConfigValues has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 13 (15 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.
acp-agent-settings.patchCodexConfigTomlText (cognitive 16) src/components/settings/acp-agent-settings.tsx:3313— acp-agent-settings.patchCodexConfigTomlText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
codex-catalog-source.CodexProviderListSummary (cognitive 16) src/components/settings/codex-catalog-source.tsx:392— codex-catalog-source.CodexProviderListSummary has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6, 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.
computer-settings.BlocklistRow (cognitive 16) src/components/settings/computer-settings.tsx:667— computer-settings.BlocklistRow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, 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 4 function items inside it that branch (add, a function literal at line 812, nameOf, …). 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.
opencode-connect-dialog.OpenCodeCustomProviderDialog (cognitive 16) src/components/settings/opencode-connect-dialog.tsx:484— opencode-connect-dialog.OpenCodeCustomProviderDialog has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 5, ternaries 3 (4 pts), error handling 1, match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (handleSubmit, handleOpenChange, a function literal at line 542, …). 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.
use-file-tree.useFileTree (cognitive 16) src/hooks/use-file-tree.ts:39— use-file-tree.useFileTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 2, error handling 1 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 85, 64). 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.
json.findStringFieldDeep (cognitive 16) REDACTED:38— json.findStringFieldDeep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 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.
edit.changedLineRangeFromUnifiedDiff (cognitive 16) src/lib/activity/edit.ts:387— edit.changedLineRangeFromUnifiedDiff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exit-meaning.readCommandExit (cognitive 16) src/lib/activity/exit-meaning.ts:482— exit-meaning.readCommandExit has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 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.
build-activity.replyAnchor (cognitive 16) src/lib/activity/build-activity.ts:156— build-activity.replyAnchor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
code-highlighter.startHighlight (cognitive 16) src/lib/code-highlighter.ts:277— code-highlighter.startHighlight has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
delegation-card.skipJsWsAndComments (cognitive 16) src/lib/delegation-card.ts:368— delegation-card.skipJsWsAndComments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 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.
export-conversation.blocksToHtml (cognitive 16) src/lib/export-conversation.ts:234— export-conversation.blocksToHtml has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 7). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 236). 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.
markdown-local-image.resolveLocalImage (cognitive 16) src/lib/markdown-local-image.ts:67— markdown-local-image.resolveLocalImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
message-input-draft.sweepOrphanDraftKeys (cognitive 16) src/lib/message-input-draft.ts:198— message-input-draft.sweepOrphanDraftKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (5 pts), error handling 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (run). 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.
model-label-store.normalize (cognitive 16) src/lib/model-label-store.ts:65— model-label-store.normalize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-files.extractPatchTextFromInputPreview (cognitive 16) REDACTED:374— session-files.extractPatchTextFromInputPreview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update-check-storage.readLastCheck (cognitive 16) src/lib/update-check-storage.ts:50— update-check-storage.readLastCheck has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 4, if/else 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
conversation-runtime-store.alignRoundStats (cognitive 16) src/stores/conversation-runtime-store.ts:1887— conversation-runtime-store.alignRoundStats 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.
tab-store.useFolderTabsStore.subscribe() (cognitive 16) src/stores/tab-store.ts:3641— tab-store.useFolderTabsStore.subscribe() has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: smoke.rs → surface.rs, browser-events-bridge.tsx, browser-api.ts src-tauri/src/browser/smoke.rs— `src-tauri/src/browser/smoke.rs` changes together with 3 other files — `src-tauri/src/browser/surface.rs`, `src/components/browser/browser-events-bridge.tsx`, `src/lib/browser/browser-api.ts` — 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· Near-duplicate member family (8 members, 28 shared lines) · ×1
Near-duplicate member family (8 members, 28 shared lines) src-tauri/src/parsers/codebuddy.rs:1319— src-tauri/src/parsers/codebuddy.rs:1319-1394 | src-tauri/src/parsers/codex.rs:7162-7239 | src-tauri/src/parsers/gemini.rs:1000-1082 | src-tauri/src/parsers/hermes.rs:785-859 | src-tauri/src/parsers/kimi_code.rs:1310-1385 | src-tauri/src/parsers/openclaw.rs:1103-1174 | REDACTED:2295-2371 | src-tauri/src/parsers/pi.rs:1448-1523 — These 8 members are variants of one another: a block of 28 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 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 8 shared lines) · ×1
Near-duplicate member family (4 members, 8 shared lines) src-tauri/src/commands/windows.rs:654— src-tauri/src/commands/windows.rs:654-705 | src-tauri/src/commands/windows.rs:986-1040 | src-tauri/src/commands/windows.rs:1109-1155 | src-tauri/src/commands/windows.rs:1174-1254 — These 4 members are variants of one another: a block of 8 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member pair (60 shared lines) src-tauri/src/acp/connection.rs:10563— src-tauri/src/acp/connection.rs:10563-10694 | src-tauri/src/acp/connection.rs:10726-10833 — These two members are variants of one another: 60 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 (52 shared lines) src-tauri/src/web/mod.rs:612— src-tauri/src/web/mod.rs:612-717 | src-tauri/src/web/mod.rs:845-1074 — These two members are variants of one another: 52 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) src-tauri/src/parsers/claude.rs:3687— src-tauri/src/parsers/claude.rs:3687-3737 | src-tauri/src/parsers/qoder.rs:1649-1697 — 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 (39 shared lines) src-tauri/src/commands/acp.rs:13127— src-tauri/src/commands/acp.rs:13127-13221 | src-tauri/src/commands/acp.rs:13424-13590 — These two members are variants of one another: 39 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) src-tauri/src/commands/folders.rs:5556— src-tauri/src/commands/folders.rs:5556-5624 | src-tauri/src/commands/folders.rs:5655-5739 — 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.
D4 · Code Duplication· Edited copy of a member (504 corresponding lines) · ×1
Edited copy of a member (504 corresponding lines) src-tauri/src/acp/delegation/broker.rs:2484— src-tauri/src/acp/delegation/broker.rs:2484-3135 | src-tauri/src/acp/delegation/broker.rs:4288-4791 — These two members are one piece of code written twice and then edited apart: 504 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (95 corresponding lines) · ×1
Edited copy of a member (95 corresponding lines) src-tauri/src/commands/mcp.rs:1599— src-tauri/src/commands/mcp.rs:1599-1737 | src-tauri/src/commands/mcp.rs:4148-4242 — These two members are one piece of code written twice and then edited apart: 95 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (120 corresponding lines) · ×1
Edited copy of a member (120 corresponding lines) src-tauri/src/commands/project_boot.rs:141— src-tauri/src/commands/project_boot.rs:141-260 | src-tauri/src/commands/project_boot.rs:495-625 — These two members are one piece of code written twice and then edited apart: 120 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (81 corresponding lines) · ×1
Edited copy of a member (81 corresponding lines) src-tauri/src/db/service/work_task_service.rs:2209— src-tauri/src/db/service/work_task_service.rs:2209-2310 | src-tauri/src/db/service/work_task_service.rs:2461-2541 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (72 corresponding lines) · ×1
Edited copy of a member (72 corresponding lines) src-tauri/src/commands/experts.rs:608— src-tauri/src/commands/experts.rs:608-679 | src-tauri/src/commands/science.rs:426-498 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (83 corresponding lines) · ×1
Edited copy of a member (83 corresponding lines) src-tauri/src/acp/connection.rs:10310— src-tauri/src/acp/connection.rs:10310-10394 | src-tauri/src/acp/connection.rs:10949-11031 — These two members are one piece of code written twice and then edited apart: 83 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) src-tauri/src/computer/targets.rs:1240— src-tauri/src/computer/targets.rs:1240-1280 | src-tauri/src/computer/targets.rs:1393-1435 — 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 (57 corresponding lines) · ×1
Edited copy of a member (57 corresponding lines) src-tauri/src/commands/folders.rs:4685— src-tauri/src/commands/folders.rs:4685-4741 | src-tauri/src/commands/folders.rs:4761-4820 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) src-tauri/src/forge/gitea.rs:64— src-tauri/src/forge/gitea.rs:64-122 | src-tauri/src/forge/gitlab.rs:164-246 — 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) src-tauri/src/acp/manager.rs:4755— src-tauri/src/acp/manager.rs:4755-4815 | src-tauri/src/acp/manager.rs:4885-4953 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 55+ corresponding lines) · ×1
Edited copies of one member (3 members, 55+ corresponding lines) src-tauri/src/db/migration/m20260219_000001_folder_command.rs:8— src-tauri/src/db/migration/m20260219_000001_folder_command.rs:8-62 | src-tauri/src/db/migration/m20260401_000001_chat_channel_sender_context.rs:8-92 | src-tauri/src/db/migration/m20261022_000001_tool_approval.rs:8-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 55 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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, 39+ corresponding lines) · ×1
Edited copies of one member (5 members, 39+ corresponding lines) src-tauri/src/db/service/work_task_service.rs:2579— src-tauri/src/db/service/work_task_service.rs:2579-2626 | src-tauri/src/db/service/work_task_service.rs:2644-2686 | src-tauri/src/db/service/work_task_service.rs:2704-2742 | src-tauri/src/db/service/work_task_service.rs:2754-2797 | src-tauri/src/db/service/work_task_service.rs:2845-2895 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) src-tauri/src/parsers/hermes.rs:508— src-tauri/src/parsers/hermes.rs:508-547 | REDACTED:101-140 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 69+ corresponding lines) · ×1
Edited copies of one member (3 members, 69+ corresponding lines) src-tauri/src/db/migration/m20260513_000001_remote_workspace_connection.rs:8— src-tauri/src/db/migration/m20260513_000001_remote_workspace_connection.rs:8-76 | src-tauri/src/db/migration/m20260803_000001_folder_link.rs:8-78 | src-tauri/src/db/migration/m20260829_000001_folder_group.rs:8-88 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 69 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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) src-tauri/src/commands/custom_skills.rs:411— src-tauri/src/commands/custom_skills.rs:411-441 | src-tauri/src/commands/experts.rs:916-961 | src-tauri/src/commands/office_tools.rs:1170-1206 | src-tauri/src/commands/science.rs:739-780 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) src-tauri/src/db/migration/m20260226_000001_agent_setting.rs:8— src-tauri/src/db/migration/m20260226_000001_agent_setting.rs:8-69 | src-tauri/src/db/migration/m20260726_000001_custom_agent.rs:8-62 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 40+ corresponding lines) · ×1
Edited copies of one member (3 members, 40+ corresponding lines) src-tauri/src/forge/cnb.rs:188— src-tauri/src/forge/cnb.rs:188-236 | src-tauri/src/forge/gitea.rs:146-185 | src-tauri/src/forge/gitlab.rs:264-308 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 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) src-tauri/src/db/service/work_task_service.rs:1629— src-tauri/src/db/service/work_task_service.rs:1629-1664 | src-tauri/src/db/service/work_task_service.rs:1674-1703 | src-tauri/src/db/service/work_task_service.rs:1754-1793 | src-tauri/src/db/service/work_task_service.rs:2167-2191 — 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 (5 members, 25+ corresponding lines) · ×1
Edited copies of one member (5 members, 25+ corresponding lines) src-tauri/src/commands/mcp.rs:2967— src-tauri/src/commands/mcp.rs:2967-2991 | src-tauri/src/commands/mcp.rs:3086-3110 | src-tauri/src/commands/mcp.rs:3189-3213 | src-tauri/src/commands/mcp.rs:4048-4072 | src-tauri/src/commands/mcp.rs:4673-4697 — 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, 26+ corresponding lines) · ×1
Edited copies of one member (6 members, 26+ corresponding lines) src-tauri/src/commands/mcp.rs:1762— src-tauri/src/commands/mcp.rs:1762-1788 | src-tauri/src/commands/mcp.rs:1823-1854 | src-tauri/src/commands/mcp.rs:1919-1945 | src-tauri/src/commands/mcp.rs:1974-2002 | src-tauri/src/commands/mcp.rs:2574-2599 | src-tauri/src/commands/mcp.rs:2766-2791 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) src-tauri/src/forge/cnb.rs:360— src-tauri/src/forge/cnb.rs:360-376 | src-tauri/src/forge/github.rs:571-588 | src-tauri/src/forge/gitlab.rs:604-620 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) src-tauri/src/parsers/codebuddy.rs:1251— src-tauri/src/parsers/codebuddy.rs:1251-1291 | src-tauri/src/parsers/kimi_code.rs:1093-1129 — 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 (7 members, 18+ corresponding lines) · ×1
Edited copies of one member (7 members, 18+ corresponding lines) src-tauri/src/commands/forge.rs:953— src-tauri/src/commands/forge.rs:953-978 | src-tauri/src/commands/forge.rs:997-1017 | src-tauri/src/commands/forge.rs:1030-1047 | src-tauri/src/commands/forge.rs:1058-1075 | src-tauri/src/commands/forge.rs:1088-1105 | src-tauri/src/commands/forge.rs:1175-1196 | src-tauri/src/commands/forge.rs:1255-1273 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 46+ corresponding lines) · ×1
Edited copies of one member (3 members, 46+ corresponding lines) src-tauri/src/db/migration/m20260522_000001_delegation_columns.rs:11— src-tauri/src/db/migration/m20260522_000001_delegation_columns.rs:11-56 | src-tauri/src/db/migration/m20260818_000001_work_task_source.rs:8-57 | src-tauri/src/db/migration/m20260831_000001_canvas_node_group_grid.rs:8-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 46 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) src-tauri/src/parsers/claude.rs:2821— src-tauri/src/parsers/claude.rs:2821-2853 | src-tauri/src/parsers/codebuddy.rs:1147-1175 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) src-tauri/src/forge/cnb.rs:619— src-tauri/src/forge/cnb.rs:619-639 | src-tauri/src/forge/gitea.rs:1055-1075 | src-tauri/src/forge/gitlab.rs:502-522 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) src-tauri/src/commands/experts.rs:791— src-tauri/src/commands/experts.rs:791-821 | src-tauri/src/commands/science.rs:609-646 — 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, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) src-tauri/src/db/service/conversation_service.rs:218— src-tauri/src/db/service/conversation_service.rs:218-237 | src-tauri/src/db/service/conversation_service.rs:249-268 | src-tauri/src/db/service/conversation_service.rs:290-308 | src-tauri/src/db/service/folder_service.rs:404-423 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 11+ corresponding lines) · ×1
Edited copies of one member (8 members, 11+ corresponding lines) src-tauri/src/paths.rs:46— src-tauri/src/paths.rs:46-56 | src-tauri/src/paths.rs:63-73 | src-tauri/src/paths.rs:99-109 | src-tauri/src/paths.rs:123-133 | src-tauri/src/paths.rs:149-159 | src-tauri/src/paths.rs:171-181 | src-tauri/src/paths.rs:193-203 | src-tauri/src/paths.rs:215-225 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 22+ corresponding lines) · ×1
Edited copies of one member (5 members, 22+ corresponding lines) src-tauri/src/commands/mcp.rs:1739— src-tauri/src/commands/mcp.rs:1739-1760 | src-tauri/src/commands/mcp.rs:1896-1917 | src-tauri/src/commands/mcp.rs:2551-2572 | src-tauri/src/commands/mcp.rs:2626-2650 | src-tauri/src/commands/mcp.rs:2721-2742 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) src-tauri/src/commands/mcp.rs:1790— src-tauri/src/commands/mcp.rs:1790-1816 | src-tauri/src/commands/mcp.rs:1859-1876 | src-tauri/src/commands/mcp.rs:1947-1970 | src-tauri/src/commands/mcp.rs:2006-2023 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 19+ corresponding lines) · ×1
Edited copies of one member (7 members, 19+ corresponding lines) src-tauri/src/commands/mcp.rs:2997— src-tauri/src/commands/mcp.rs:2997-3015 | src-tauri/src/commands/mcp.rs:3116-3134 | src-tauri/src/commands/mcp.rs:3219-3237 | src-tauri/src/commands/mcp.rs:4078-4096 | src-tauri/src/commands/mcp.rs:4703-4721 | src-tauri/src/commands/mcp.rs:5152-5180 | src-tauri/src/commands/mcp.rs:5433-5462 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) src-tauri/src/commands/folders.rs:2138— src-tauri/src/commands/folders.rs:2138-2158 | src-tauri/src/commands/folders.rs:2307-2329 | src-tauri/src/commands/folders.rs:2335-2353 — 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 (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) src-tauri/src/parsers/deepseek.rs:772— src-tauri/src/parsers/deepseek.rs:772-788 | src-tauri/src/parsers/grok.rs:1660-1680 | src-tauri/src/parsers/kimi_code.rs:1133-1149 | src-tauri/src/parsers/pi.rs:1338-1354 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 11+ corresponding lines) · ×1
Edited copies of one member (6 members, 11+ corresponding lines) src-tauri/src/commands/browser.rs:1723— src-tauri/src/commands/browser.rs:1723-1738 | src-tauri/src/commands/browser.rs:1817-1831 | src-tauri/src/commands/browser.rs:2132-2142 | src-tauri/src/commands/browser.rs:2189-2199 | src-tauri/src/commands/browser.rs:2429-2440 | src-tauri/src/commands/browser.rs:2978-2997 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 21+ corresponding lines) · ×1
Edited copies of one member (8 members, 21+ corresponding lines) src-tauri/src/commands/mcp.rs:2941— src-tauri/src/commands/mcp.rs:2941-2961 | src-tauri/src/commands/mcp.rs:3060-3080 | src-tauri/src/commands/mcp.rs:3163-3183 | src-tauri/src/commands/mcp.rs:3396-3416 | src-tauri/src/commands/mcp.rs:3815-3835 | src-tauri/src/commands/mcp.rs:4597-4617 | src-tauri/src/commands/mcp.rs:4769-4789 | src-tauri/src/commands/mcp.rs:5219-5239 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 35+ corresponding lines) · ×1
Edited copies of one member (8 members, 35+ corresponding lines) src-tauri/science/skills/hypothesis-generation/scripts/audit_evidence_ledger.py:69— src-tauri/science/skills/hypothesis-generation/scripts/audit_evidence_ledger.py:69-131 | src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:127-184 | src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:188-244 | src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:248-306 | src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:356-390 | src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:394-436 | src-tauri/science/skills/hypothesis-generation/scripts/validate_prediction_matrix.py:44-108 | src-tauri/science/skills/peer-review/scripts/validate_claim_evidence.py:68-124 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) src-tauri/src/commands/folders.rs:2417— src-tauri/src/commands/folders.rs:2417-2429 | src-tauri/src/commands/folders.rs:2432-2444 | src-tauri/src/commands/folders.rs:2447-2459 | src-tauri/src/commands/folders.rs:3874-3887 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) src-tauri/src/browser/hooks.rs:254— src-tauri/src/browser/hooks.rs:254-269 | src-tauri/src/browser/hooks.rs:275-287 | src-tauri/src/browser/hooks.rs:465-481 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 19+ corresponding lines) · ×1
Edited copies of one member (5 members, 19+ corresponding lines) src-tauri/src/commands/acp.rs:13236— src-tauri/src/commands/acp.rs:13236-13256 | src-tauri/src/commands/acp.rs:13387-13405 | src-tauri/src/commands/acp.rs:13656-13683 | src-tauri/src/commands/acp.rs:13747-13777 | src-tauri/src/commands/model_provider.rs:571-592 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 10+ corresponding lines) · ×1
Edited copies of one member (6 members, 10+ corresponding lines) src-tauri/src/commands/folders.rs:1304— src-tauri/src/commands/folders.rs:1304-1313 | src-tauri/src/commands/folders.rs:1615-1624 | src-tauri/src/commands/folders.rs:1691-1700 | src-tauri/src/commands/folders.rs:1878-1895 | src-tauri/src/commands/folders.rs:3722-3731 | src-tauri/src/commands/folders.rs:3920-3937 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 12+ corresponding lines) · ×1
Edited copies of one member (8 members, 12+ corresponding lines) src-tauri/src/commands/browser_tools.rs:194— src-tauri/src/commands/browser_tools.rs:194-205 | src-tauri/src/commands/chat_authoring.rs:731-742 | src-tauri/src/commands/computer_tools.rs:536-547 | src-tauri/src/commands/computer_tools.rs:555-566 | src-tauri/src/commands/computer_tools.rs:586-609 | src-tauri/src/commands/feedback.rs:112-126 | src-tauri/src/commands/question.rs:117-128 | src-tauri/src/commands/session_info.rs:424-435 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 31+ corresponding lines) · ×1
Edited copies of one member (5 members, 31+ corresponding lines) src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:73— src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:73-109 | src-tauri/science/skills/exploratory-data-analysis/scripts/image_inspector.py:183-217 | src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py:84-122 | src-tauri/science/skills/exploratory-data-analysis/scripts/sequence_inspector.py:217-247 | src-tauri/science/skills/exploratory-data-analysis/scripts/tabular_profile.py:69-101 — These 5 members are one piece of code written 5 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 5 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) src-tauri/src/acp/binary_cache.rs:210— src-tauri/src/acp/binary_cache.rs:210-219 | src-tauri/src/acp/codex_catalog_commit/txn.rs:212-218 | src-tauri/src/backgrounds/mod.rs:264-270 | src-tauri/src/browser/profile.rs:611-618 | src-tauri/src/update/install.rs:1664-1670 — 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 (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) src-tauri/src/db/migration/m20260221_000001_folder_is_open.rs:8— src-tauri/src/db/migration/m20260221_000001_folder_is_open.rs:8-22 | src-tauri/src/db/migration/m20260611_000001_folder_is_chat.rs:8-22 | src-tauri/src/db/migration/m20260727_000001_custom_agent_skills.rs:8-26 | src-tauri/src/db/migration/m20261020_000001_folder_command_run_local.rs:8-26 — 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, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) src-tauri/src/db/migration/m20260607_000001_folder_parent_id.rs:8— src-tauri/src/db/migration/m20260607_000001_folder_parent_id.rs:8-23 | src-tauri/src/db/migration/m20260717_000001_folder_alias.rs:8-22 | src-tauri/src/db/migration/m20260907_000001_canvas_node_path.rs:8-32 — 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 (5 members, 16+ corresponding lines) · ×1
Edited copies of one member (5 members, 16+ corresponding lines) src-tauri/src/db/migration/m20260807_000001_work_task_scheduled_at.rs:8— src-tauri/src/db/migration/m20260807_000001_work_task_scheduled_at.rs:8-25 | src-tauri/src/db/migration/m20260819_000001_work_task_completion_kind.rs:8-29 | src-tauri/src/db/migration/m20261015_000001_work_task_deferred_at.rs:8-27 | src-tauri/src/db/migration/m20261022_000001_work_task_delivery.rs:8-24 | src-tauri/src/db/migration/m20261112_000001_work_task_writeback_drafts.rs:8-23 — 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 (3 members, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) src-tauri/src/web/handlers/experts.rs:54— src-tauri/src/web/handlers/experts.rs:54-59 | src-tauri/src/web/handlers/office_tools.rs:82-87 | src-tauri/src/web/handlers/science.rs:55-60 — 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.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) src-tauri/src/web/handlers/custom_skills.rs:74— src-tauri/src/web/handlers/custom_skills.rs:74-79 | src-tauri/src/web/handlers/experts.rs:63-68 | src-tauri/src/web/handlers/office_tools.rs:117-122 | src-tauri/src/web/handlers/science.rs:64-69 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 6+ corresponding lines) · ×1
Edited copies of one member (7 members, 6+ corresponding lines) src-tauri/src/parsers/claude.rs:1698— src-tauri/src/parsers/claude.rs:1698-1703 | src-tauri/src/parsers/codebuddy.rs:40-45 | src-tauri/src/parsers/codex.rs:867-872 | src-tauri/src/parsers/deepseek.rs:61-66 | src-tauri/src/parsers/gemini.rs:938-944 | src-tauri/src/parsers/grok.rs:76-81 | src-tauri/src/parsers/kimi_code.rs:38-43 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 4+ corresponding lines) · ×1
Edited copies of one member (8 members, 4+ corresponding lines) src-tauri/src/commands/canvas.rs:34— src-tauri/src/commands/canvas.rs:34-37 | src-tauri/src/commands/config_sync/webdav_sync.rs:347-350 | src-tauri/src/commands/custom_skills.rs:126-129 | src-tauri/src/commands/experts.rs:192-195 | src-tauri/src/commands/office_tools.rs:72-75 | src-tauri/src/commands/science.rs:157-160 | src-tauri/src/db/service/canvas_service.rs:65-68 | src-tauri/src/db/service/tab_service.rs:22-25 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 6+ corresponding lines) · ×1
Edited copies of one member (5 members, 6+ corresponding lines) src-tauri/src/acp/cursor_acp_retry_compat.rs:288— src-tauri/src/acp/cursor_acp_retry_compat.rs:288-293 | src-tauri/src/forge/thread_reply.rs:237-249 | src-tauri/src/parsers/claude.rs:940-949 | src-tauri/src/parsers/codex.rs:6007-6015 | src-tauri/src/parsers/mod.rs:998-1004 — 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 (4 members, 3+ corresponding lines) · ×1
Edited copies of one member (4 members, 3+ corresponding lines) src-tauri/src/acp/terminal_runtime.rs:971— src-tauri/src/acp/terminal_runtime.rs:971-976 | src-tauri/src/db/service/canvas_service.rs:243-245 | src-tauri/src/forge/mod.rs:1163-1165 | src-tauri/src/forge/settings.rs:406-410 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) src-tauri/src/acp/delegation/live_reply.rs:97— src-tauri/src/acp/delegation/live_reply.rs:97-101 | src-tauri/src/acp/manager.rs:5023-5027 | src-tauri/src/acp/result_tool.rs:39-43 — 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.
Duplicated block (56 lines × 2) src-tauri/src/commands/project_boot.rs:205— src-tauri/src/commands/project_boot.rs:205-260 | src-tauri/src/commands/project_boot.rs:570-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/project_boot.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 (23–43 lines × 2) src-tauri/src/acp/connection.rs:15569— src-tauri/src/acp/connection.rs:15569-15591 | src-tauri/src/acp/connection.rs:15695-15737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:15569` 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 (36–43 lines × 2) src-tauri/src/acp/manager.rs:4761— src-tauri/src/acp/manager.rs:4761-4796 | src-tauri/src/acp/manager.rs:4889-4931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31–42 lines × 2) src-tauri/src/acp/connection.rs:10343— src-tauri/src/acp/connection.rs:10343-10384 | src-tauri/src/acp/connection.rs:10991-11021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:10343` 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 (39 lines × 2) src-tauri/src/acp/stderr_tail.rs:194— src-tauri/src/acp/stderr_tail.rs:194-232 | src-tauri/src/browser/service_url.rs:81-119 — 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 (35–37 lines × 3) src-tauri/src/acp/connection.rs:9826— src-tauri/src/acp/connection.rs:9826-9860 | src-tauri/src/acp/connection.rs:10066-10102 | src-tauri/src/acp/connection.rs:10178-10212 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:9826` 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 (32–35 lines × 4) src-tauri/src/commands/custom_skills.rs:449— src-tauri/src/commands/custom_skills.rs:449-480 | src-tauri/src/commands/experts.rs:973-1004 | src-tauri/src/commands/office_tools.rs:1246-1280 | src-tauri/src/commands/science.rs:789-820 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/experts.rs` as WHOLE FILES: this scan already matched 6 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. 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 (30–31 lines × 2) src-tauri/src/commands/experts.rs:703— src-tauri/src/commands/experts.rs:703-733 | src-tauri/src/commands/science.rs:522-551 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:703` 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–30 lines × 4) src-tauri/src/acp/connection.rs:9507— src-tauri/src/acp/connection.rs:9507-9534 | src-tauri/src/acp/connection.rs:9813-9840 | src-tauri/src/acp/connection.rs:10053-10082 | src-tauri/src/acp/connection.rs:10165-10192 — 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 `src-tauri/src/acp/connection.rs:9507` 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 (30 lines × 3) src-tauri/src/commands/experts.rs:792— src-tauri/src/commands/experts.rs:792-821 | src-tauri/src/commands/office_tools.rs:1050-1079 | src-tauri/src/commands/science.rs:617-646 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/office_tools.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 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 (28–29 lines × 7) src-tauri/src/parsers/codebuddy.rs:1327— src-tauri/src/parsers/codebuddy.rs:1327-1355 | src-tauri/src/parsers/codex.rs:7170-7198 | src-tauri/src/parsers/hermes.rs:793-820 | src-tauri/src/parsers/kimi_code.rs:1318-1346 | src-tauri/src/parsers/openclaw.rs:1111-1139 | REDACTED:2303-2330 | src-tauri/src/parsers/pi.rs:1456-1484 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:1327` it begins part-way through the construct above it, so those exact lines 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–29 lines × 2) src-tauri/src/parsers/codex.rs:535— src-tauri/src/parsers/codex.rs:535-553 | src-tauri/src/parsers/codex.rs:3521-3549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/parsers/codex.rs:3550` calls `Some`, `parse_codex_timestamp`, `push_turn_start` and `src-tauri/src/parsers/codex.rs:554` 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–28 lines × 3) src-tauri/src/commands/remote_proxy.rs:417— src-tauri/src/commands/remote_proxy.rs:417-444 | src-tauri/src/commands/remote_proxy.rs:743-768 | src-tauri/src/commands/remote_proxy.rs:1112-1135 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/remote_proxy.rs:417` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26–28 lines × 2) src-tauri/src/commands/project_boot.rs:152— src-tauri/src/commands/project_boot.rs:152-177 | src-tauri/src/commands/project_boot.rs:503-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/project_boot.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/commands/project_boot.rs:149` calls `is_empty`, `Err`, `invalid_input` and `src-tauri/src/commands/project_boot.rs:502` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25–28 lines × 2) src-tauri/src/web/mod.rs:634— src-tauri/src/web/mod.rs:634-661 | src-tauri/src/web/mod.rs:870-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 3) src-tauri/src/parsers/claude.rs:1223— src-tauri/src/parsers/claude.rs:1223-1248 | src-tauri/src/parsers/codex.rs:5797-5822 | src-tauri/src/parsers/mod.rs:1247-1272 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22–26 lines × 2) src-tauri/src/acp/connection.rs:5850— src-tauri/src/acp/connection.rs:5850-5871 | src-tauri/src/acp/connection.rs:6242-6267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:5850` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) src-tauri/src/acp/file_system_runtime.rs:1226— src-tauri/src/acp/file_system_runtime.rs:1226-1251 | src-tauri/src/commands/folders.rs:4586-4611 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/file_system_runtime.rs:1226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–25 lines × 2) src-tauri/src/db/service/work_task_service.rs:577— src-tauri/src/db/service/work_task_service.rs:577-601 | src-tauri/src/db/service/work_task_service.rs:665-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.
Duplicated block (36–41 lines × 2) src-tauri/src/parsers/codex.rs:474— src-tauri/src/parsers/codex.rs:474-514 | src-tauri/src/parsers/codex.rs:3471-3506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codex.rs:474` it does not close everything it opens, so those exact lines 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–25 lines × 2) REDACTED:405— REDACTED:405-429 | REDACTED:951-969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:405` 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 (23–24 lines × 2) src-tauri/src/commands/experts.rs:619— src-tauri/src/commands/experts.rs:619-641 | src-tauri/src/commands/science.rs:437-460 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:619` it begins part-way through the construct above it, so those 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 `meta` to `&ExpertMetadata` in one and `&ScienceMetadata` 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 (22–24 lines × 2) src-tauri/src/commands/mcp.rs:1487— src-tauri/src/commands/mcp.rs:1487-1510 | src-tauri/src/commands/mcp.rs:4288-4309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1487` it does not close everything it opens, so those exact lines 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–23 lines × 2) src-tauri/src/acp/delegation/broker.rs:2993— src-tauri/src/acp/delegation/broker.rs:2993-3015 | src-tauri/src/acp/delegation/broker.rs:4661-4679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:2993` 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 (15–23 lines × 2) src-tauri/src/acp/delegation/broker.rs:3049— src-tauri/src/acp/delegation/broker.rs:3049-3071 | src-tauri/src/acp/delegation/broker.rs:4713-4727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:3049` 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 lines × 2) src-tauri/src/commands/acp.rs:5225— src-tauri/src/commands/acp.rs:5225-5247 | src-tauri/src/commands/acp.rs:5259-5281 — both copies are in the same file, so extract the 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 (22 lines × 7) src-tauri/src/parsers/codebuddy.rs:1373— src-tauri/src/parsers/codebuddy.rs:1373-1394 | src-tauri/src/parsers/codex.rs:7218-7239 | src-tauri/src/parsers/hermes.rs:838-859 | src-tauri/src/parsers/kimi_code.rs:1364-1385 | src-tauri/src/parsers/openclaw.rs:1153-1174 | REDACTED:2350-2371 | src-tauri/src/parsers/pi.rs:1502-1523 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:1373` 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–22 lines × 2) src-tauri/src/acp/delegation/broker.rs:2878— src-tauri/src/acp/delegation/broker.rs:2878-2887 | src-tauri/src/acp/delegation/broker.rs:4550-4571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/delegation/broker.rs:2878` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/acp/delegation/broker.rs:4572` calls `remove_completed` and `src-tauri/src/acp/delegation/broker.rs:2889` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19–22 lines × 2) src-tauri/src/commands/mcp.rs:4404— src-tauri/src/commands/mcp.rs:4404-4422 | src-tauri/src/commands/mcp.rs:4505-4526 — both copies are in the same file, so extract the 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–22 lines × 2) src-tauri/src/parsers/deepseek.rs:330— src-tauri/src/parsers/deepseek.rs:330-351 | src-tauri/src/parsers/grok.rs:542-561 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12–21 lines × 2) src-tauri/src/automation/engine.rs:547— src-tauri/src/automation/engine.rs:547-558 | src-tauri/src/work_task/engine.rs:1485-1505 — `src-tauri/src/automation/engine.rs` and `src-tauri/src/work_task/engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 92 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/automation/engine.rs:547` 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 (17–21 lines × 2) src-tauri/src/chat_channel/session_commands.rs:1143— src-tauri/src/chat_channel/session_commands.rs:1143-1163 | src-tauri/src/chat_channel/session_commands.rs:1245-1261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/chat_channel/session_commands.rs:1143` it does not close everything it opens, so those exact lines 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–21 lines × 2) src-tauri/src/parsers/codex.rs:656— src-tauri/src/parsers/codex.rs:656-670 | src-tauri/src/parsers/codex.rs:3870-3890 — both copies are in the same file, so extract the block into 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–20 lines × 2) src-tauri/src/commands/experts.rs:334— src-tauri/src/commands/experts.rs:334-353 | src-tauri/src/commands/science.rs:302-317 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/science.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.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 (15–19 lines × 3) src-tauri/src/computer/local.rs:706— src-tauri/src/computer/local.rs:706-722 | src-tauri/src/computer/local.rs:794-812 | src-tauri/src/computer/local.rs:895-909 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/computer/local.rs:794` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–19 lines × 2) src-tauri/src/acp/manager.rs:4233— src-tauri/src/acp/manager.rs:4233-4251 | src-tauri/src/acp/manager.rs:4387-4403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/manager.rs:4233` 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–19 lines × 2) src-tauri/src/web/handlers/app_update.rs:223— src-tauri/src/web/handlers/app_update.rs:223-241 | src-tauri/src/web/handlers/app_update.rs:264-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/web/handlers/app_update.rs:223` it begins part-way through the construct above it, so those exact lines 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–18 lines × 7) src-tauri/src/commands/mcp.rs:2998— src-tauri/src/commands/mcp.rs:2998-3008 | src-tauri/src/commands/mcp.rs:3117-3127 | src-tauri/src/commands/mcp.rs:3220-3230 | src-tauri/src/commands/mcp.rs:4079-4089 | src-tauri/src/commands/mcp.rs:4704-4714 | src-tauri/src/commands/mcp.rs:5153-5169 | src-tauri/src/commands/mcp.rs:5434-5451 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 (18 lines × 3) src-tauri/src/commands/acp.rs:3058— src-tauri/src/commands/acp.rs:3058-3075 | src-tauri/src/commands/acp.rs:3085-3102 | src-tauri/src/commands/mcp.rs:791-808 — before extracting anything, compare `src-tauri/src/commands/acp.rs` and `src-tauri/src/commands/mcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:3058` 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–18 lines × 2) src-tauri/src/acp/connection.rs:10609— src-tauri/src/acp/connection.rs:10609-10626 | src-tauri/src/acp/connection.rs:10785-10798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:10609` it does not close everything it opens, so those exact lines 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–18 lines × 2) src-tauri/src/acp/connection.rs:15834— src-tauri/src/acp/connection.rs:15834-15851 | src-tauri/src/acp/connection.rs:16213-16225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:15834` it does not close everything it opens, so those 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, `src-tauri/src/acp/connection.rs:16211` calls `connection`, `session_id`, `clone` and `src-tauri/src/acp/connection.rs:15833` 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 (17–18 lines × 2) src-tauri/src/acp/manager.rs:3152— src-tauri/src/acp/manager.rs:3152-3168 | src-tauri/src/acp/manager.rs:3275-3292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/manager.rs:3152` it begins part-way through the construct above it, so those exact lines 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 × 3) src-tauri/src/commands/experts.rs:843— src-tauri/src/commands/experts.rs:843-859 | src-tauri/src/commands/office_tools.rs:1101-1114 | src-tauri/src/commands/science.rs:667-682 — before extracting anything, compare `src-tauri/src/commands/experts.rs` and `src-tauri/src/commands/office_tools.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/experts.rs:843` it does not close everything it opens, so those exact lines 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) src-tauri/src/commands/folders.rs:2918— src-tauri/src/commands/folders.rs:2918-2934 | src-tauri/src/work_task/git.rs:173-185 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:2918` it does not close everything it opens, so those exact lines 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–16 lines × 3) src-tauri/src/commands/folders.rs:1706— src-tauri/src/commands/folders.rs:1706-1719 | src-tauri/src/commands/folders.rs:1725-1738 | src-tauri/src/git_credential.rs:390-405 — before extracting anything, compare `src-tauri/src/commands/folders.rs` and `src-tauri/src/git_credential.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/folders.rs:1706` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) src-tauri/src/commands/custom_skills.rs:317— src-tauri/src/commands/custom_skills.rs:317-331 | src-tauri/src/commands/office_tools.rs:1223-1236 | src-tauri/src/commands/science.rs:592-605 — before extracting anything, compare `src-tauri/src/commands/custom_skills.rs` and `src-tauri/src/commands/office_tools.rs` as WHOLE FILES: this scan already matched 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/custom_skills.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 (10–15 lines × 3) src-tauri/src/commands/mcp.rs:2117— src-tauri/src/commands/mcp.rs:2117-2131 | src-tauri/src/commands/mcp.rs:4408-4417 | src-tauri/src/commands/mcp.rs:4509-4521 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–15 lines × 2) src-tauri/src/acp/connection.rs:15866— src-tauri/src/acp/connection.rs:15866-15880 | src-tauri/src/acp/connection.rs:16242-16251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/acp/connection.rs:15866` it does not close everything it opens, so those 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, `src-tauri/src/acp/connection.rs:16240` calls `connection`, `session_id`, `clone` and `src-tauri/src/acp/connection.rs:15865` 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 (12–15 lines × 2) src-tauri/src/parsers/claude.rs:3867— src-tauri/src/parsers/claude.rs:3867-3878 | src-tauri/src/parsers/openclaw.rs:132-146 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/openclaw.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:3867` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 8) src-tauri/src/parsers/codebuddy.rs:1320— src-tauri/src/parsers/codebuddy.rs:1320-1333 | src-tauri/src/parsers/codex.rs:7163-7176 | src-tauri/src/parsers/gemini.rs:1001-1014 | src-tauri/src/parsers/hermes.rs:786-799 | src-tauri/src/parsers/kimi_code.rs:1311-1324 | src-tauri/src/parsers/openclaw.rs:1104-1117 | REDACTED:2296-2309 | src-tauri/src/parsers/pi.rs:1449-1462 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:1320` it does not close everything it opens, so those exact lines 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 × 3) src-tauri/src/commands/mcp.rs:2075— src-tauri/src/commands/mcp.rs:2075-2088 | src-tauri/src/commands/mcp.rs:4380-4392 | src-tauri/src/commands/mcp.rs:4481-4493 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 2) src-tauri/src/commands/mcp.rs:1521— src-tauri/src/commands/mcp.rs:1521-1534 | src-tauri/src/commands/mcp.rs:4315-4327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1521` 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–14 lines × 2) src-tauri/src/forge/gitea.rs:1145— src-tauri/src/forge/gitea.rs:1145-1156 | src-tauri/src/forge/github.rs:1709-1722 — before extracting anything, compare `src-tauri/src/forge/gitea.rs` and `src-tauri/src/forge/github.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 178 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 (7–14 lines × 2) src-tauri/src/workspace_state/mod.rs:1273— src-tauri/src/workspace_state/mod.rs:1273-1279 | src-tauri/src/workspace_state/mod.rs:1438-1451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/workspace_state/mod.rs:1273` it does not close everything it opens, so those exact lines 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 × 4) src-tauri/src/acp/delegation/broker.rs:3035— src-tauri/src/acp/delegation/broker.rs:3035-3047 | src-tauri/src/acp/delegation/broker.rs:3112-3124 | src-tauri/src/acp/delegation/broker.rs:4699-4711 | src-tauri/src/acp/delegation/broker.rs:4770-4782 — 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 `src-tauri/src/acp/delegation/broker.rs:3035` 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 (12–13 lines × 3) src-tauri/src/parsers/claude.rs:1544— src-tauri/src/parsers/claude.rs:1544-1556 | src-tauri/src/parsers/claude.rs:3867-3878 | src-tauri/src/parsers/openclaw.rs:132-143 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/openclaw.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:1544` it does not close everything it opens, so those exact lines 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–13 lines × 4) src-tauri/src/parsers/claude.rs:3448— src-tauri/src/parsers/claude.rs:3448-3460 | src-tauri/src/parsers/cline.rs:1123-1126 | src-tauri/src/parsers/openclaw.rs:932-944 | src-tauri/src/parsers/openclaw.rs:960-972 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/openclaw.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:3448` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/parsers/claude.rs:3460` calls `get`, `and_then`, `as_str` and `src-tauri/src/parsers/cline.rs:1126` 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 × 11) src-tauri/src/commands/mcp.rs:1771— src-tauri/src/commands/mcp.rs:1771-1784 | src-tauri/src/commands/mcp.rs:1928-1941 | src-tauri/src/commands/mcp.rs:2583-2596 | src-tauri/src/commands/mcp.rs:2775-2788 | src-tauri/src/commands/mcp.rs:2975-2988 | src-tauri/src/commands/mcp.rs:3094-3107 | src-tauri/src/commands/mcp.rs:3197-3210 | src-tauri/src/commands/mcp.rs:4056-4069 | src-tauri/src/commands/mcp.rs:4681-4694 | src-tauri/src/commands/mcp.rs:5130-5143 | src-tauri/src/commands/mcp.rs:5411-5424 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–11 lines × 5) src-tauri/src/db/service/work_task_service.rs:1646— src-tauri/src/db/service/work_task_service.rs:1646-1656 | src-tauri/src/db/service/work_task_service.rs:1685-1695 | src-tauri/src/db/service/work_task_service.rs:1775-1785 | src-tauri/src/db/service/work_task_service.rs:2135-2141 | src-tauri/src/db/service/work_task_service.rs:2181-2187 — 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 `src-tauri/src/db/service/work_task_service.rs:1646` it begins part-way through the construct above it, so those 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 lines × 4) src-tauri/src/db/service/work_task_service.rs:1646— src-tauri/src/db/service/work_task_service.rs:1646-1656 | src-tauri/src/db/service/work_task_service.rs:1685-1695 | src-tauri/src/db/service/work_task_service.rs:1775-1785 | src-tauri/src/db/service/work_task_service.rs:2724-2734 — 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 `src-tauri/src/db/service/work_task_service.rs:1646` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/db/service/work_task_service.rs:1645` calls `filter`, `eq` and `src-tauri/src/db/service/work_task_service.rs:2723` 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 × 5) src-tauri/src/commands/acp.rs:3946— src-tauri/src/commands/acp.rs:3946-3955 | src-tauri/src/commands/mcp.rs:1511-1518 | src-tauri/src/commands/mcp.rs:1552-1559 | src-tauri/src/commands/mcp.rs:1650-1657 | src-tauri/src/commands/mcp.rs:1676-1683 — before extracting anything, compare `src-tauri/src/commands/acp.rs` and `src-tauri/src/commands/mcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/acp.rs:3946` it does not close everything it opens, so those 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 (10 lines × 4) src-tauri/src/parsers/codex_code_mode.rs:1516— src-tauri/src/parsers/codex_code_mode.rs:1516-1525 | src-tauri/src/parsers/codex_code_mode.rs:1545-1554 | src-tauri/src/parsers/codex_code_mode.rs:1666-1675 | src-tauri/src/parsers/codex_code_mode.rs:2113-2122 — 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 `src-tauri/src/parsers/codex_code_mode.rs:1516` it does not close everything it opens, so those exact lines 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 × 8) src-tauri/src/db/service/work_task_service.rs:1645— src-tauri/src/db/service/work_task_service.rs:1645-1652 | src-tauri/src/db/service/work_task_service.rs:1684-1691 | src-tauri/src/db/service/work_task_service.rs:1774-1781 | src-tauri/src/db/service/work_task_service.rs:2133-2141 | src-tauri/src/db/service/work_task_service.rs:2180-2187 | src-tauri/src/db/service/work_task_service.rs:2599-2606 | src-tauri/src/db/service/work_task_service.rs:2659-2666 | src-tauri/src/db/service/work_task_service.rs:2915-2922 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/db/service/work_task_service.rs:1645` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/db/service/work_task_service.rs:2142` calls `status_changed_event`, `Some` and `src-tauri/src/db/service/work_task_service.rs:2607` 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–9 lines × 8) src-tauri/src/parsers/codebuddy.rs:1358— src-tauri/src/parsers/codebuddy.rs:1358-1364 | src-tauri/src/parsers/codex.rs:7201-7209 | src-tauri/src/parsers/gemini.rs:1043-1051 | src-tauri/src/parsers/hermes.rs:823-829 | src-tauri/src/parsers/kimi_code.rs:1349-1355 | src-tauri/src/parsers/openclaw.rs:1142-1150 | REDACTED:2333-2341 | src-tauri/src/parsers/pi.rs:1487-1493 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:1358` it does not close everything it opens, so those exact lines 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 × 7) src-tauri/src/commands/mcp.rs:2608— src-tauri/src/commands/mcp.rs:2608-2616 | src-tauri/src/commands/mcp.rs:2800-2808 | src-tauri/src/commands/mcp.rs:3003-3011 | src-tauri/src/commands/mcp.rs:3122-3130 | src-tauri/src/commands/mcp.rs:3225-3233 | src-tauri/src/commands/mcp.rs:4084-4092 | src-tauri/src/commands/mcp.rs:4709-4717 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:2608` it does not close everything it opens, so those exact lines 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 × 5) src-tauri/src/parsers/claude.rs:3220— src-tauri/src/parsers/claude.rs:3220-3228 | src-tauri/src/parsers/codex.rs:6388-6396 | src-tauri/src/parsers/gemini.rs:409-417 | src-tauri/src/parsers/hermes.rs:726-734 | REDACTED:1444-1452 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/claude.rs:3220` 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–9 lines × 4) src-tauri/src/commands/acp.rs:13128— src-tauri/src/commands/acp.rs:13128-13136 | src-tauri/src/commands/acp.rs:13266-13274 | src-tauri/src/commands/acp.rs:14592-14599 | src-tauri/src/commands/acp.rs:14727-14734 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 2) src-tauri/src/parsers/grok.rs:710— src-tauri/src/parsers/grok.rs:710-718 | src-tauri/src/parsers/kimi_code.rs:134-140 — before extracting anything, compare `src-tauri/src/parsers/grok.rs` and `src-tauri/src/parsers/kimi_code.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/parsers/kimi_code.rs:141` calls `get`, `and_then` and `src-tauri/src/parsers/grok.rs:718` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 8) src-tauri/src/parsers/codebuddy.rs:1340— src-tauri/src/parsers/codebuddy.rs:1340-1346 | src-tauri/src/parsers/codex.rs:7183-7189 | src-tauri/src/parsers/gemini.rs:1023-1030 | src-tauri/src/parsers/hermes.rs:806-812 | src-tauri/src/parsers/kimi_code.rs:1331-1337 | src-tauri/src/parsers/openclaw.rs:1124-1130 | REDACTED:2316-2322 | src-tauri/src/parsers/pi.rs:1469-1475 — before extracting anything, compare `src-tauri/src/parsers/codebuddy.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/parsers/codebuddy.rs:1340` it does not close everything it opens, so those exact lines 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–7 lines × 3) src-tauri/src/parsers/claude.rs:1531— src-tauri/src/parsers/claude.rs:1531-1537 | src-tauri/src/parsers/codex.rs:427-433 | src-tauri/src/parsers/qoder.rs:713-716 — before extracting anything, compare `src-tauri/src/parsers/claude.rs` and `src-tauri/src/parsers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–6 lines × 3) src-tauri/src/acp/background_watch.rs:2026— src-tauri/src/acp/background_watch.rs:2026-2031 | src-tauri/src/parsers/claude.rs:1432-1437 | REDACTED:1885-1886 — 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 `REDACTED:1885` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/acp/background_watch.rs:2031` calls `iter` and `REDACTED:1886` 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 × 5) src-tauri/src/process.rs:369— src-tauri/src/process.rs:369-374 | src-tauri/src/process.rs:444-449 | src-tauri/src/process.rs:487-492 | src-tauri/src/process.rs:515-520 | src-tauri/src/process.rs:539-544 — 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 `src-tauri/src/process.rs:369` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/src/process.rs:453` calls `join` and `src-tauri/src/process.rs:524` 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–7 lines × 2) src-tauri/src/acp/connection.rs:5662— src-tauri/src/acp/connection.rs:5662-5667 | src-tauri/src/acp/connection.rs:6180-6186 — both copies are in the same file, so extract the 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 (4–5 lines × 3) src-tauri/src/forge/cnb.rs:365— src-tauri/src/forge/cnb.rs:365-369 | src-tauri/src/forge/gitea.rs:344-347 | src-tauri/src/forge/github.rs:577-581 — before extracting anything, compare `src-tauri/src/forge/cnb.rs` and `src-tauri/src/forge/gitea.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/forge/cnb.rs:365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/forge/cnb.rs:364` calls `Some`, `as_deref`, `String` and `src-tauri/src/forge/gitea.rs:344` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 7) src-tauri/src/forge/deliver.rs:551— src-tauri/src/forge/deliver.rs:551-555 | src-tauri/src/forge/github.rs:418-428 | src-tauri/src/forge/github.rs:507-511 | src-tauri/src/forge/github.rs:653-657 | src-tauri/src/forge/github.rs:1420-1424 | src-tauri/src/forge/github.rs:1529-1536 | src-tauri/src/forge/github.rs:1681-1685 — 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 `src-tauri/src/forge/deliver.rs:551` it begins part-way through the construct above it, so those 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 × 5) src-tauri/src/db/service/work_task_service.rs:1646— src-tauri/src/db/service/work_task_service.rs:1646-1656 | src-tauri/src/db/service/work_task_service.rs:1685-1695 | src-tauri/src/db/service/work_task_service.rs:1775-1785 | src-tauri/src/db/service/work_task_service.rs:2724-2734 | src-tauri/src/db/service/work_task_service.rs:2779-2789 — 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 `src-tauri/src/db/service/work_task_service.rs:1646` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/src/db/service/work_task_service.rs:1645` calls `filter`, `eq` and `src-tauri/src/db/service/work_task_service.rs:2723` 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 × 5) src-tauri/src/commands/mcp.rs:6520— src-tauri/src/commands/mcp.rs:6520-6529 | src-tauri/src/commands/mcp.rs:6554-6563 | src-tauri/src/commands/mcp.rs:6845-6854 | src-tauri/src/commands/mcp.rs:6880-6889 | src-tauri/src/commands/mcp.rs:6912-6921 — 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 `src-tauri/src/commands/mcp.rs:6520` it begins part-way through the construct above it, so those exact lines 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 × 6) src-tauri/src/commands/mcp.rs:1745— src-tauri/src/commands/mcp.rs:1745-1753 | src-tauri/src/commands/mcp.rs:2557-2565 | src-tauri/src/commands/mcp.rs:2635-2643 | src-tauri/src/commands/mcp.rs:2727-2735 | src-tauri/src/commands/mcp.rs:3065-3073 | src-tauri/src/commands/mcp.rs:3168-3176 — 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 `src-tauri/src/commands/mcp.rs:1745` 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 × 7) src-tauri/src/commands/mcp.rs:1766— src-tauri/src/commands/mcp.rs:1766-1773 | src-tauri/src/commands/mcp.rs:1923-1930 | src-tauri/src/commands/mcp.rs:2578-2585 | src-tauri/src/commands/mcp.rs:2656-2663 | src-tauri/src/commands/mcp.rs:2970-2977 | src-tauri/src/commands/mcp.rs:3089-3096 | src-tauri/src/commands/mcp.rs:3192-3199 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/src/commands/mcp.rs:1766` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34–35 lines × 2) src-tauri/science/skills/scientific-schematics/scripts/generate_schematic.py:44— src-tauri/science/skills/scientific-schematics/scripts/generate_schematic.py:44-77 | src-tauri/science/skills/scientific-schematics/scripts/generate_schematic_ai.py:114-148 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–31 lines × 2) src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:163— src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:163-193 | src-tauri/science/skills/citation-management/scripts/search_openalex.py:266-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (30 lines × 2) src-tauri/science/skills/hypothesis-generation/scripts/_common.py:178— src-tauri/science/skills/hypothesis-generation/scripts/_common.py:178-207 | src-tauri/science/skills/peer-review/scripts/_common.py:151-180 — before extracting anything, compare `src-tauri/science/skills/hypothesis-generation/scripts/_common.py` and `src-tauri/science/skills/peer-review/scripts/_common.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (24 lines × 3) src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:31— src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:31-54 | src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py:31-54 | src-tauri/science/skills/exploratory-data-analysis/scripts/tabular_profile.py:32-55 — before extracting anything, compare `src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py` and `src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:31` it begins part-way through the construct above it, so those exact lines 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–23 lines × 2) src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:237— src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:237-259 | src-tauri/science/skills/citation-management/scripts/search_pubmed.py:409-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. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/science/skills/citation-management/scripts/search_google_scholar.py:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 6) src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:21— src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:21-39 | src-tauri/science/skills/exploratory-data-analysis/scripts/eda_analyzer.py:50-68 | src-tauri/science/skills/exploratory-data-analysis/scripts/image_inspector.py:29-46 | src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py:21-39 | src-tauri/science/skills/exploratory-data-analysis/scripts/sequence_inspector.py:32-50 | src-tauri/science/skills/exploratory-data-analysis/scripts/tabular_profile.py:22-40 — before extracting anything, compare `src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py` and `src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/science/skills/exploratory-data-analysis/scripts/image_inspector.py:47` calls `add_argument` and `src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:39` 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–15 lines × 7) src-tauri/science/skills/exploratory-data-analysis/scripts/capability_manifest.py:52— src-tauri/science/skills/exploratory-data-analysis/scripts/capability_manifest.py:52-66 | src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py:26-40 | src-tauri/science/skills/exploratory-data-analysis/scripts/eda_analyzer.py:55-69 | src-tauri/science/skills/exploratory-data-analysis/scripts/image_inspector.py:34-46 | src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py:26-40 | src-tauri/science/skills/exploratory-data-analysis/scripts/sequence_inspector.py:37-51 | src-tauri/science/skills/exploratory-data-analysis/scripts/tabular_profile.py:27-41 — before extracting anything, compare `src-tauri/science/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py` and `src-tauri/science/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/science/skills/exploratory-data-analysis/scripts/capability_manifest.py:52` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src-tauri/science/skills/exploratory-data-analysis/scripts/image_inspector.py:47` calls `add_argument` and `src-tauri/science/skills/exploratory-data-analysis/scripts/capability_manifest.py:66` 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–14 lines × 4) src-tauri/science/skills/scientific-brainstorming/scripts/validate_register.py:251— src-tauri/science/skills/scientific-brainstorming/scripts/validate_register.py:251-260 | src-tauri/science/skills/scientific-brainstorming/scripts/validate_register.py:313-322 | src-tauri/science/skills/scientific-brainstorming/scripts/validate_register.py:485-494 | src-tauri/science/skills/scientific-brainstorming/scripts/validate_register.py:518-531 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 3) src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:31— src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:31-40 | src-tauri/science/skills/scholar-evaluation/scripts/check_traceability.py:204-214 | src-tauri/science/skills/scholar-evaluation/scripts/summarize_agreement.py:246-255 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:31` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src-tauri/science/skills/scholar-evaluation/scripts/check_traceability.py:203` calls `add_argument` and `src-tauri/science/skills/scholar-evaluation/scripts/calculate_scores.py:31` 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 × 7) src-tauri/science/skills/hypothesis-generation/scripts/check_operationalization.py:212— src-tauri/science/skills/hypothesis-generation/scripts/check_operationalization.py:212-223 | src-tauri/science/skills/hypothesis-generation/scripts/lint_causal_claims.py:164-175 | src-tauri/science/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py:1052-1063 | src-tauri/science/skills/peer-review/scripts/audit_statistics_reproducibility.py:280-291 | src-tauri/science/skills/peer-review/scripts/lint_review.py:229-240 | src-tauri/science/skills/peer-review/scripts/validate_claim_evidence.py:196-207 | src-tauri/science/skills/peer-review/scripts/validate_review_intake.py:428-439 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Sync-over-async blocking src-tauri/src/acp/connection.rs:2776— `spawn_agent_connection` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Duplication concentrated across 22 sibling directories (259 clone groups) src/components/layout/commit-message-settings-dialog.tsx:284— 259 duplicated blocks under src/components/ have copies in at least two of the sibling directories ai-elements, automations, browser, canvas, chat, computer (+16 more sibling(s) not listed) — 108 of them are reported below, and 151 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 259 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 259 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 259 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.
Duplication concentrated across 6 sibling directories (81 clone groups) src/hooks/use-proxied-background-thumb.ts:44— 81 duplicated blocks under src/ have copies in at least two of the sibling directories app, components, contexts, hooks, lib, stores — 36 of them are reported below, and 45 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 81 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 81 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 81 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.
Duplication concentrated across 8 sibling directories (7 clone groups) src/app/merge/page.tsx:6— 7 duplicated blocks under src/app/ have copies in at least two of the sibling directories commit, import-sessions, merge, project-boot, push, settings (+2 more sibling(s) not listed) — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 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.
R10 · Code Duplication· Duplicated block with local edits (343 matched lines × 2 locations) · ×1
Duplicated block with local edits (343 matched lines × 2 locations) src/components/layout/branch-selector-list.tsx:204— src/components/layout/branch-selector-list.tsx:204 · src/components/layout/git-log-branch-filter-list.tsx:118 — the two spans are one implementation copied and then locally edited — 1738 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 (243 matched lines × 2 locations) · ×1
Duplicated block with local edits (243 matched lines × 2 locations) src/components/layout/command-manage-dialog.tsx:530— src/components/layout/command-manage-dialog.tsx:530 · src/components/layout/remote-workspace-manage-dialog.tsx:417 — the two spans are one implementation copied and then locally edited — 1122 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 (236 matched lines × 2 locations) · ×1
Duplicated block with local edits (236 matched lines × 2 locations) src/components/layout/command-manage-dialog.tsx:159— src/components/layout/command-manage-dialog.tsx:159 · src/components/layout/remote-workspace-manage-dialog.tsx:117 — the two spans are one implementation copied and then locally edited — 1361 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 (204 matched lines × 2 locations) · ×1
Duplicated block with local edits (204 matched lines × 2 locations) src/components/project-boot/hyperframes/hyperframes-launcher.tsx:83— src/components/project-boot/hyperframes/hyperframes-launcher.tsx:83 · src/components/project-boot/shadcn/create-project-dialog.tsx:69 — the two spans are one implementation copied and then locally edited — 1009 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 (202 matched lines × 2 locations) · ×1
Duplicated block with local edits (202 matched lines × 2 locations) src/components/layout/commit-message-settings-dialog.tsx:284— src/components/layout/commit-message-settings-dialog.tsx:284 · src/components/settings/assistant-editor-dialog.tsx:224 — the two spans are one implementation copied and then locally edited — 1019 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 (192 matched lines × 2 locations) · ×1
Duplicated block with local edits (192 matched lines × 2 locations) src/components/layout/remote-workspace-manage-dialog.tsx:174— src/components/layout/remote-workspace-manage-dialog.tsx:174 · src/components/settings/quick-messages-settings.tsx:131 — the two spans are one implementation copied and then locally edited — 1066 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 (174 matched lines × 2 locations) · ×1
Duplicated block with local edits (174 matched lines × 2 locations) src/components/shared/directory-browser.tsx:156— src/components/shared/directory-browser.tsx:156 · src/components/shared/server-file-browser-dialog.tsx:46 — the two spans are one implementation copied and then locally edited — 996 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 (151 matched lines × 2 locations) · ×1
Duplicated block with local edits (151 matched lines × 2 locations) src/components/settings/add-model-provider-dialog.tsx:46— src/components/settings/add-model-provider-dialog.tsx:46 · src/components/settings/edit-model-provider-dialog.tsx:49 — the two spans are one implementation copied and then locally edited — 836 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 (147 matched lines × 2 locations) · ×1
Duplicated block with local edits (147 matched lines × 2 locations) src/components/conversations/sidebar-conversation-list.tsx:558— src/components/conversations/sidebar-conversation-list.tsx:558 · src/components/conversations/sidebar-folder-group-header.tsx:220 — the two spans are one implementation copied and then locally edited — 663 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 (146 matched lines × 2 locations) · ×1
Duplicated block with local edits (146 matched lines × 2 locations) src/components/layout/push-workspace.tsx:322— src/components/layout/push-workspace.tsx:322 · src/components/layout/unstash-dialog.tsx:192 — the two spans are one implementation copied and then locally edited — 783 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 (145 matched lines × 2 locations) · ×1
Duplicated block with local edits (145 matched lines × 2 locations) src/lib/transport/remote-desktop-transport.ts:155— src/lib/transport/remote-desktop-transport.ts:155 · src/lib/transport/web-transport.ts:126 — the two spans are one implementation copied and then locally edited — 779 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 (129 matched lines × 2 locations) · ×1
Duplicated block with local edits (129 matched lines × 2 locations) src/components/settings/experts-settings.tsx:35— src/components/settings/experts-settings.tsx:35 · src/components/settings/science-settings.tsx:39 — the two spans are one implementation copied and then locally edited — 701 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 (127 lines × 2 locations) src/components/layout/aux-panel-git-log-tab.tsx:425— src/components/layout/aux-panel-git-log-tab.tsx:425 · src/components/layout/push-workspace.tsx:84 — 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.
R10 · Code Duplication· Duplicated block with local edits (123 matched lines × 2 locations) · ×1
Duplicated block with local edits (123 matched lines × 2 locations) src/components/settings/add-chat-channel-dialog.tsx:114— src/components/settings/add-chat-channel-dialog.tsx:114 · src/components/settings/edit-chat-channel-dialog.tsx:102 — the two spans are one implementation copied and then locally edited — 624 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 (114 matched lines × 2 locations) · ×1
Duplicated block with local edits (114 matched lines × 2 locations) src/components/forge/forge-combine-dialog.tsx:145— src/components/forge/forge-combine-dialog.tsx:145 · src/components/forge/forge-start-dialog.tsx:173 — the two spans are one implementation copied and then locally edited — 530 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 (113 matched lines × 2 locations) · ×1
Duplicated block with local edits (113 matched lines × 2 locations) src/components/settings/opencode-behavior-section.tsx:64— src/components/settings/opencode-behavior-section.tsx:64 · src/components/settings/opencode-permissions-section.tsx:103 — the two spans are one implementation copied and then locally edited — 547 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 (112 matched lines × 2 locations) · ×1
Duplicated block with local edits (112 matched lines × 2 locations) src/app/merge/page.tsx:6— src/app/merge/page.tsx:6 · src/app/push/page.tsx:6 — the two spans are one implementation copied and then locally edited — 554 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 (102 matched lines × 2 locations) · ×1
Duplicated block with local edits (102 matched lines × 2 locations) src/components/message/reply-artifacts.tsx:138— src/components/message/reply-artifacts.tsx:138 · src/components/message/reply-artifacts.tsx:246 — the two spans are one implementation copied and then locally edited — 445 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 (101 matched lines × 2 locations) · ×1
Duplicated block with local edits (101 matched lines × 2 locations) src/lib/desktop-notification-prefs.ts:85— src/lib/desktop-notification-prefs.ts:85 · src/lib/notification-sound-prefs.ts:81 — the two spans are one implementation copied and then locally edited — 548 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 (97 matched lines × 2 locations) · ×1
Duplicated block with local edits (97 matched lines × 2 locations) src/components/chat/chat-input.tsx:32— src/components/chat/chat-input.tsx:32 · src/components/chat/conversation-shell.tsx:82 — the two spans are one implementation copied and then locally edited — 490 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 (96 matched lines × 2 locations) · ×1
Duplicated block with local edits (96 matched lines × 2 locations) src/components/files/file-workspace-tab-bar.tsx:73— src/components/files/file-workspace-tab-bar.tsx:73 · src/components/tabs/tab-bar.tsx:279 — the two spans are one implementation copied and then locally edited — 509 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 (93 lines × 3 locations) src/components/layout/aux-panel-git-changes-tab.tsx:292— src/components/layout/aux-panel-git-changes-tab.tsx:292 · src/components/layout/aux-panel-git-log-tab.tsx:461 · src/components/layout/push-workspace.tsx:120 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication· Duplicated block with local edits (88 matched lines × 2 locations) · ×1
Duplicated block with local edits (88 matched lines × 2 locations) src/components/ui/context-menu.tsx:26— src/components/ui/context-menu.tsx:26 · src/components/ui/dropdown-menu.tsx:39 — the two spans are one implementation copied and then locally edited — 337 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.
Wholesale file copy (86 identical lines × 2 files) src/app/commit/page.tsx:3— src/app/commit/page.tsx:3 · src/app/merge/page.tsx:3 — these 2 files are line-for-line copies of one another — 86 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Duplicated block (80 lines × 2 locations) src/components/layout/aux-panel-git-changes-tab.tsx:1877— src/components/layout/aux-panel-git-changes-tab.tsx:1877 · src/components/layout/aux-panel-git-changes-tab.tsx:1995 — 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 (79 matched lines × 2 locations) · ×1
Duplicated block with local edits (79 matched lines × 2 locations) src/components/settings/mcp-settings.tsx:1538— src/components/settings/mcp-settings.tsx:1538 · src/components/settings/mcp-settings.tsx:1662 — the two spans are one implementation copied and then locally edited — 368 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 (68 lines × 2 locations) src/components/settings/command-code-config-panel.tsx:75— src/components/settings/command-code-config-panel.tsx:75 · src/components/settings/trae-config-panel.tsx:84 — 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 (64 lines × 2 locations) src/components/layout/commit-dialog.tsx:118— src/components/layout/commit-dialog.tsx:118 · src/components/layout/unstash-dialog.tsx:79 — 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.
R10 · Code Duplication· Duplicated block with local edits (62 matched lines × 2 locations) · ×1
Duplicated block with local edits (62 matched lines × 2 locations) src/components/tasks/task-follow-up-dialog.tsx:63— src/components/tasks/task-follow-up-dialog.tsx:63 · src/components/tasks/task-restart-dialog.tsx:57 — the two spans are one implementation copied and then locally edited — 366 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 (61 matched lines × 2 locations) · ×1
Duplicated block with local edits (61 matched lines × 2 locations) REDACTED:26— REDACTED:26 · REDACTED:108 — the two spans are one implementation copied and then locally edited — 423 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 (60 matched lines × 2 locations) · ×1
Duplicated block with local edits (60 matched lines × 2 locations) src/components/chat/conversation-context-bar.tsx:117— src/components/chat/conversation-context-bar.tsx:117 · src/components/chat/conversation-context-bar.tsx:272 — the two spans are one implementation copied and then locally edited — 412 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 (59 matched lines × 2 locations) · ×1
Duplicated block with local edits (59 matched lines × 2 locations) src/components/settings/custom-agent-mcp-toggle.tsx:35— src/components/settings/custom-agent-mcp-toggle.tsx:35 · src/components/settings/custom-agent-skills-toggle.tsx:36 — the two spans are one implementation copied and then locally edited — 330 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 (56 matched lines × 2 locations) · ×1
Duplicated block with local edits (56 matched lines × 2 locations) src/components/settings/opencode-connect-dialog.tsx:118— src/components/settings/opencode-connect-dialog.tsx:118 · src/components/settings/opencode-connect-dialog.tsx:498 — the two spans are one implementation copied and then locally edited — 277 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 (56 lines × 2 locations) src/contexts/workspace-context.tsx:1829— src/contexts/workspace-context.tsx:1829 · src/contexts/workspace-context.tsx:2184 — both copies are in the same file, so extract the 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 (55 matched lines × 2 locations) · ×1
Duplicated block with local edits (55 matched lines × 2 locations) src/components/settings/general-settings.tsx:170— src/components/settings/general-settings.tsx:170 · src/components/settings/system-network-settings.tsx:281 — the two spans are one implementation copied and then locally edited — 257 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 (54 lines × 2 locations) src/app/push/page.tsx:54— src/app/push/page.tsx:54 · src/app/stash/page.tsx:38 — 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.
R10 · Code Duplication· Duplicated block with local edits (52 matched lines × 2 locations) · ×1
Duplicated block with local edits (52 matched lines × 2 locations) src/components/canvas/canvas-conversation-surface.tsx:691— src/components/canvas/canvas-conversation-surface.tsx:691 · src/components/conversations/conversation-detail-panel.tsx:1314 — the two spans are one implementation copied and then locally edited — 218 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.
Complex function AcpAgentSettings (cyclomatic 275, cognitive 260) src/components/settings/acp-agent-settings.tsx:4973— AcpAgentSettings has cyclomatic complexity 275 and cognitive complexity 260; 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 connectionsReducer (cyclomatic 269, cognitive 360) src/contexts/acp-connections-context.tsx:1982— connectionsReducer has cyclomatic complexity 269 and cognitive complexity 360; 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 reducer (cyclomatic 162, cognitive 188) src/stores/conversation-runtime-store.ts:2363— reducer has cyclomatic complexity 162 and cognitive complexity 188; 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 155, cognitive 196) src/contexts/acp-connections-context.tsx:5279— (anonymous) has cyclomatic complexity 155 and cognitive complexity 196; 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 TaskDetailSheet (cyclomatic 133, cognitive 154) src/components/tasks/task-detail-sheet.tsx:219— TaskDetailSheet has cyclomatic complexity 133 and cognitive complexity 154; 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 PiConfigPanel (cyclomatic 107, cognitive 95) src/components/settings/pi-config-panel.tsx:306— PiConfigPanel has cyclomatic complexity 107 and cognitive complexity 95; 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 buildStreamingTurnsFromLiveMessage (cyclomatic 86, cognitive 204) src/stores/conversation-runtime-store.ts:1138— buildStreamingTurnsFromLiveMessage has cyclomatic complexity 86 and cognitive complexity 204; 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 ConversationTabView (cyclomatic 85, cognitive 72) src/components/conversations/conversation-detail-panel.tsx:271— ConversationTabView has cyclomatic complexity 85 and cognitive complexity 72; 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 FileWorkspacePanelBody (cyclomatic 83, cognitive 90) src/components/files/file-workspace-panel.tsx:779— FileWorkspacePanelBody has cyclomatic complexity 83 and cognitive complexity 90; 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 78, cognitive 123) src/contexts/acp-connections-context.tsx:7316— (anonymous) has cyclomatic complexity 78 and cognitive complexity 123; 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 adaptMessageTurn (cyclomatic 73, cognitive 157) src/lib/adapters/ai-elements-adapter.ts:2452— adaptMessageTurn has cyclomatic complexity 73 and cognitive complexity 157; 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 StatusBarUpdate (cyclomatic 72, cognitive 68) src/components/layout/status-bar-update.tsx:115— StatusBarUpdate has cyclomatic complexity 72 and cognitive complexity 68; 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 buildAgentDraft (cyclomatic 71, cognitive 70) src/components/settings/acp-agent-settings.tsx:3907— buildAgentDraft has cyclomatic complexity 71 and cognitive complexity 70; 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 GitChangesTab (cyclomatic 70, cognitive 66) src/components/layout/aux-panel-git-changes-tab.tsx:505— GitChangesTab has cyclomatic complexity 70 and cognitive complexity 66; 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 ForgeIssueDetailSheet (cyclomatic 69, cognitive 64) src/components/forge/forge-issue-detail-sheet.tsx:2506— ForgeIssueDetailSheet has cyclomatic complexity 69 and cognitive complexity 64; 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 TaskDeliverPrDialog (cyclomatic 68, cognitive 63) src/components/tasks/task-deliver-pr-dialog.tsx:90— TaskDeliverPrDialog has cyclomatic complexity 68 and cognitive complexity 63; 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 MessageInput (cyclomatic 65, cognitive 55) REDACTED:332— MessageInput has cyclomatic complexity 65 and cognitive complexity 55; 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 (anonymous) (cyclomatic 64, cognitive 95) REDACTED:201— (anonymous) has cyclomatic complexity 64 and cognitive complexity 95; 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 ForgePage (cyclomatic 63, cognitive 62) src/components/forge/forge-page.tsx:630— ForgePage has cyclomatic complexity 63 and cognitive complexity 62; 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 TokenUsagePage (cyclomatic 62, cognitive 53) src/components/token-usage/token-usage-page.tsx:328— TokenUsagePage has cyclomatic complexity 62 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 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 CursorConfigPanel (cyclomatic 61, cognitive 58) src/components/settings/cursor-config-panel.tsx:333— CursorConfigPanel has cyclomatic complexity 61 and cognitive complexity 58; 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 SystemNetworkSettings (cyclomatic 59, cognitive 49) src/components/settings/system-network-settings.tsx:108— SystemNetworkSettings has cyclomatic complexity 59 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 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 AgentRow (cyclomatic 59, cognitive 48) src/components/message/activity/rows/agent-row.tsx:47— AgentRow has cyclomatic complexity 59 and cognitive complexity 48; 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 pipelineStages (cyclomatic 58, cognitive 88) src/lib/grep-no-match.ts:179— pipelineStages has cyclomatic complexity 58 and cognitive complexity 88; 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 MessageListView (cyclomatic 57, cognitive 56) src/components/message/message-list-view.tsx:1525— MessageListView has cyclomatic complexity 57 and cognitive complexity 56; 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 splitCommandLine (cyclomatic 54, cognitive 104) src/lib/activity/exit-meaning.ts:78— splitCommandLine has cyclomatic complexity 54 and cognitive complexity 104; 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 SkillsSettings (cyclomatic 54, cognitive 46) src/components/settings/skills-settings.tsx:166— SkillsSettings has cyclomatic complexity 54 and cognitive complexity 46; 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 actJson (cyclomatic 53, cognitive 69) REDACTED:526— actJson has cyclomatic complexity 53 and cognitive complexity 69; 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 CodexModelListEditor (cyclomatic 53, cognitive 46) src/components/settings/codex-model-list-editor.tsx:246— CodexModelListEditor has cyclomatic complexity 53 and cognitive complexity 46; 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 BackupSettings (cyclomatic 53, cognitive 44) src/components/settings/backup-settings.tsx:118— BackupSettings has cyclomatic complexity 53 and cognitive complexity 44; 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 deriveFlowGraph (cyclomatic 51, cognitive 85) src/components/canvas/canvas-model.ts:891— deriveFlowGraph has cyclomatic complexity 51 and cognitive complexity 85; 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 inferFromInput (cyclomatic 50, cognitive 41) REDACTED:409— inferFromInput has cyclomatic complexity 50 and cognitive complexity 41; 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 codeModeCallSite (cyclomatic 49, cognitive 88) src/lib/delegation-card.ts:429— codeModeCallSite has cyclomatic complexity 49 and cognitive complexity 88; 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 McpSettings (cyclomatic 47, cognitive 46) src/components/settings/mcp-settings.tsx:412— McpSettings has cyclomatic complexity 47 and cognitive complexity 46; 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 describeUncached (cyclomatic 47, cognitive 42) src/lib/activity/describe-tool-call.ts:631— describeUncached has cyclomatic complexity 47 and cognitive complexity 42; 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 FileTreeTab (cyclomatic 46, cognitive 43) src/components/layout/aux-panel-file-tree-tab.tsx:1136— FileTreeTab has cyclomatic complexity 46 and cognitive complexity 43; 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 toolStepKind (cyclomatic 46, cognitive 19) src/lib/activity/describe-tool-call.ts:98— toolStepKind has cyclomatic complexity 46 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 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 ConfigSyncSettings (cyclomatic 45, cognitive 43) src/components/settings/config-sync-settings.tsx:140— ConfigSyncSettings has cyclomatic complexity 45 and cognitive complexity 43; 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 ComposerContextUsage (cyclomatic 45, cognitive 42) src/components/chat/composer-context-usage.tsx:34— ComposerContextUsage has cyclomatic complexity 45 and cognitive complexity 42; 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 DelegationStatusRow (cyclomatic 45, cognitive 41) src/components/message/delegation-status-row.tsx:90— DelegationStatusRow has cyclomatic complexity 45 and cognitive complexity 41; 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.
R3 · Large Files· src/components/settings/acp-agent-settings.tsx · ×1
src/components/settings/acp-agent-settings.tsx: 13289 lines of code src/components/settings/acp-agent-settings.tsx:1— src/components/settings/acp-agent-settings.tsx has 13289 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· src/contexts/acp-connections-context.tsx · ×1
src/contexts/acp-connections-context.tsx: 8293 lines of code src/contexts/acp-connections-context.tsx:1— src/contexts/acp-connections-context.tsx has 8293 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/lib/api.ts: 6194 lines of code src/lib/api.ts:1— src/lib/api.ts has 6194 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/lib/types.ts: 5908 lines of code src/lib/types.ts:1— src/lib/types.ts has 5908 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· src/stores/conversation-runtime-store.ts · ×1
src/stores/conversation-runtime-store.ts: 5177 lines of code src/stores/conversation-runtime-store.ts:1— src/stores/conversation-runtime-store.ts has 5177 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· src/contexts/workspace-context.tsx · ×1
src/contexts/workspace-context.tsx: 3646 lines of code src/contexts/workspace-context.tsx:1— src/contexts/workspace-context.tsx has 3646 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· src/components/conversations/sidebar-conversation-list.tsx · ×1
src/components/conversations/sidebar-conversation-list.tsx: 3642 lines of code src/components/conversations/sidebar-conversation-list.tsx:1— src/components/conversations/sidebar-conversation-list.tsx has 3642 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/stores/tab-store.ts: 3554 lines of code src/stores/tab-store.ts:1— src/stores/tab-store.ts has 3554 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· src/components/layout/aux-panel-file-tree-tab.tsx · ×1
src/components/layout/aux-panel-file-tree-tab.tsx: 3498 lines of code src/components/layout/aux-panel-file-tree-tab.tsx:1— src/components/layout/aux-panel-file-tree-tab.tsx has 3498 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· src/components/forge/forge-issue-detail-sheet.tsx · ×1
src/components/forge/forge-issue-detail-sheet.tsx: 3214 lines of code src/components/forge/forge-issue-detail-sheet.tsx:1— src/components/forge/forge-issue-detail-sheet.tsx has 3214 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· src/components/conversations/conversation-detail-panel.tsx · ×1
src/components/conversations/conversation-detail-panel.tsx: 3168 lines of code src/components/conversations/conversation-detail-panel.tsx:1— src/components/conversations/conversation-detail-panel.tsx has 3168 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· src/components/forge/forge-page.tsx · ×1
src/components/forge/forge-page.tsx: 2876 lines of code src/components/forge/forge-page.tsx:1— src/components/forge/forge-page.tsx has 2876 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· src/lib/adapters/ai-elements-adapter.ts · ×1
src/lib/adapters/ai-elements-adapter.ts: 2737 lines of code src/lib/adapters/ai-elements-adapter.ts:1— src/lib/adapters/ai-elements-adapter.ts has 2737 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 2702 lines of code REDACTED:1— REDACTED has 2702 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· src/components/layout/aux-panel-git-log-tab.tsx · ×1
src/components/layout/aux-panel-git-log-tab.tsx: 2652 lines of code src/components/layout/aux-panel-git-log-tab.tsx:1— src/components/layout/aux-panel-git-log-tab.tsx has 2652 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· src/components/message/message-list-view.tsx · ×1
src/components/message/message-list-view.tsx: 2379 lines of code src/components/message/message-list-view.tsx:1— src/components/message/message-list-view.tsx has 2379 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· src/components/canvas/canvas-view.tsx · ×1
src/components/canvas/canvas-view.tsx: 2321 lines of code src/components/canvas/canvas-view.tsx:1— src/components/canvas/canvas-view.tsx has 2321 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 2266 lines of code REDACTED:1— REDACTED has 2266 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· src/components/layout/aux-panel-git-changes-tab.tsx · ×1
src/components/layout/aux-panel-git-changes-tab.tsx: 2227 lines of code src/components/layout/aux-panel-git-changes-tab.tsx:1— src/components/layout/aux-panel-git-changes-tab.tsx has 2227 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· src/components/tasks/task-detail-sheet.tsx · ×1
src/components/tasks/task-detail-sheet.tsx: 2066 lines of code src/components/tasks/task-detail-sheet.tsx:1— src/components/tasks/task-detail-sheet.tsx has 2066 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· src/components/files/file-workspace-panel.tsx · ×1
src/components/files/file-workspace-panel.tsx: 1977 lines of code src/components/files/file-workspace-panel.tsx:1— src/components/files/file-workspace-panel.tsx has 1977 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· src/components/settings/mcp-settings.tsx · ×1
src/components/settings/mcp-settings.tsx: 1787 lines of code src/components/settings/mcp-settings.tsx:1— src/components/settings/mcp-settings.tsx has 1787 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· src/components/conversations/sidebar-conversation-grouping.ts · ×1
src/components/conversations/sidebar-conversation-grouping.ts: 1672 lines of code src/components/conversations/sidebar-conversation-grouping.ts:1— src/components/conversations/sidebar-conversation-grouping.ts has 1672 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/lib/delegation-card.ts: 1640 lines of code src/lib/delegation-card.ts:1— src/lib/delegation-card.ts has 1640 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· src/components/settings/pi-config-panel.tsx · ×1
src/components/settings/pi-config-panel.tsx: 1606 lines of code src/components/settings/pi-config-panel.tsx:1— src/components/settings/pi-config-panel.tsx has 1606 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· src/components/token-usage/token-usage-page.tsx · ×1
src/components/token-usage/token-usage-page.tsx: 1535 lines of code src/components/token-usage/token-usage-page.tsx:1— src/components/token-usage/token-usage-page.tsx has 1535 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· src/app/activity-gallery/page.gallery.tsx · ×1
src/app/activity-gallery/page.gallery.tsx: 1523 lines of code src/app/activity-gallery/page.gallery.tsx:1— src/app/activity-gallery/page.gallery.tsx has 1523 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· src/app/workspace/layout.tsx · ×1
src/app/workspace/layout.tsx: 1503 lines of code src/app/workspace/layout.tsx:1— src/app/workspace/layout.tsx has 1503 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
browser-agent/src/act.ts: 1467 lines of code browser-agent/src/act.ts:1— browser-agent/src/act.ts has 1467 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· src/components/automations/automations-page.tsx · ×1
src/components/automations/automations-page.tsx: 1434 lines of code src/components/automations/automations-page.tsx:1— src/components/automations/automations-page.tsx has 1434 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· src/components/chat/composer/use-composer-attachments.ts · ×1
src/components/chat/composer/use-composer-attachments.ts: 1402 lines of code src/components/chat/composer/use-composer-attachments.ts:1— src/components/chat/composer/use-composer-attachments.ts has 1402 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· src/components/layout/commit-dialog.tsx · ×1
src/components/layout/commit-dialog.tsx: 1380 lines of code src/components/layout/commit-dialog.tsx:1— src/components/layout/commit-dialog.tsx has 1380 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· src/browser-injected/picker.js · ×1
src/browser-injected/picker.js: 1288 lines of code src/browser-injected/picker.js:1— src/browser-injected/picker.js has 1288 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· src/components/settings/kimi-code-config-panel.tsx · ×1
src/components/settings/kimi-code-config-panel.tsx: 1282 lines of code src/components/settings/kimi-code-config-panel.tsx:1— src/components/settings/kimi-code-config-panel.tsx has 1282 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· src/components/settings/antigravity-config-panel.tsx · ×1
src/components/settings/antigravity-config-panel.tsx: 1275 lines of code src/components/settings/antigravity-config-panel.tsx:1— src/components/settings/antigravity-config-panel.tsx has 1275 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· src/components/settings/config-sync-settings.tsx · ×1
src/components/settings/config-sync-settings.tsx: 1264 lines of code src/components/settings/config-sync-settings.tsx:1— src/components/settings/config-sync-settings.tsx has 1264 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· src/components/settings/skills-settings.tsx · ×1
src/components/settings/skills-settings.tsx: 1256 lines of code src/components/settings/skills-settings.tsx:1— src/components/settings/skills-settings.tsx has 1256 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· src/components/message/conversation-message-nav.tsx · ×1
src/components/message/conversation-message-nav.tsx: 1177 lines of code src/components/message/conversation-message-nav.tsx:1— src/components/message/conversation-message-nav.tsx has 1177 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/lib/tauri.ts: 1170 lines of code src/lib/tauri.ts:1— src/lib/tauri.ts has 1170 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· src/components/conversations/conversation-manage-dialog.tsx · ×1
src/components/conversations/conversation-manage-dialog.tsx: 1157 lines of code src/components/conversations/conversation-manage-dialog.tsx:1— src/components/conversations/conversation-manage-dialog.tsx has 1157 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 (~69 LoC) src/components/chat/experts-command-menu.tsx— no import path from any entry point (111 application, 9 tooling, 846 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 (~67 LoC) src/hooks/use-branch-tree-expansion.ts— no import path from any entry point (111 application, 9 tooling, 846 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 (~57 LoC) src/components/layout/new-folder-dropdown.tsx— no import path from any entry point (111 application, 9 tooling, 846 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 (~37 LoC) src/components/chat/connection-status.tsx— no import path from any entry point (111 application, 9 tooling, 846 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 (~7 LoC) src/lib/agent-modes.ts— no import path from any entry point (111 application, 9 tooling, 846 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 '@tauri-apps/plugin-window-state' package.json:47— Declared in the root 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.
`async` Promise executor REDACTED:498— The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
X18 · Disposal-pattern correctness· Raw handle taken from an owned value and never reclaimed · ×1
Raw handle taken from an owned value and never reclaimed src-tauri/src/commands/windows.rs:2012— `decoded.into_raw()` (line 2012) gives up ownership in exchange for a raw handle — the value's `Drop` will no longer run — and nothing in the crate's code ever reclaims a `image` from a raw pointer (`image::from_raw`). The memory or descriptor stays allocated until the process ends, once per call. Pair the hand-out with its reclaim (a `free` function that rebuilds the owner with `from_raw` and drops it), or keep the owning value.
X29 · Per-element action decided by a fixed element· Per-element action decided by a fixed element · ×1
Per-element action decided by a fixed element src/lib/json-render/chart-data.ts:195— This loop runs once per element of `rows`, and the statement it guards acts on the element it is on — `row`. The test deciding whether that statement runs does not: `label === null` reads `rows[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 192, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
Mock-dominated test: is wired into the shared defineMonacoThemes beforeMount hook src/lib/monaco-themes.test.ts:103— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: bounds readiness waits for older servers that never emit __ready__ src/lib/transport/remote-desktop-transport-lifecycle.test.ts:276— This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: resyncs state when a window was first opened while the server was offline src/lib/transport/remote-desktop-transport.test.ts:199— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: releases an IPC listener that arrives after its window was destroyed src/lib/transport/remote-desktop-transport.test.ts:375— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: toasts a structured backend error with its message src/hooks/use-connection-lifecycle.send-failure.test.ts:107— This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: toasts the fallback shape the transport builds for a plain-text 413 src/hooks/use-connection-lifecycle.send-failure.test.ts:129— This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: routes TurnBusyError to onTurnInProgress with no toast and no onSendFailed src/hooks/use-connection-lifecycle.send-failure.test.ts:168— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: stacked layers: back closes only the topmost one src/hooks/use-history-back-dismiss.test.ts:108— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: three stacked layers unwind one per back src/hooks/use-history-back-dismiss.test.ts:124— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: re-reads the conversation list after opening the folder src/components/workspace/deep-link-bootstrap.test.tsx:103— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: shrugs off a backend that cannot answer src/components/workspace/workspace-restore-notices.test.tsx:117— This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: sends the closing list along with the message src/components/tasks/task-deliver-pr-dialog.test.tsx:675— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: says nothing extra when the merge starts right away src/components/tasks/task-merge-dialog.test.tsx:219— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not open the detail sheet when a secondary action is clicked src/components/tasks/task-row.test.tsx:168— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: keeps the dialog open and shows an error when the typed path is invalid src/components/shared/directory-browser-dialog.test.tsx:108— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not commit a path when the dialog is cancelled mid-validation src/components/shared/directory-browser-dialog.test.tsx:150— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: copies the backend plain_text blob and toasts src/components/settings/agent-diagnostics-dialog.test.tsx:89— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: still reports the save when the sync probe itself fails src/components/settings/antigravity-config-panel.test.tsx:304— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does NOT poll health and reload when the restart request fails src/components/settings/backup-settings.test.tsx:337— This test sets up 4 test doubles (for example `vi.mock/jest.mock of an imported module`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: rolls the env back when the rules write fails (API-key mode) src/components/settings/cursor-config-panel.test.tsx:319— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 1 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: subscription mode shows the runnable login command and saves login-only env src/components/settings/cursor-config-panel.test.tsx:369— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: tests each interface's key the way its SDK would send it src/components/settings/kimi-code-config-panel.test.tsx:635— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: saves the token through the env channel src/components/settings/qoder-config-panel.test.tsx:197— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: hands the folder the clone opened to onFolderOpened, then closes src/components/layout/clone-dialog.test.tsx:128— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: reports nothing when the clone fails src/components/layout/clone-dialog.test.tsx:154— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Duplicated predicate src/browser-injected/helper.js:186— `!!event.isTrusted || globalThis.__codegAcceptUntrusted === true` appears character-identically in 2 files — src/browser-injected/helper.js, src/browser-injected/picker.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 src/lib/jsonc-edit.ts:69— `!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length` appears character-identically in 2 files — src/lib/jsonc-edit.ts, src/stores/conversation-runtime-store.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/conversations/sidebar-conversation-card.tsx:141— `!activeTab || activeTab.kind !== "conversation"` appears character-identically in 2 files — src/components/conversations/sidebar-conversation-card.tsx, src/components/layout/aux-panel-git-changes-tab.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/layout/status-bar-mcp.tsx:106— `!aliveRef.current || seq !== seqRef.current` appears character-identically in 2 files — src/components/layout/status-bar-mcp.tsx, src/lib/computer/use-computer-status.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/layout/aux-panel-file-tree-tab.tsx:2755— `!folder?.path || !directoryGitActionType` appears character-identically in 2 files — src/components/layout/aux-panel-file-tree-tab.tsx, src/components/layout/aux-panel-git-changes-tab.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/lib/api.ts:342— `!isDesktop() || getActiveRemoteConnectionId() !== null` appears character-identically in 3 files — src/lib/api.ts, src/lib/link-open.ts, src/lib/platform.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/message/codex-visualize-card.tsx:300— `!isHomeRelativePath(path) && !isAbsoluteFilePath(path)` appears character-identically in 2 files — src/components/message/codex-visualize-card.tsx, src/components/message/read-image-preview.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/lib/activity/code-mode.ts:87— `!meta || typeof meta !== "object" || Array.isArray(meta)` appears character-identically in 3 files — src/lib/activity/code-mode.ts, src/lib/activity/command.ts, src/lib/codex-code-mode.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/settings/assistants-panel.tsx:224— `!order || !start || sameOrder(order, start)` appears character-identically in 2 files — src/components/settings/assistants-panel.tsx, src/components/settings/mention-panel-settings.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/layout/aux-panel-git-log-tab.tsx:261— `!parsed || typeof parsed !== "object" || Array.isArray(parsed)` appears character-identically in 16 files — src/components/layout/aux-panel-git-log-tab.tsx, src/components/message/goal-tool-call.tsx, src/components/message/use-agent-call-model.ts, src/components/settings/acp-agent-settings.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/message/use-agent-call-model.ts:132— `!raw || typeof raw !== "object" || Array.isArray(raw)` appears character-identically in 5 files — src/components/message/use-agent-call-model.ts, src/components/settings/acp-agent-settings.tsx, src/lib/activity/progress.ts, src/lib/model-label-store.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/message/activity/activity-row.tsx:131— `!styles.animationName || styles.animationName === "none"` appears character-identically in 2 files — src/components/message/activity/activity-row.tsx, src/components/message/slide-slot.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/contexts/workspace-context.tsx:3145— `!tab || tab.kind !== "file" || !tab.path` appears character-identically in 2 files — src/contexts/workspace-context.tsx, src/hooks/use-open-file-tabs-watch.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/ai-elements/json-tree.tsx:79— `!trimmed.startsWith("{") && !trimmed.startsWith("[")` appears character-identically in 3 files — src/components/ai-elements/json-tree.tsx, src/lib/activity/mcp.ts, src/lib/permission-request.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/message/goal-tool-call.tsx:57— `!value || typeof value !== "object" || Array.isArray(value)` appears character-identically in 10 files — src/components/message/goal-tool-call.tsx, src/components/message/live-turn-stats.tsx, src/components/settings/acp-agent-settings.tsx, src/contexts/acp-connections-context.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/canvas/canvas-conversation-surface.tsx:548— `!wasPrompting || connStatus === "prompting"` appears character-identically in 3 files — src/components/canvas/canvas-conversation-surface.tsx, src/components/conversations/conversation-detail-panel.tsx, src/components/message/live-transcript-view.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/message/activity/rows/edit-row.tsx:73— `(failed && !recoveredKeys.has(step.key)) || tool.status === "awaiting"` appears character-identically in 4 files — src/components/message/activity/rows/edit-row.tsx, src/components/message/activity/rows/explore-rows.tsx, src/components/message/activity/rows/generic-row.tsx, src/components/message/activity/rows/mcp-row.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/lib/link-classify.ts:96— `(path.startsWith("/") && !path.startsWith("//")) || path.startsWith("\\\\") || path.startsWith("./") || path.startsWith("../") || path.start…` appears character-identically in 2 files — src/lib/link-classify.ts, src/lib/resource-kind.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/settings/mcp-settings.tsx:160— `Boolean(value) && typeof value === "object" && !Array.isArray(value)` appears character-identically in 2 files — src/components/settings/mcp-settings.tsx, src/lib/jsonc-edit.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/automations/automation-editor.tsx:71— `Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC"` appears character-identically in 2 files — src/components/automations/automation-editor.tsx, src/components/automations/automation-templates.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/lib/conversation-tags.ts:146— `a.sort_order - b.sort_order || a.id - b.id` appears character-identically in 2 files — src/lib/conversation-tags.ts, src/stores/assistants-store.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/settings/acp-agent-settings.tsx:5137— `a.sort_order - b.sort_order || a.name.localeCompare(b.name)` appears character-identically in 3 files — src/components/settings/acp-agent-settings.tsx, src/components/settings/skills-settings.tsx, src/hooks/use-acp-agents.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/layout/branch-selector-list.tsx:256— `active instanceof HTMLElement && (active.tagName === "INPUT" || active.tagName === "TEXTAREA" || active.isContentEditable)` appears character-identically in 2 files — src/components/layout/branch-selector-list.tsx, src/components/layout/git-log-branch-filter-list.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/components/settings/custom-skills-settings.tsx:205— `agent.skills_capable && !piUsesCustomAgentDir(agent)` appears character-identically in 5 files — src/components/settings/custom-skills-settings.tsx, src/components/settings/experts-settings.tsx, src/components/settings/generative-ui-settings.tsx, src/components/settings/office-tools-settings.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/lib/computer/use-computer-status.ts:74— `aliveRef.current && seq === seqRef.current` appears character-identically in 2 files — src/lib/computer/use-computer-status.ts, src/lib/web-service/use-local-web-server-status.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:540— `error!` at line 540 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:570— `error!` at line 570 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:577— `debug!` at line 577 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:772— `debug!` at line 772 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:938— `debug!` at line 938 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:955— `debug!` at line 955 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:974— `debug!` at line 974 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:1170— `debug!` at line 1170 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/acp_transcript.rs:1220— `debug!` at line 1220 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/app_menu.rs:185— `warn!` at line 185 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/deep_link.rs:266— `warn!` at line 266 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/deep_link.rs:292— `warn!` at line 292 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/deep_link.rs:297— `info!` at line 297 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/deep_link.rs:300— `warn!` at line 300 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/deep_link.rs:336— `info!` at line 336 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/deep_link.rs:337— `warn!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:167— `error!` at line 167 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:181— `error!` at line 181 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:542— `info!` at line 542 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:552— `warn!` at line 552 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:559— `info!` at line 559 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:576— `error!` at line 576 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:584— `info!` at line 584 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:589— `info!` at line 589 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src-tauri/src/git_credential.rs:622— `info!` at line 622 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
+ 15 more in this group — see findings.md.
X7 · Silent fallback defaults· Pending state with no failure state · ×27
Pending state with no failure state src/components/terminal/terminal-view.tsx:938— The view draws `Starting terminal...` under `loading && isActive`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/tasks/task-transcript-dialog.tsx:141— The view draws `<div class="flex h-full items-center justify-center">` under `resolved == null`, but `resolved` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/settings/backup-settings.tsx:577— The view draws `<Loader2 class="h-3.5 w-3.5 animate-spin"/>` under `exporting`, but `exporting` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/settings/backup-settings.tsx:630— The view draws `<Loader2 class="h-3.5 w-3.5 animate-spin"/>` under `( inspecting || uploading )`, but `inspecting` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/settings/backup-settings.tsx:839— The view draws `<Loader2 class="h-3.5 w-3.5 animate-spin"/>` under `restoring`, but `restoring` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/settings/channel-commands-tab.tsx:96— The view draws `<Loader2 class="h-3.5 w-3.5 animate-spin"/>` under `saving`, but `saving` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/settings/custom-agent-skills-toggle.tsx:168— The view draws `<Loader2 class="mr-1 h-3.5 w-3.5 animate-spin"/>` under `saving`, but `saving` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/settings/model-provider-settings.tsx:136— The view draws `<div class="flex items-center justify-center py-8">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/merge/merge-workspace.tsx:247— The view draws `<div class="flex h-full items-center justify-center text-sm text-muted-foreground">` under `preparing`, but `preparing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/merge/merge-workspace.tsx:252— The view draws `<div class="flex h-full items-center justify-center text-sm text-muted-foreground">` under `loadingVersions`, but `loadingVersions` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/merge/merge-workspace.tsx:283— The view draws `<Loader2 class="mr-1.5 h-3.5 w-3.5 animate-spin"/>` under `aborting`, but `aborting` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/merge/merge-workspace.tsx:298— The view draws `<Loader2 class="mr-1.5 h-3.5 w-3.5 animate-spin"/>` under `resolving`, but `resolving` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/merge/merge-workspace.tsx:309— The view draws `<Loader2 class="mr-1.5 h-3.5 w-3.5 animate-spin"/>` under `completing`, but `completing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/conflict-dialog.tsx:228— The view draws `<Loader2 class="mr-1.5 h-3.5 w-3.5 animate-spin"/>` under `aborting`, but `aborting` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/conflict-dialog.tsx:248— The view draws `<Loader2 class="mr-1.5 h-3.5 w-3.5 animate-spin"/>` under `completing`, but `completing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/push-workspace.tsx:619— The view draws `<div class="flex items-center justify-center py-12">` under `listLoading`, but `listLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/push-workspace.tsx:719— The view draws `<Loader2 class="mr-2 h-4 w-4 animate-spin"/>` under `pushing`, but `pushing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/push-workspace.tsx:735— The view draws `<div class="flex h-full items-center justify-center">` under `diffLoading`, but `diffLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/stash-dialog.tsx:114— The view draws `<Loader2 class="mr-1.5 h-3.5 w-3.5 animate-spin"/>` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/workspace-folder-dialog.tsx:436— The view draws `<Loader2 class="size-4 animate-spin"/>` under `openingRoot`, but `openingRoot` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/workspace-folder-dialog.tsx:487— The view draws `<Loader2 class="size-4 animate-spin"/>` under `previewing`, but `previewing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/workspace-folder-dialog.tsx:526— The view draws `<div class="flex items-center gap-2 p-4 text-sm text-muted-foreground">` under `loadingLinks && links . length === 0 && pending . length === 0`, but `loadingLinks` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/workspace-folder-dialog.tsx:646— The view draws `<Loader2 class="size-4 animate-spin"/>` under `creating`, but `creating` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/layout/workspace-folder-dialog.tsx:868— The view draws `<Loader2 class="size-3.5 animate-spin"/>` under `busy`, but `busy` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state src/components/conversations/move-conversation-dialog.tsx:211— The view draws `<Loader2 class="h-3.5 w-3.5 animate-spin"/>` under `pending`, but `pending` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Orphaned file src-tauri/src/db/migration/m20260211_000001_init.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 src/components/ai-elements/commit.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/components/ui/combobox.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src-tauri/src/db/migration/m20260703_000001_chat_channel_thread_binding.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 src/components/ui/field.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/components/ui/input-group.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src-tauri/src/db/service/thread_binding_service.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 src/components/ui/tabs.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/components/ui/avatar.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/contexts/task-context.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/components/ui/button.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src-tauri/src/db/migration/m20260226_000001_agent_setting.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 src-tauri/src/db/migration/m20260219_000001_folder_command.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 src/components/layout/status-bar-tasks.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/components/ui/card.tsx: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.
Silent fallback default on Err src-tauri/src/acp/codex_endpoint_catalog.rs:724— `for_url` 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 src-tauri/src/forge/cnb.rs:904— `number` 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 src-tauri/src/forge/cnb.rs:969— `number` 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 src-tauri/src/parsers/cline.rs:417— `list_session_store` 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 REDACTED:470— `scan_subagent_session_ids` 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 src-tauri/src/acp/binary_cache.rs:784— `parse_version_parts` 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 src-tauri/src/acp/chat_authoring.rs:240— `local_timezone` turns every `Err` into `"UTC".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 src-tauri/src/acp/delegation/companion.rs:560— `request_id_key` turns every `Err` into `String::from("null")` — 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 src-tauri/src/acp/latest_release.rs:248— `is_strictly_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 src-tauri/src/acp/temp_reclaim.rs:183— `dir_size` 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 src-tauri/src/acp_transcript.rs:997— `read_transcript_in` turns every `Err` into `Transcript::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 src-tauri/src/acp_transcript.rs:1269— `list_session_ids_in` 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 src-tauri/src/browser/shim/windows.rs:496— `session_of` turns every `Err` into `Some(String::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.
redundant comment src/components/files/file-workspace-panel.tsx:1805— "Preview mode for markdown files" repeats the code it sits on: 4 of its 4 words (preview, mode, markdown, files) are already in `const isPreviewMode =`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/components/merge/merge-diff.ts:202— "Sort by baseStart, then by side (left first)" repeats the code it sits on: 5 of its 6 words (sort, base, start, side, left) are already in `ranged.sort(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/components/merge/merge-diff.ts:285— "Sort by baseStart" repeats the code it sits on: 3 of its 3 words (sort, base, start) are already in `mergeHunks.sort((a, b) => a.baseStart - b.baseStart)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/components/merge/merge-workspace.tsx:137— "Auto-select next unresolved file" repeats the code it sits on: 4 of its 5 words (select, next, unresolved, file) are already in `const nextUnresolved = files.find(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/components/merge/three-pane-merge-editor.tsx:129— "Build the result content from base + applied hunks" repeats the code it sits on: 6 of its 6 words (build, result, content, base, applied, hunks) are already in `const resultContent = useMemo(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/contexts/acp-connections-context.tsx:4499— "── setActiveKey ──" repeats the code it sits on: 3 of its 3 words (set, active, key) are already in `const setActiveKey = useCallback(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
Hand-rolled JSON/XML parsing via regex src-tauri/src/acp/error.rs:183— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Rust code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:70— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/lib/adapters/ai-elements-adapter.ts:1155— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×2
Projects may be oversized for their cohesion src-tauri/Cargo.toml:1— `src-tauri` (594742 LoC, 2543 module-visible types across 58 directories) overshoots its size bounds. 2 of 2 build unit(s) (Cargo, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
Projects may be oversized for their cohesion package.json:1— `(repository root)` (330448 LoC, 2359 module-visible types across 95 directories) overshoots its size bounds. 2 of 2 build unit(s) (Cargo, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×2
Diagnostic log message is built whether or not it is wanted src-tauri/src/acp/background_watch.rs:1875— `tracing::debug!` at line 1875 is called with an argument built by `initiator_text.chars().take(60).collect::<String>()` (line 1877), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls.
Diagnostic log message is built whether or not it is wanted src-tauri/src/acp/background_watch.rs:1881— `tracing::debug!` at line 1881 is called with an argument built by `initiator_text.chars().take(60).collect::<String>()` (line 1883), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
No ADRs found package.json:7— 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 `package.json` makes this repository a deployable product (line 7).
D21 · Naming Consistency· `getJSON` spells `JSON` where 38 names in the project spell it `Json` · ×1
`getJSON` spells `JSON` where 38 names in the project spell it `Json` src/components/chat/composer/rich-composer.tsx:89— 38 of 39 names in project codeg spell the token `Json` (38 of 39; unit: names in project codeg containing `Json`). Peers: json-tree.countJsonNodes (src/components/ai-elements/json-tree.tsx:57); json-tree.parseJsonForTree (src/components/ai-elements/json-tree.tsx:77); mcp-row.prettyJson (src/components/message/activity/rows/mcp-row.tsx:29); goal-tool-call.parseJsonObject (src/components/message/goal-tool-call.tsx:37); AgentDraft.codexAuthJsonText (src/components/settings/acp-agent-settings.tsx:314). Rename to `getJson`. [rule N6]
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 15 of 1363 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; 1363 of the 1696 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: src-tauri/src/db/migration/m20260211_000001_init.rs, src/components/ai-elements/commit.tsx, src/components/ui/combobox.tsx, src-tauri/src/db/migration/m20260703_000001_chat_channel_thread_binding.rs, src/components/ui/field.tsx, src/components/ui/input-group.tsx, src-tauri/src/db/service/thread_binding_service.rs, src/components/ui/tabs.tsx (and 7 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`.
No dependency-update automation package.json:26— `package.json` 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`.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety REDACTED:1239— Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code· Unused export 'CodeBlockHeader' · ×1
Unused export 'CodeBlockHeader' src/components/ai-elements/code-block.tsx:232— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockTitle' · ×1
Unused export 'CodeBlockTitle' src/components/ai-elements/code-block.tsx:248— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockFilename' · ×1
Unused export 'CodeBlockFilename' src/components/ai-elements/code-block.tsx:258— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockActions' · ×1
Unused export 'CodeBlockActions' src/components/ai-elements/code-block.tsx:268— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockCopyButton' · ×1
Unused export 'CodeBlockCopyButton' src/components/ai-elements/code-block.tsx:381— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockLanguageSelector' · ×1
Unused export 'CodeBlockLanguageSelector' src/components/ai-elements/code-block.tsx:429— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockLanguageSelectorTrigger' · ×1
Unused export 'CodeBlockLanguageSelectorTrigger' src/components/ai-elements/code-block.tsx:437— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockLanguageSelectorValue' · ×1
Unused export 'CodeBlockLanguageSelectorValue' src/components/ai-elements/code-block.tsx:455— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockLanguageSelectorContent' · ×1
Unused export 'CodeBlockLanguageSelectorContent' src/components/ai-elements/code-block.tsx:463— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CodeBlockLanguageSelectorItem' · ×1
Unused export 'CodeBlockLanguageSelectorItem' src/components/ai-elements/code-block.tsx:474— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CommitSeparator' · ×1
Unused export 'CommitSeparator' src/components/ai-elements/commit.tsx:103— Nothing imports this binding — it is safe to review for removal.
Unused export 'CommitFile' src/components/ai-elements/commit.tsx:278— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageThreadEmptyState' · ×1
Unused export 'MessageThreadEmptyState' src/components/ai-elements/message-thread.tsx:301— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageThreadDownload' · ×1
Unused export 'MessageThreadDownload' src/components/ai-elements/message-thread.tsx:394— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageActions' · ×1
Unused export 'MessageActions' src/components/ai-elements/message.tsx:100— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageBranch' · ×1
Unused export 'MessageBranch' src/components/ai-elements/message.tsx:176— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageBranchContent' · ×1
Unused export 'MessageBranchContent' src/components/ai-elements/message.tsx:229— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageBranchSelector' · ×1
Unused export 'MessageBranchSelector' src/components/ai-elements/message.tsx:262— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageBranchPrevious' · ×1
Unused export 'MessageBranchPrevious' src/components/ai-elements/message.tsx:287— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageBranchNext' · ×1
Unused export 'MessageBranchNext' src/components/ai-elements/message.tsx:311— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageBranchPage' · ×1
Unused export 'MessageBranchPage' src/components/ai-elements/message.tsx:335— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MessageToolbar' · ×1
Unused export 'MessageToolbar' src/components/ai-elements/message.tsx:662— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'SuggestionState' · ×1
Unused export 'SuggestionState' src/components/chat/composer/suggestion/types.ts:67— Nothing imports this binding — it is safe to review for removal.
Unused export 'HunkStatus' src/components/merge/merge-diff.ts:21— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'AppliedHunkInfo' · ×1
Unused export 'AppliedHunkInfo' src/components/merge/merge-diff.ts:295— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'AgentCallModel' · ×1
Unused export 'AgentCallModel' src/components/message/use-agent-call-model.ts:522— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MAX_ICON_BYTES' · ×1
Unused export 'MAX_ICON_BYTES' src/components/settings/add-custom-agent-dialog.tsx:127— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'DESCRIPTION_MAX' · ×1
Unused export 'DESCRIPTION_MAX' src/components/settings/assistant-editor-dialog.tsx:68— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PI_RESERVED_ENV_KEYS' · ×1
Unused export 'PI_RESERVED_ENV_KEYS' src/components/settings/pi-config-panel.tsx:95— Nothing imports this binding — it is safe to review for removal.
R8 · Dependency Hygiene· Type-only dependency 'ai' in production deps · ×1
Type-only dependency 'ai' in production deps src/components/ai-elements/message.tsx:3— Every import is type-only — move it to devDependencies.
Security headers incomplete — Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options, X-DNS-Prefetch-Control, X-Frame-Options. Missing: Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−0.5 on this card.) The server: `axum::serve(` (src-tauri/src/web/browser_bridge.rs:819).
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 4/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.
Outdated: axum — `axum` is locked at 0.8.8 but 0.8.9 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p axum` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.43 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.5.57 but 4.6.8 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
Outdated: http — `http` is locked at 1.4.0 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http` and commit the updated REDACTED.
Outdated: http-body — `http-body` is locked at 1.0.1 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http-body` and commit the updated REDACTED.
Outdated: hyper-util — `hyper-util` is locked at 0.1.20 but 0.1.21 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper-util` and commit the updated REDACTED.
Outdated: ignore — `ignore` is locked at 0.4.30 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ignore` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.180 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: objc2 — `objc2` is locked at 0.6.4 but 0.6.5 is the current stable release on crates.io, and it already satisfies the `"0.6"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p objc2` and commit the updated REDACTED.
Outdated: regex — `regex` is locked at 1.12.3 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.151 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: tar — `tar` is locked at 0.4.44 but 0.4.46 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tar` and commit the updated REDACTED.
Outdated: tauri — `tauri` is locked at 2.12.4 but 2.12.6 is the current stable release on crates.io, and it already satisfies the `"2.12"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri` and commit the updated REDACTED.
Outdated: tauri-build — `tauri-build` is locked at 2.7.3 but 2.7.5 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-build` and commit the updated REDACTED.
Outdated: tauri-plugin-deep-link — `tauri-plugin-deep-link` is locked at 2.6.2 but 2.6.3 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-deep-link` and commit the updated REDACTED.
Outdated: tauri-plugin-dialog — `tauri-plugin-dialog` is locked at 2.8.3 but 2.8.4 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-dialog` and commit the updated REDACTED.
Outdated: tauri-plugin-notification — `tauri-plugin-notification` is locked at 2.7.0 but 2.8.1 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-notification` and commit the updated REDACTED.
Outdated: tauri-plugin-opener — `tauri-plugin-opener` is locked at 2.7.2 but 2.7.3 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-opener` and commit the updated REDACTED.
Outdated: tauri-plugin-single-instance — `tauri-plugin-single-instance` is locked at 2.5.4 but 2.5.5 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-single-instance` and commit the updated REDACTED.
Outdated: tauri-plugin-updater — `tauri-plugin-updater` is locked at 2.14.0 but 2.14.1 is the current stable release on crates.io, and it already satisfies the `"2.14"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-plugin-updater` and commit the updated REDACTED.
Outdated: tauri-runtime-wry — `tauri-runtime-wry` is locked at 2.12.2 but 2.12.4 is the current stable release on crates.io, and it already satisfies the `"2.12"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tauri-runtime-wry` and commit the updated REDACTED.
Outdated: tempfile — `tempfile` is locked at 3.24.0 but 3.27.0 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tempfile` and commit the updated REDACTED.
Outdated: thiserror — `thiserror` is locked at 2.0.18 but 2.0.21 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p thiserror` and commit the updated REDACTED.
Skipped (documented): (unnamed test) src/components/terminal/terminal-view-recovery.test.tsx:137— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
doc comments repeat the names src/lib/aux-panel-tab-order.ts:92— 0 of 13 documented parameters and 2 of 7957 summaries in `codeg` only repeat the member or parameter name (e.g. "Same tabs in the same order." for `sameAuxTabOrder`). Delete the restating tags, or add what the name does not say.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 41 file(s) — `src/components/ai-elements/message.tsx`, `src/components/automations/cron-builder-dialog.tsx`, `src/components/browser/browser-agent-access.tsx`, `src/components/browser/browser-device-menu.tsx`, `src/components/browser/browser-status-layer.tsx`, … (+36 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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 01a1eacf-4f2d-79c4-8d7b-5f37a18729a6 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 162 · Warnings: 4032 · Recommendations: 241 · Info: 31 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 18:40 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.