Public report of farion1231/cc-switch, published 25 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 25 October 2026, 21:11 UTC · Survey ID cd_6802c7b546a14e779baf989077cd3e2b
farion1231/cc-switch
Measured 25 October 2026, 20:44 UTC, at code version de0a235
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
Test reliability is not measured: The rust executor ran against the .rs half and never executed.
CAI scoreAt riskDown 3 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 417,152 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 3.5 person-years · Weakest lens: Accessibility, 48
Findings by how serious they are
151 critical1966 serious188 minor
7 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
25 October 2026, 20:44 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
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. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
84of 84 dimensions measured by tools.
2246of 2305 findings point to an exact file and line, so you can open each one in the code. The other 59 concern the repository as a whole, such as missing documentation.
84dimensions across 7 lenses, read from 417,152 lines of product code in 2 projects.
farion1231/cc-switch is rated At risk because critical security findings are open. Its score is held back because it has controls that only work with a mouse. It scores 58 out of 100, which the At risk rating leaves unchanged.
Accessibility, at 48, is the weakest lens and counts most in the score. The best first step is making the controls keyboard-usable, worth about 5 points. Replacing the four exposed passwords or keys and switching the old ones off comes next, worth about 2 points. Raising Accessibility to 70 would lift the score to about 64.
Forty weaknesses in the code could be used by an attacker. Thirty-four pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fixing the weaknesses the scanner points to and pinning each tool to an exact version would close both risks. Updating the vulnerable packages would fix the 20 packages with a known security hole, and the four passwords or keys in the code and the two passwords or keys in the code's history need replacing, with the old ones switched off. The 14 labels or groups of fields with no name need connecting to their fields or naming.
The product code is 417,152 lines, about €500,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Accessibility rose from 48 to 70, the lowest score rated Strong, the score would rise from 58 to about 64.
Code composition: what the lines of code are
Product code 86%Tests 14%
New since the last survey: 408 findings
These 408 critical or serious findings weren't in the previous survey, on 11 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 495 findings
These 495 critical or serious findings were in the previous survey, on 11 October 2026, and are gone from this one. The first 100 are listed here.
€170,000 to €840,000, for 2,790 to 8,852 hours of work, about 3.5 person-years for 2 to 7 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 58. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 417,152 lines of product code
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Raises the score by about 4 points · Medium effort · A11y enforcement
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €500,000 to build again, about 3.5 person-years of work. Its weakest lens is Accessibility, at 48 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.1 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 500,194 lines over the last 90 days, which is about 2,028,565 lines a year. At that pace, the extra work comes to an estimated 242.7 to 1456.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
661 modules, with 890 dependencies between them. 3 loops run through 8 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 621 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.
cc_switch.error uses cc_switch.live.patch, so a change to cc_switch.live.patch can break cc_switch.error, while a change to cc_switch.error can't break cc_switch.live.patch.
Position
Below the diagonal: cc_switch.error uses a module listed above it, which is the healthy direction.
cc_switch.live.patch.json uses cc_switch.live.patch, so a change to cc_switch.live.patch can break cc_switch.live.patch.json, while a change to cc_switch.live.patch.json can't break cc_switch.live.patch.
Position
Below the diagonal: cc_switch.live.patch.json uses a module listed above it, which is the healthy direction.
cc_switch.mode.state uses cc_switch.live.engine, so a change to cc_switch.live.engine can break cc_switch.mode.state, while a change to cc_switch.mode.state can't break cc_switch.live.engine.
Position
Below the diagonal: cc_switch.mode.state uses a module listed above it, which is the healthy direction.
14→17 cc_switch.provider uses cc_switch.app_configpart of a loop✕
Connections
1 pair of types, where a type in cc_switch.provider uses a type in cc_switch.app_config.
cc_switch.provider uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.provider, while a change to cc_switch.provider can't break cc_switch.app_config.
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.
src.components.usage uses src.types.usage, so a change to src.types.usage can break src.components.usage, while a change to src.components.usage can't break src.types.usage.
Position
Below the diagonal: src.components.usage uses a module listed above it, which is the healthy direction.
cc_switch.app_config uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.app_config, while a change to cc_switch.app_config can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.app_config uses a module listed above it, which is the healthy direction.
src.components uses src.lib.api.types, so a change to src.lib.api.types can break src.components, while a change to src.components can't break src.lib.api.types.
Position
Below the diagonal: src.components uses a module listed above it, which is the healthy direction.
src.components.providers uses src.lib.api.types, so a change to src.lib.api.types can break src.components.providers, while a change to src.components.providers can't break src.lib.api.types.
Position
Below the diagonal: src.components.providers uses a module listed above it, which is the healthy direction.
src.components.providers uses src.types, so a change to src.types can break src.components.providers, while a change to src.components.providers can't break src.types.
Position
Below the diagonal: src.components.providers uses a module listed above it, which is the healthy direction.
src.components.providers.forms uses src.types, so a change to src.types can break src.components.providers.forms, while a change to src.components.providers.forms can't break src.types.
Position
Below the diagonal: src.components.providers.forms uses a module listed above it, which is the healthy direction.
src.components.providers.forms.hooks uses src.lib.api.types, so a change to src.lib.api.types can break src.components.providers.forms.hooks, while a change to src.components.providers.forms.hooks can't break src.lib.api.types.
Position
Below the diagonal: src.components.providers.forms.hooks uses a module listed above it, which is the healthy direction.
src.components.providers.forms.hooks uses src.types, so a change to src.types can break src.components.providers.forms.hooks, while a change to src.components.providers.forms.hooks can't break src.types.
Position
Below the diagonal: src.components.providers.forms.hooks uses a module listed above it, which is the healthy direction.
src.components.providers.mode uses src.lib.api.types, so a change to src.lib.api.types can break src.components.providers.mode, while a change to src.components.providers.mode can't break src.lib.api.types.
Position
Below the diagonal: src.components.providers.mode uses a module listed above it, which is the healthy direction.
src.components.providers.mode uses src.types, so a change to src.types can break src.components.providers.mode, while a change to src.components.providers.mode can't break src.types.
Position
Below the diagonal: src.components.providers.mode uses a module listed above it, which is the healthy direction.
src.components.sessions.reader.turns uses src.types, so a change to src.types can break src.components.sessions.reader.turns, while a change to src.components.sessions.reader.turns can't break src.types.
Position
Below the diagonal: src.components.sessions.reader.turns uses a module listed above it, which is the healthy direction.
cc_switch.database uses cc_switch.proxy.types, so a change to cc_switch.proxy.types can break cc_switch.database, while a change to cc_switch.database can't break cc_switch.proxy.types.
Position
Below the diagonal: cc_switch.database uses a module listed above it, which is the healthy direction.
cc_switch.database uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.database, while a change to cc_switch.database can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.database uses a module listed above it, which is the healthy direction.
cc_switch.database uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.database, while a change to cc_switch.database can't break cc_switch.app_config.
Position
Below the diagonal: cc_switch.database uses a module listed above it, which is the healthy direction.
cc_switch.proxy.forwarder uses cc_switch.proxy.types, so a change to cc_switch.proxy.types can break cc_switch.proxy.forwarder, while a change to cc_switch.proxy.forwarder can't break cc_switch.proxy.types.
Position
Below the diagonal: cc_switch.proxy.forwarder uses a module listed above it, which is the healthy direction.
cc_switch.proxy.forwarder uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.proxy.forwarder, while a change to cc_switch.proxy.forwarder can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.proxy.forwarder uses a module listed above it, which is the healthy direction.
cc_switch.proxy.forwarder uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.proxy.forwarder, while a change to cc_switch.proxy.forwarder can't break cc_switch.app_config.
Position
Below the diagonal: cc_switch.proxy.forwarder uses a module listed above it, which is the healthy direction.
src.components.sessions.reader uses src.types, so a change to src.types can break src.components.sessions.reader, while a change to src.components.sessions.reader can't break src.types.
Position
Below the diagonal: src.components.sessions.reader uses a module listed above it, which is the healthy direction.
src.components.sessions.reader uses src.components.sessions.reader.turns, so a change to src.components.sessions.reader.turns can break src.components.sessions.reader, while a change to src.components.sessions.reader can't break src.components.sessions.reader.turns.
Position
Below the diagonal: src.components.sessions.reader uses a module listed above it, which is the healthy direction.
cc_switch.claude_desktop_config uses cc_switch.live.engine, so a change to cc_switch.live.engine can break cc_switch.claude_desktop_config, while a change to cc_switch.claude_desktop_config can't break cc_switch.live.engine.
Position
Below the diagonal: cc_switch.claude_desktop_config uses a module listed above it, which is the healthy direction.
cc_switch.claude_desktop_config uses cc_switch.live.patch, so a change to cc_switch.live.patch can break cc_switch.claude_desktop_config, while a change to cc_switch.claude_desktop_config can't break cc_switch.live.patch.
Position
Below the diagonal: cc_switch.claude_desktop_config uses a module listed above it, which is the healthy direction.
cc_switch.claude_desktop_config uses cc_switch.error, so a change to cc_switch.error can break cc_switch.claude_desktop_config, while a change to cc_switch.claude_desktop_config can't break cc_switch.error.
Position
Below the diagonal: cc_switch.claude_desktop_config uses a module listed above it, which is the healthy direction.
cc_switch.claude_desktop_config uses cc_switch.live.patch.json, so a change to cc_switch.live.patch.json can break cc_switch.claude_desktop_config, while a change to cc_switch.claude_desktop_config can't break cc_switch.live.patch.json.
Position
Below the diagonal: cc_switch.claude_desktop_config uses a module listed above it, which is the healthy direction.
cc_switch.claude_desktop_config uses cc_switch.mode.state, so a change to cc_switch.mode.state can break cc_switch.claude_desktop_config, while a change to cc_switch.claude_desktop_config can't break cc_switch.mode.state.
Position
Below the diagonal: cc_switch.claude_desktop_config uses a module listed above it, which is the healthy direction.
cc_switch.claude_desktop_config uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.claude_desktop_config, while a change to cc_switch.claude_desktop_config can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.claude_desktop_config uses a module listed above it, which is the healthy direction.
cc_switch.claude_desktop_config uses cc_switch.database, so a change to cc_switch.database can break cc_switch.claude_desktop_config, while a change to cc_switch.claude_desktop_config can't break cc_switch.database.
Position
Below the diagonal: cc_switch.claude_desktop_config uses a module listed above it, which is the healthy direction.
cc_switch.mode.stack uses cc_switch.live.engine, so a change to cc_switch.live.engine can break cc_switch.mode.stack, while a change to cc_switch.mode.stack can't break cc_switch.live.engine.
Position
Below the diagonal: cc_switch.mode.stack uses a module listed above it, which is the healthy direction.
cc_switch.mode.stack uses cc_switch.mode.state, so a change to cc_switch.mode.state can break cc_switch.mode.stack, while a change to cc_switch.mode.stack can't break cc_switch.mode.state.
Position
Below the diagonal: cc_switch.mode.stack uses a module listed above it, which is the healthy direction.
cc_switch.mode.stack uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.mode.stack, while a change to cc_switch.mode.stack can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.mode.stack uses a module listed above it, which is the healthy direction.
cc_switch.mode.stack uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.mode.stack, while a change to cc_switch.mode.stack can't break cc_switch.app_config.
Position
Below the diagonal: cc_switch.mode.stack uses a module listed above it, which is the healthy direction.
cc_switch.mode.stack uses cc_switch.database, so a change to cc_switch.database can break cc_switch.mode.stack, while a change to cc_switch.mode.stack can't break cc_switch.database.
Position
Below the diagonal: cc_switch.mode.stack uses a module listed above it, which is the healthy direction.
cc_switch.proxy.server uses cc_switch.proxy.types, so a change to cc_switch.proxy.types can break cc_switch.proxy.server, while a change to cc_switch.proxy.server can't break cc_switch.proxy.types.
Position
Below the diagonal: cc_switch.proxy.server uses a module listed above it, which is the healthy direction.
cc_switch.proxy.server uses cc_switch.database, so a change to cc_switch.database can break cc_switch.proxy.server, while a change to cc_switch.proxy.server can't break cc_switch.database.
Position
Below the diagonal: cc_switch.proxy.server uses a module listed above it, which is the healthy direction.
cc_switch.settings uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.settings, while a change to cc_switch.settings can't break cc_switch.app_config.
Position
Below the diagonal: cc_switch.settings uses a module listed above it, which is the healthy direction.
cc_switch.settings uses cc_switch.database, so a change to cc_switch.database can break cc_switch.settings, while a change to cc_switch.settings can't break cc_switch.database.
Position
Below the diagonal: cc_switch.settings uses a module listed above it, which is the healthy direction.
cc_switch.store uses cc_switch.database, so a change to cc_switch.database can break cc_switch.store, while a change to cc_switch.store can't break cc_switch.database.
Position
Below the diagonal: cc_switch.store uses a module listed above it, which is the healthy direction.
cc_switch.proxy.handler_context uses cc_switch.proxy.types, so a change to cc_switch.proxy.types can break cc_switch.proxy.handler_context, while a change to cc_switch.proxy.handler_context can't break cc_switch.proxy.types.
Position
Below the diagonal: cc_switch.proxy.handler_context uses a module listed above it, which is the healthy direction.
cc_switch.proxy.handler_context uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.proxy.handler_context, while a change to cc_switch.proxy.handler_context can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.proxy.handler_context uses a module listed above it, which is the healthy direction.
cc_switch.proxy.handler_context uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.proxy.handler_context, while a change to cc_switch.proxy.handler_context can't break cc_switch.app_config.
Position
Below the diagonal: cc_switch.proxy.handler_context uses a module listed above it, which is the healthy direction.
cc_switch.proxy.handler_context uses cc_switch.proxy.forwarder, so a change to cc_switch.proxy.forwarder can break cc_switch.proxy.handler_context, while a change to cc_switch.proxy.handler_context can't break cc_switch.proxy.forwarder.
Position
Below the diagonal: cc_switch.proxy.handler_context uses a module listed above it, which is the healthy direction.
cc_switch.proxy.handler_context uses cc_switch.mode.stack, so a change to cc_switch.mode.stack can break cc_switch.proxy.handler_context, while a change to cc_switch.proxy.handler_context can't break cc_switch.mode.stack.
Position
Below the diagonal: cc_switch.proxy.handler_context uses a module listed above it, which is the healthy direction.
cc_switch.proxy.handler_context uses cc_switch.proxy.server, so a change to cc_switch.proxy.server can break cc_switch.proxy.handler_context, while a change to cc_switch.proxy.handler_context can't break cc_switch.proxy.server.
Position
Below the diagonal: cc_switch.proxy.handler_context uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.claude_editor uses cc_switch.live.patch, so a change to cc_switch.live.patch can break cc_switch.services.provider.claude_editor, while a change to cc_switch.services.provider.claude_editor can't break cc_switch.live.patch.
Position
Below the diagonal: cc_switch.services.provider.claude_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.claude_editor uses cc_switch.live.patch.json, so a change to cc_switch.live.patch.json can break cc_switch.services.provider.claude_editor, while a change to cc_switch.services.provider.claude_editor can't break cc_switch.live.patch.json.
Position
Below the diagonal: cc_switch.services.provider.claude_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.claude_editor uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.services.provider.claude_editor, while a change to cc_switch.services.provider.claude_editor can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.services.provider.claude_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.claude_editor uses cc_switch.database, so a change to cc_switch.database can break cc_switch.services.provider.claude_editor, while a change to cc_switch.services.provider.claude_editor can't break cc_switch.database.
Position
Below the diagonal: cc_switch.services.provider.claude_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.claude_editor uses cc_switch.store, so a change to cc_switch.store can break cc_switch.services.provider.claude_editor, while a change to cc_switch.services.provider.claude_editor can't break cc_switch.store.
Position
Below the diagonal: cc_switch.services.provider.claude_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_direct uses cc_switch.live.engine, so a change to cc_switch.live.engine can break cc_switch.services.provider.codex_direct, while a change to cc_switch.services.provider.codex_direct can't break cc_switch.live.engine.
Position
Below the diagonal: cc_switch.services.provider.codex_direct uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_direct uses cc_switch.live.patch, so a change to cc_switch.live.patch can break cc_switch.services.provider.codex_direct, while a change to cc_switch.services.provider.codex_direct can't break cc_switch.live.patch.
Position
Below the diagonal: cc_switch.services.provider.codex_direct uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_direct uses cc_switch.services.subscription, so a change to cc_switch.services.subscription can break cc_switch.services.provider.codex_direct, while a change to cc_switch.services.provider.codex_direct can't break cc_switch.services.subscription.
Position
Below the diagonal: cc_switch.services.provider.codex_direct uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_direct uses cc_switch.mode.state, so a change to cc_switch.mode.state can break cc_switch.services.provider.codex_direct, while a change to cc_switch.services.provider.codex_direct can't break cc_switch.mode.state.
Position
Below the diagonal: cc_switch.services.provider.codex_direct uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_direct uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.services.provider.codex_direct, while a change to cc_switch.services.provider.codex_direct can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.services.provider.codex_direct uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_direct uses cc_switch.database, so a change to cc_switch.database can break cc_switch.services.provider.codex_direct, while a change to cc_switch.services.provider.codex_direct can't break cc_switch.database.
Position
Below the diagonal: cc_switch.services.provider.codex_direct uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_direct uses cc_switch.mode.stack, so a change to cc_switch.mode.stack can break cc_switch.services.provider.codex_direct, while a change to cc_switch.services.provider.codex_direct can't break cc_switch.mode.stack.
Position
Below the diagonal: cc_switch.services.provider.codex_direct uses a module listed above it, which is the healthy direction.
cc_switch.commands.provider uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.commands.provider, while a change to cc_switch.commands.provider can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.commands.provider uses a module listed above it, which is the healthy direction.
cc_switch.commands.provider uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.commands.provider, while a change to cc_switch.commands.provider can't break cc_switch.app_config.
Position
Below the diagonal: cc_switch.commands.provider uses a module listed above it, which is the healthy direction.
cc_switch.commands.provider uses cc_switch.claude_desktop_config, so a change to cc_switch.claude_desktop_config can break cc_switch.commands.provider, while a change to cc_switch.commands.provider can't break cc_switch.claude_desktop_config.
Position
Below the diagonal: cc_switch.commands.provider uses a module listed above it, which is the healthy direction.
cc_switch.commands.provider uses cc_switch.store, so a change to cc_switch.store can break cc_switch.commands.provider, while a change to cc_switch.commands.provider can't break cc_switch.store.
Position
Below the diagonal: cc_switch.commands.provider uses a module listed above it, which is the healthy direction.
cc_switch.commands.provider uses cc_switch.services.provider.claude_editor, so a change to cc_switch.services.provider.claude_editor can break cc_switch.commands.provider, while a change to cc_switch.commands.provider can't break cc_switch.services.provider.claude_editor.
Position
Below the diagonal: cc_switch.commands.provider uses a module listed above it, which is the healthy direction.
cc_switch.mode.controller uses cc_switch.mode.state, so a change to cc_switch.mode.state can break cc_switch.mode.controller, while a change to cc_switch.mode.controller can't break cc_switch.mode.state.
Position
Below the diagonal: cc_switch.mode.controller uses a module listed above it, which is the healthy direction.
cc_switch.mode.controller uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.mode.controller, while a change to cc_switch.mode.controller can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.mode.controller uses a module listed above it, which is the healthy direction.
cc_switch.mode.controller uses cc_switch.app_config, so a change to cc_switch.app_config can break cc_switch.mode.controller, while a change to cc_switch.mode.controller can't break cc_switch.app_config.
Position
Below the diagonal: cc_switch.mode.controller uses a module listed above it, which is the healthy direction.
cc_switch.mode.controller uses cc_switch.mode.stack, so a change to cc_switch.mode.stack can break cc_switch.mode.controller, while a change to cc_switch.mode.controller can't break cc_switch.mode.stack.
Position
Below the diagonal: cc_switch.mode.controller uses a module listed above it, which is the healthy direction.
cc_switch.mode.controller uses cc_switch.store, so a change to cc_switch.store can break cc_switch.mode.controller, while a change to cc_switch.mode.controller can't break cc_switch.store.
Position
Below the diagonal: cc_switch.mode.controller uses a module listed above it, which is the healthy direction.
cc_switch.mode.controller uses cc_switch.services.provider.codex_direct, so a change to cc_switch.services.provider.codex_direct can break cc_switch.mode.controller, while a change to cc_switch.mode.controller can't break cc_switch.services.provider.codex_direct.
Position
Below the diagonal: cc_switch.mode.controller uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_editor uses cc_switch.mode.state, so a change to cc_switch.mode.state can break cc_switch.services.provider.codex_editor, while a change to cc_switch.services.provider.codex_editor can't break cc_switch.mode.state.
Position
Below the diagonal: cc_switch.services.provider.codex_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_editor uses cc_switch.provider, so a change to cc_switch.provider can break cc_switch.services.provider.codex_editor, while a change to cc_switch.services.provider.codex_editor can't break cc_switch.provider.
Position
Below the diagonal: cc_switch.services.provider.codex_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_editor uses cc_switch.database, so a change to cc_switch.database can break cc_switch.services.provider.codex_editor, while a change to cc_switch.services.provider.codex_editor can't break cc_switch.database.
Position
Below the diagonal: cc_switch.services.provider.codex_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_editor uses cc_switch.store, so a change to cc_switch.store can break cc_switch.services.provider.codex_editor, while a change to cc_switch.services.provider.codex_editor can't break cc_switch.store.
Position
Below the diagonal: cc_switch.services.provider.codex_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_editor uses cc_switch.services.provider.claude_editor, so a change to cc_switch.services.provider.claude_editor can break cc_switch.services.provider.codex_editor, while a change to cc_switch.services.provider.codex_editor can't break cc_switch.services.provider.claude_editor.
Position
Below the diagonal: cc_switch.services.provider.codex_editor uses a module listed above it, which is the healthy direction.
cc_switch.services.provider.codex_editor uses cc_switch.services.provider.codex_direct, so a change to cc_switch.services.provider.codex_direct can break cc_switch.services.provider.codex_editor, while a change to cc_switch.services.provider.codex_editor can't break cc_switch.services.provider.codex_direct.
Position
Below the diagonal: cc_switch.services.provider.codex_editor uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 57% · Adequate · gated by D1, D2, R3 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
100
High / Critical
A03:2025 — Software Supply Chain Failures
61
High / Critical
A07:2025 — Authentication Failures
7
High / Critical
Roadmap
First, ensure all interactive elements are keyboard-accessible and properly labeled to meet basic usability standards. Next, enforce accessibility requirements in the development toolchain and CI pipeline to prevent regressions. Simultaneously, refactor large configuration files into smaller, focused modules to improve maintainability. Finally, address visual and motion safety by fixing focus styles, respecting reduced motion preferences, and improving color contrast for all form controls.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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.
Bring the 52 bodies over 60 down to 60 or less in Cognitive Complexity — start with cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw (cognitive 1436), cc_switch::proxy::providers::streaming::create_anthropic_sse_stream (cognitive 619), RequestForwarder::forward (cognitive 384).
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 — 151
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 — 1966
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 — 188
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
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 84 of 84 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 84 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, 2246 of 2305 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 2,148 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 27 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root (3307 tests)): measured (5 flaky) suite(s) did re-run, and came back with 5 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `REDACTED`, `src/components/providers/forms/ProviderForm.tsx`, `src/components/providers/presentation.ts`, `src/components/sessions/utils.ts`, `src/components/usage/requestLogColumns.ts`, … (+5 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 260 further occurrence(s) are not listed individually; the score already reflects all 300.
R3 Large Files — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 47 further occurrence(s) are not listed individually; the score already reflects all 87.
R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 21 further occurrence(s) are not listed individually; the score already reflects all 61.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 21 further occurrence(s) are not listed individually; the score already reflects all 61.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
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 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
299 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw at 280. A further 6 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 cc_switch::prompt_files::prompt_file_path at 20 — they are counted neither in the figure above nor in this dimension's score. 3 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/prompt_files.rs (cc_switch::prompt_files::prompt_file_path at 20), src-tauri/src/session_manager/mod.rs (cc_switch::session_manager::load_messages at 17), src/config/codingPlanProviders.ts (codingPlanProviders.extractBaseUrlForUsageDetection at 17). 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.
+ 182 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 240 down to 240 or less in Cyclomatic Complexity — start with cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw (cyclomatic 280). — Refactoring it lifts Cyclomatic Complexity from 2.9 to about 3.2/10.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
461 method(s) exceeded the cognitive complexity threshold of 15; the worst was cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw at 1436.
+ 199 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 52 bodies over 60 down to 60 or less in Cognitive Complexity — start with cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw (cognitive 1436), cc_switch::proxy::providers::streaming::create_anthropic_sse_stream (cognitive 619), RequestForwarder::forward (cognitive 384). — 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 52 together lifts Cognitive Complexity from 2.0 to about 4.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.4 / 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 186 FunctionTooLong finding(s) in God Classes — start with handlers.rs (7), transform_responses.rs (4), session_usage_codex.rs (3). — One of this dimension's main actionable groups (186 warning-level).
Resolve the 107 FileTooLong finding(s) in God Classes — start with codex.rs (3), provider.rs (3), mod.rs (2). — One of this dimension's main actionable groups (107 warning-level).
Resolve the 37 ClassTooLong finding(s) in God Classes — start with forwarder.rs, REDACTED, CodexFormFields.tsx. — One of this dimension's main actionable groups (37 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
376 duplicated block group(s) detected. A further 15 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. Measured on part of this repository only: .tsx (20% 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.
+ 120 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 32 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with hermes.rs (3), mod.rs (3), transform.rs (3). — One of this dimension's main actionable groups (32 warning-level).
Resolve the 30 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with provider.rs (2), forwarder.rs (2), codex_config.rs (2). — One of this dimension's main actionable groups (30 warning-level).
Resolve the 28 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with transform_responses.rs (4), codex.rs (2), streaming_responses.rs (2). — One of this dimension's main actionable groups (28 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with app_config.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
6514 test methods: 6274 unit, 240 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 2148 `it`/`test` case(s) across 255 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 4366 `#[test]` function(s) across 257 file(s) declaring at least one; its unit/integration split is Cargo's own — 19 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2148 tests. Measured on the JavaScript/TypeScript suite only — at least 27 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
37 outdated, 0 yanked direct Cargo dependencies. 70 of 73 direct crates were graded against crates.io (0 not published there, 3 not resolved by a committed REDACTED). 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: anyhow · ×37
What to do
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
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.
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 747 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares 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/providers/forms/ProviderForm.tsx (46×478=21988); src/App.tsx (59×265=15635); src-tauri/src/lib.rs (74×134=9916) Repeated repair below the complexity floor: src-tauri/src/mode/controller.rs (27 of 52 changes were fixes); src-tauri/src/services/proxy.rs (16 of 26 changes were fixes); src-tauri/src/config.rs (9 of 14 changes were fixes)
Resolve the 144 Hotspot finding(s) in Churn × Complexity Hotspots — start with codex.rs (4), mod.rs (3), mcp.rs (2). — One of this dimension's main actionable groups (144 warning-level).
Resolve the 19 Repeated repair finding(s) in Churn × Complexity Hotspots — start with controller.rs, proxy.rs, config.rs. — One of this dimension's main actionable groups (19 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.3 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
44 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src-tauri/src/codex_history_migration.rs. Counted over 613 of the 775 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
1 deducted task-comment markers across 417152 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 1 TodoComment finding(s) in Explicit Debt — start with blocks.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: 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. 119 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
2 of 2 build units (Cargo, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED 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.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
100 finding(s): 0 critical, 80 high, 20 medium, 0 low. 34 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 11 file(s) — `src-tauri/src/services/session_usage.rs` (line 1107), `REDACTED` (line 101), `src/components/providers/forms/ProviderForm.tsx` (line 1855, line 1862), `src/components/providers/presentation.ts` (line 247, line 399, line 426, …), `src/components/sessions/utils.ts` (line 22), … (+6 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 4 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 8 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 38 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (30), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (38 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 34 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 (34 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.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (14), REDACTED (3). — One of this dimension's main actionable groups (17 issue-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
4 of 613 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/commands/copilot.rs. Counted over 613 of the 775 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 8 Boundary-crossing change coupling finding(s) in Change Coupling — start with opencodeProviderPresets.ts (3), claudeProviderPresets.ts (2), codexProviderPresets.ts (2). — One of this dimension's main actionable groups (8 issue-level).
Resolve the 18 Change coupling finding(s) in Change Coupling — start with REDACTED (2), usage.rs (2), ModelStatsTable.tsx. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 6 Change-coupling hub finding(s) in Change Coupling — start with RequestLogTable.tsx, hermesProviderPresets.ts, codexProviderPresets.ts. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 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).
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 the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 48 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
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.
Do you agree with this assessment?
AC2 · Forms & labels5.3 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×3) — deplink.html:586, deplink.html:785, deplink.html:796
This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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. (×11) — src/components/apps/AppsPage.tsx:834, src/components/apps/AppsPage.tsx:854, src/components/openclaw/AgentsDefaultsPanel.tsx:241, …
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. (×14) — src/components/deeplink/McpConfirmation.tsx:82, src/components/deeplink/McpConfirmation.tsx:98, src/components/deeplink/PromptConfirmation.tsx:29, …
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. (×7) — src/components/providers/forms/CodexFormFields.tsx:496, src/components/providers/forms/CopilotAuthSection.tsx:184, src/components/providers/forms/LocalProxyRequestOverridesField.tsx:47, …
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). — src/components/providers/forms/EndpointSpeedTest.tsx:628
A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×3) — src/components/providers/forms/KimiProviderForm.tsx:507, src/components/providers/forms/McodeProviderForm.tsx:225, REDACTED:1601
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — src/components/sessions/reader/SessionMarkdown.tsx:1003
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.
Do you agree with this assessment?
AC3 · Page structure7.6 / 10Strong✓ Tool-verified
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.
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — deplink.html:404
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 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/providers/forms/EndpointSpeedTest.tsx:575
This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×2) — src/components/quota/QuotaLines.tsx:420, src/components/usage/UsageHeatmap.tsx:387
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×6) — src/components/quota/QuotaLines.tsx:587, src/components/usage/RequestLogTable.tsx:612, src/components/usage/UsageDateRangePicker.tsx:269, …
This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it. — src/components/usage/ModelsDevPickerDialog.tsx:247
This <div> 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/workspace/DailyMemoryPanel.tsx:483, src/components/workspace/DailyMemoryPanel.tsx:532
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.
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.
`.toast` moves (`animation: tin 200ms cubic-bezier(.4, 0, .2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — deplink.html:306
<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). — src/components/providers/forms/OmoFormFields.tsx:158
<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:. — src/components/universal/UniversalProviderPanel.tsx:244
<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). (×2) — src/components/usage/TablePagination.tsx:112, src/tray-panel/TrayPanel.tsx:450
`html:not([data-keyboard]) :is(*:not(input, textarea, select, [contenteditable="true"])):focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/index.css:509
`.ui-checkbox::before` moves (`transition: transform 120ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/index.css:269
`.pi-thinking-popover[data-state="open"]` moves (`animation: pi-thinking-popover-in 260ms cubic-bezier(0.16, 1, 0.3, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/index.css:450
`.pi-thinking-popover[data-state="closed"]` moves (`animation: pi-thinking-popover-out 150ms cubic-bezier(0.4, 0, 1, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/index.css:454
`html[data-layout="floating"] .tp-sub[data-side="right"]` moves (`animation: tp-sub-in-right 140ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/tray-panel/tray-panel.css:123
`html[data-layout="floating"] .tp-sub[data-side="left"]` moves (`animation: tp-sub-in-left 140ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/tray-panel/tray-panel.css:126
`row.animate()` moves (`Web Animations API keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/components/usage/RequestLogTable.tsx:306
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 240 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
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.
What to do
Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where Watchdog can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
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.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
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 — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.
64 duplicated blocks under src/components/ have copies in at least two of the sibling directories apps, hermes, mcp, openclaw, profiles, prompts (+9 more sibling(s) not listed) — 34 of them are reported below, and 30 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 64 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 64 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 64 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/mcp/UnifiedMcpPanel.tsx:420
14 duplicated blocks under src/ have copies in at least two of the sibling directories components, hooks, lib, tray-panel, utils — 9 of them are reported below, and 5 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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/useHermes.ts:94
src/components/providers/forms/HermesFormFields.tsx:36 · src/components/providers/forms/OpenClawFormFields.tsx:32 — the two spans are one implementation copied and then locally edited — 1753 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/providers/forms/HermesFormFields.tsx:36
src/components/usage/ModelsDevAutoSyncPanel.tsx:105 · src/components/usage/ModelsDevPickerDialog.tsx:73 — the two spans are one implementation copied and then locally edited — 990 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/usage/ModelsDevAutoSyncPanel.tsx:105
src/components/providers/forms/CodexOAuthSection.tsx:133 · src/components/providers/forms/CopilotAuthSection.tsx:117 — the two spans are one implementation copied and then locally edited — 775 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/providers/forms/CodexOAuthSection.tsx:133
src/components/settings/WebdavSyncSection.tsx:1061 · src/components/settings/WebdavSyncSection.tsx:1244 — the two spans are one implementation copied and then locally edited — 657 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/WebdavSyncSection.tsx:1061
src/components/prompts/PiPromptPanel.tsx:171 · src/components/prompts/PromptPanel.tsx:244 — the two spans are one implementation copied and then locally edited — 729 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/prompts/PiPromptPanel.tsx:171
src/hooks/useSettings.ts:225 · src/hooks/useSettings.ts:371 — the two spans are one implementation copied and then locally edited — 351 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/hooks/useSettings.ts:225
src/components/providers/forms/hooks/useHermesFormState.ts:77 · src/components/providers/forms/hooks/useOpenclawFormState.ts:61 — the two spans are one implementation copied and then locally edited — 531 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/providers/forms/hooks/useHermesFormState.ts:77
src/components/usage/ModelStatsTable.tsx:1 · src/components/usage/ProviderStatsTable.tsx:1 — these 2 files are line-for-line copies of one another — 80 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/components/usage/ModelStatsTable.tsx:1
src/config/piProviderPresets.ts:3028 · src/config/piProviderPresets.ts:3124 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — src/config/piProviderPresets.ts:3028
src/components/providers/forms/ClaudeFormFields.tsx:919 · src/components/providers/forms/CodexFormFields.tsx:1451 — the two spans are one implementation copied and then locally edited — 233 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/providers/forms/ClaudeFormFields.tsx:919
src/config/piProviderPresets.ts:2844 · src/config/piProviderPresets.ts:2922 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — src/config/piProviderPresets.ts:2844
src/components/providers/forms/RequestHeadersEditor.tsx:36 · src/components/providers/forms/StructuredOptionsEditor.tsx:63 — the two spans are one implementation copied and then locally edited — 284 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/providers/forms/RequestHeadersEditor.tsx:36
src/components/sessions/reader/SessionFinalReply.tsx:62 · src/components/sessions/reader/SessionQuestion.tsx:74 — the two spans are one implementation copied and then locally edited — 244 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/sessions/reader/SessionFinalReply.tsx:62
src/components/workspace/DailyMemoryPanel.tsx:439 · src/components/workspace/DailyMemoryPanel.tsx:497 — the two spans are one implementation copied and then locally edited — 242 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/workspace/DailyMemoryPanel.tsx:439
REDACTED:747 · REDACTED:973 — 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. — REDACTED:747
src/components/providers/forms/GeminiConfigSections.tsx:18 · src/components/providers/forms/GeminiConfigSections.tsx:97 — the two spans are one implementation copied and then locally edited — 235 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/providers/forms/GeminiConfigSections.tsx:18
src/components/providers/forms/OpenClawFormFields.tsx:332 · REDACTED:1717 — the two spans are one implementation copied and then locally edited — 192 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/providers/forms/OpenClawFormFields.tsx:332
src/lib/query/mutations.ts:102 · src/lib/query/mutations.ts:257 — 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/lib/query/mutations.ts:102
src/components/openclaw/ToolsPanel.tsx:181 · src/components/openclaw/ToolsPanel.tsx:223 — 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/openclaw/ToolsPanel.tsx:181
src/components/prompts/PiNativePromptResources.tsx:662 · src/components/prompts/PromptFormPanel.tsx:187 — the two spans are one implementation copied and then locally edited — 214 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/prompts/PiNativePromptResources.tsx:662
src/components/UsageScriptModal.tsx:1358 · src/components/UsageScriptModal.tsx:1449 — 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/UsageScriptModal.tsx:1358
src/components/mcp/UnifiedMcpPanel.tsx:420 · src/components/skills/UnifiedSkillsPanel.tsx:459 — 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/mcp/UnifiedMcpPanel.tsx:420
src/components/providers/forms/AgyOAuthSection.tsx:131 · src/components/providers/forms/CodexOAuthSection.tsx:496 · src/components/providers/forms/CopilotAuthSection.tsx:440 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/components/providers/forms/AgyOAuthSection.tsx:131
src/components/providers/forms/KimiProviderForm.tsx:233 · src/components/providers/forms/OpenCodeFormFields.tsx:231 — the two spans are one implementation copied and then locally edited — 217 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/providers/forms/KimiProviderForm.tsx:233
src/components/providers/forms/OpenCodeFormFields.tsx:243 · REDACTED:1160 — the two spans are one implementation copied and then locally edited — 192 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/providers/forms/OpenCodeFormFields.tsx:243
src/components/UsageScriptModal.tsx:1201 · src/components/UsageScriptModal.tsx:1283 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/components/UsageScriptModal.tsx:1201
src/components/UsageScriptModal.tsx:1322 · src/components/UsageScriptModal.tsx:1415 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/components/UsageScriptModal.tsx:1322
src/components/providers/forms/OpenCodeFormFields.tsx:969 · src/components/providers/forms/OpenCodeFormFields.tsx:1057 — 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/providers/forms/OpenCodeFormFields.tsx:969
src/components/settings/WebdavSyncSection.tsx:1529 · src/components/settings/WebdavSyncSection.tsx:1690 — both copies are in the same file, so extract the 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/components/settings/WebdavSyncSection.tsx:1529
src/components/universal/UniversalProviderFormModal.tsx:191 · src/components/universal/UniversalProviderFormModal.tsx:250 — 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/universal/UniversalProviderFormModal.tsx:191
src/config/codexProviderPresets.ts:3209 · src/config/codexProviderPresets.ts:3259 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — src/config/codexProviderPresets.ts:3209
src/components/providers/forms/ClaudeDesktopProviderForm.tsx:705 · src/components/providers/forms/ProviderForm.tsx:1480 — 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/providers/forms/ClaudeDesktopProviderForm.tsx:705
src/components/providers/forms/ClaudeFormFields.tsx:396 · src/components/providers/forms/ClaudeFormFields.tsx:432 — 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/providers/forms/ClaudeFormFields.tsx:396
src/components/settings/WebdavSyncSection.tsx:505 · src/components/settings/WebdavSyncSection.tsx:724 — both copies are in the same file, so extract the 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/components/settings/WebdavSyncSection.tsx:505
src/components/JsonEditor.tsx:154 · src/components/JsonEditor.tsx:224 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — src/components/JsonEditor.tsx:154
src/components/settings/WebdavSyncSection.tsx:546 · src/components/settings/WebdavSyncSection.tsx:763 — both copies are in the same file, so extract the 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/components/settings/WebdavSyncSection.tsx:546
src/components/settings/sections/RoutingSection.tsx:285 · src/components/settings/sections/RoutingSection.tsx:349 — the two spans are one implementation copied and then locally edited — 123 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/sections/RoutingSection.tsx:285
src/config/hermesProviderPresets.ts:473 · src/config/hermesProviderPresets.ts:503 · src/config/hermesProviderPresets.ts:533 · src/config/hermesProviderPresets.ts:563 — all 4 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — src/config/hermesProviderPresets.ts:473
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.
ProviderFormFull has cyclomatic complexity 178 and cognitive complexity 155; 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/providers/forms/ProviderForm.tsx:346
performSubmit has cyclomatic complexity 143 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/components/providers/forms/ProviderForm.tsx:1671
CodexFormFields has cyclomatic complexity 122 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/providers/forms/CodexFormFields.tsx:535
handleSubmit has cyclomatic complexity 85 and cognitive complexity 120; 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/providers/forms/ProviderForm.tsx:1276
DeepLinkImportDialog has cyclomatic complexity 85 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/DeepLinkImportDialog.tsx:86
ClaudeFormFields has cyclomatic complexity 85 and cognitive complexity 59; 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/providers/forms/ClaudeFormFields.tsx:184
ProviderCard has cyclomatic complexity 83 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/providers/ProviderCard.tsx:178
(anonymous) has cyclomatic complexity 71 and cognitive complexity 113; 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/providers/AddProviderDialog.tsx:251
UsageScriptModal has cyclomatic complexity 70 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/UsageScriptModal.tsx:248
handlePresetChange has cyclomatic complexity 58 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/components/providers/forms/ProviderForm.tsx:2165
SwitchModePanel has cyclomatic complexity 58 and cognitive complexity 54; 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/providers/mode/SwitchModePanel.tsx:101
ToolRow has cyclomatic complexity 57 and cognitive complexity 51; 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/apps/AppsPage.tsx:700
UnifiedSkillsPanel has cyclomatic complexity 57 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/skills/UnifiedSkillsPanel.tsx:120
WebdavSyncSection has cyclomatic complexity 55 and cognitive complexity 47; 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/WebdavSyncSection.tsx:234
CodexOAuthSection has cyclomatic complexity 54 and cognitive complexity 45; 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/providers/forms/CodexOAuthSection.tsx:77
KimiProviderForm has cyclomatic complexity 52 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/providers/forms/KimiProviderForm.tsx:103
renderRow has cyclomatic complexity 47 and cognitive complexity 45; 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/usage/RequestLogTable.tsx:368
buildAdditiveSections has cyclomatic complexity 46 and cognitive complexity 102; 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/providers/presentation.ts:711
SessionItem has cyclomatic complexity 45 and cognitive complexity 39; 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/sessions/SessionItem.tsx:56
PiPromptPanel has cyclomatic complexity 45 and cognitive complexity 38; 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/prompts/PiPromptPanel.tsx:54
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files2.4 / 10Critical✓ 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/config/openclawProviderPresets.ts has 7258 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/config/openclawProviderPresets.ts:1
src/config/codexProviderPresets.ts has 5044 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/config/codexProviderPresets.ts:1
src/config/opencodeProviderPresets.ts has 4758 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/config/opencodeProviderPresets.ts:1
src/config/hermesProviderPresets.ts has 4014 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/config/hermesProviderPresets.ts:1
src/config/piProviderPresets.ts has 3476 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/config/piProviderPresets.ts:1
src/config/claudeProviderPresets.ts has 3061 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/config/claudeProviderPresets.ts:1
src/components/providers/forms/ProviderForm.tsx has 2956 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/providers/forms/ProviderForm.tsx:1
src/config/claudeDesktopProviderPresets.ts has 2516 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/config/claudeDesktopProviderPresets.ts:1
REDACTED has 2224 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/providers/forms/CodexFormFields.tsx has 2214 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/providers/forms/CodexFormFields.tsx:1
src/components/skills/UnifiedSkillsPanel.tsx has 2021 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/skills/UnifiedSkillsPanel.tsx:1
src/App.tsx has 1793 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.tsx:1
src/components/settings/WebdavSyncSection.tsx has 1742 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/WebdavSyncSection.tsx:1
src/components/UsageScriptModal.tsx has 1616 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/UsageScriptModal.tsx:1
REDACTED has 1501 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/sessions/SessionManagerPage.tsx has 1392 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/sessions/SessionManagerPage.tsx:1
src/components/providers/forms/ClaudeDesktopProviderForm.tsx has 1365 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/providers/forms/ClaudeDesktopProviderForm.tsx:1
src/components/mcp/McpFormModal.tsx has 1325 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/mcp/McpFormModal.tsx:1
src/components/providers/forms/ClaudeFormFields.tsx has 1270 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/providers/forms/ClaudeFormFields.tsx:1
src/components/providers/forms/OmoFormFields.tsx has 1259 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/providers/forms/OmoFormFields.tsx:1
src/icons/extracted/metadata.ts has 1201 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/icons/extracted/metadata.ts:1
src/components/mcp/UnifiedMcpPanel.tsx has 1122 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/mcp/UnifiedMcpPanel.tsx:1
src/tray-panel/TrayPanel.tsx has 1106 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/tray-panel/TrayPanel.tsx:1
src/components/providers/forms/OpenCodeFormFields.tsx has 1045 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/providers/forms/OpenCodeFormFields.tsx:1
src/components/sessions/reader/SessionMarkdown.tsx has 1036 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/sessions/reader/SessionMarkdown.tsx:1
src/components/prompts/PiNativePromptResources.tsx has 999 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/prompts/PiNativePromptResources.tsx:1
src/components/apps/useToolManagement.ts has 991 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/apps/useToolManagement.ts:1
src/components/skills/SkillsPage.tsx has 987 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/skills/SkillsPage.tsx:1
src/components/usage/UsageDashboard.tsx has 980 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/usage/UsageDashboard.tsx:1
src/components/DeepLinkImportDialog.tsx has 979 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/DeepLinkImportDialog.tsx:1
src/components/apps/AppsPage.tsx has 967 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/apps/AppsPage.tsx:1
src/components/sessions/reader/turns.ts has 958 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/sessions/reader/turns.ts:1
src/components/providers/presentation.ts has 927 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/providers/presentation.ts:1
src/types.ts has 926 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/types.ts:1
src/config/piModelCatalog.ts has 920 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/config/piModelCatalog.ts:1
src/components/providers/forms/ProviderPresetSelector.tsx has 875 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/providers/forms/ProviderPresetSelector.tsx:1
src/components/providers/forms/KimiProviderForm.tsx has 869 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/providers/forms/KimiProviderForm.tsx:1
src/config/grokBuildProviderPresets.ts has 845 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/config/grokBuildProviderPresets.ts:1
src/config/geminiProviderPresets.ts has 842 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/config/geminiProviderPresets.ts:1
src/components/sessions/reader/SessionReaderHeader.tsx has 826 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/sessions/reader/SessionReaderHeader.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.6 / 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. (×16) — src/components/DatabaseUpgrade.tsx:1, src/types/proxy.ts:1, src/main.tsx: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 Code7.9 / 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 43 application, 9 tooling and 265 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 (43 application, 9 tooling, 265 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 (×8) — src/components/ui/table.tsx, src/components/ui/card.tsx, src/components/ui/accordion.tsx, …
Nothing imports this binding — it is safe to review for removal. (×31) — src/components/BrandIcons.tsx:89, src/components/DatabaseUpgrade.tsx:301, src/components/prompts/PiNativePromptResources.tsx:1032, …
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.
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`.serve_connection(` (src-tauri/src/proxy/server.rs:204)), 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.
Set: Referrer-Policy. Missing: Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — 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.(−2.0 on this card.) The server: `.serve_connection(` (src-tauri/src/proxy/server.rs:204).
What to do
Add Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options 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.
This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`. — src-tauri/src/services/kimi_oauth/lock.rs:196
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.
This function unwraps IPv4-MAPPED IPv6 (`::ffff: (in `extractIpv4Octets`)`, line 123) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 159 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright. — REDACTED:159
What to do
Each finding names the IPv4 branch that rejects the host and the IPv6 branch that accepts the same host in another notation. Confirm from the two, then unwrap every IPv4-in-IPv6 embedding before classifying, or reject non-native IPv6 outright.
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 document2.7 / 10Weak✓ 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.
`applyTemplateValues` is exported, takes a document from its caller (line 90) and hands it to `traverse`, which calls itself at line 119 (`traverse`) with a piece of `obj` (and at line 124) — and nowhere in `traverse` 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 `traverse` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:119
`stableKey` is exported and takes `value: unknown` from its caller, and it calls itself at line 37 (`stableKey`) with a piece of `value` (and at line 42) — and nowhere in `stableKey` 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 `stableKey` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lib/query/sessions.ts:37
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.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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 1/2 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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.
`copyImage` 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/components/sessions/reader/SessionImageLightbox.tsx:30
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.
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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped2.7 / 10Weak✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`iconSvg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:89
`raw` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/components/sessions/reader/SessionMarkdown.tsx:343
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `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 element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×37) — src/App.tsx:1042, src/main.tsx:42, REDACTED:461, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×2) — src/hooks/useModelMetadataFill.ts:126, src/components/providers/KimiAccountLogin.tsx:149
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/components/sessions/SessionManagerPage.tsx:477
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.3 `!` null assertions per 1k TypeScript source lines — 43 assertion(s) across the 152082 source line(s) of the 456 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: src/lib/query/sessions.ts (10), src/components/quota/QuotaLines.tsx (4), src/components/usage/TablePagination.tsx (4). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 13 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 45 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 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
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — 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 scored — polyglot repository, one half's runner produced no measurement
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust, TypeScript, html not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 10 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (21 value object(s))
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
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
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 applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
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.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC2 · Forms & labels· <label> that labels no control · ×14
<label> that labels no control src/components/deeplink/McpConfirmation.tsx:82— 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/deeplink/McpConfirmation.tsx:98— 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/deeplink/PromptConfirmation.tsx:29— 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/deeplink/PromptConfirmation.tsx:36— 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/deeplink/PromptConfirmation.tsx:44— 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/deeplink/PromptConfirmation.tsx:52— 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/deeplink/SkillConfirmation.tsx:16— 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/deeplink/SkillConfirmation.tsx:25— 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/deeplink/SkillConfirmation.tsx:34— 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/providers/mode/ModeDialog.tsx:283— 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/providers/mode/StackSettingsSheet.tsx:113— 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/providers/mode/StackSubagentFields.tsx:128— 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/providers/mode/StackSubagentFields.tsx:163— 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/WebdavSyncSection.tsx:971— 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.
Boundary-crossing change coupling: claudeProviderPresets.ts ↔ metadata.ts src/config/claudeProviderPresets.ts:1— `src/config/claudeProviderPresets.ts` (context config) and `src/icons/extracted/metadata.ts` (context icons) sit in DIFFERENT parts of the tree yet change together 76% of the time (37 of the 49 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 37 shared commits counted here, the most recent 3 are `e380588a` feat(presets): add icons for Baseten, DeepInfra, DigitalOcean, Firewo…; `d4a24107` feat(provider): add MoArk (模力方舟) provider presets (#7580); `793e67d9` feat(provider): add Command Code presets and quota support (#7358) — run `git show` on any of them.
Boundary-crossing change coupling: claudeProviderPresets.ts ↔ index.ts src/config/claudeProviderPresets.ts:1— `src/config/claudeProviderPresets.ts` (context config) and `src/icons/extracted/index.ts` (context icons) sit in DIFFERENT parts of the tree yet change together 75% of the time (44 of the 59 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 44 shared commits counted here, the most recent 3 are `e380588a` feat(presets): add icons for Baseten, DeepInfra, DigitalOcean, Firewo…; `d4a24107` feat(provider): add MoArk (模力方舟) provider presets (#7580); `793e67d9` feat(provider): add Command Code presets and quota support (#7358) — run `git show` on any of them.
Boundary-crossing change coupling: ProviderCard.tsx ↔ subscription.ts src/components/providers/ProviderCard.tsx:1— `src/components/providers/ProviderCard.tsx` (context components) and `src/lib/query/subscription.ts` (context query) sit in DIFFERENT parts of the tree yet change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 10 shared commits counted here, the most recent 3 are `cdd2190d` feat(kimi): identify, remove and show quota for official accounts; `997e78b5` feat(agy): show the bound account's quota on official cards; `1b4cd547` feat(agy): show the signed-in quota on the official card — run `git show` on any of them.
Boundary-crossing change coupling: codexProviderPresets.ts ↔ index.ts src/config/codexProviderPresets.ts:1— `src/config/codexProviderPresets.ts` (context config) and `src/icons/extracted/index.ts` (context icons) sit in DIFFERENT parts of the tree yet change together 58% of the time (34 of the 59 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 34 shared commits counted here, the most recent 3 are `e380588a` feat(presets): add icons for Baseten, DeepInfra, DigitalOcean, Firewo…; `d4a24107` feat(provider): add MoArk (模力方舟) provider presets (#7580); `793e67d9` feat(provider): add Command Code presets and quota support (#7358) — run `git show` on any of them.
Boundary-crossing change coupling: codexProviderPresets.ts ↔ metadata.ts src/config/codexProviderPresets.ts:1— `src/config/codexProviderPresets.ts` (context config) and `src/icons/extracted/metadata.ts` (context icons) sit in DIFFERENT parts of the tree yet change together 57% of the time (28 of the 49 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 28 shared commits counted here, the most recent 3 are `e380588a` feat(presets): add icons for Baseten, DeepInfra, DigitalOcean, Firewo…; `d4a24107` feat(provider): add MoArk (模力方舟) provider presets (#7580); `793e67d9` feat(provider): add Command Code presets and quota support (#7358) — run `git show` on any of them.
Boundary-crossing change coupling: opencodeProviderPresets.ts ↔ omo.ts src/config/opencodeProviderPresets.ts:1— `src/config/opencodeProviderPresets.ts` (context config) and `src/types/omo.ts` (context types) sit in DIFFERENT parts of the tree yet 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) — 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 `0877b9e3` Upgrade default Claude Opus model to 4.8; `1684cb32` feat(presets): migrate all aggregator and Bedrock presets to Claude O…; `6a083cdd` fix(omo): adapt to oh-my-openagent rename with backward compatibility… — run `git show` on any of them.
Boundary-crossing change coupling: opencodeProviderPresets.ts ↔ index.ts src/config/opencodeProviderPresets.ts:1— `src/config/opencodeProviderPresets.ts` (context config) and `src/icons/extracted/index.ts` (context icons) sit in DIFFERENT parts of the tree yet change together 54% of the time (32 of the 59 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 32 shared commits counted here, the most recent 3 are `d4a24107` feat(provider): add MoArk (模力方舟) provider presets (#7580); `58d92e56` feat(provider): add JieKou AI presets (#6356); `3711e1a0` feat(provider): add PPIO support (#6239) — run `git show` on any of them.
Boundary-crossing change coupling: opencodeProviderPresets.ts ↔ metadata.ts src/config/opencodeProviderPresets.ts:1— `src/config/opencodeProviderPresets.ts` (context config) and `src/icons/extracted/metadata.ts` (context icons) sit in DIFFERENT parts of the tree yet change together 53% of the time (26 of the 49 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 26 shared commits counted here, the most recent 3 are `d4a24107` feat(provider): add MoArk (模力方舟) provider presets (#7580); `58d92e56` feat(provider): add JieKou AI presets (#6356); `3711e1a0` feat(provider): add PPIO support (#6239) — run `git show` on any of them.
Flaky test: the repository roottests/components/AppsPage.test.tsx::AppsPage concurrent CLI upgrades copies only the selected application's manual command and switches installation methods — Passed 2×, failed 1× across repeated runs.
Flaky test: the repository roottests/components/PiProviderForm.test.tsx::PiProviderForm updates structured fields from config JSON and preserves native fields — Passed 2×, failed 1× across repeated runs.
Flaky test: the repository roottests/components/PiProviderForm.test.tsx::PiProviderForm uses structured Pi-native capabilities and limits in collapsed model details — Passed 2×, failed 1× across repeated runs.
Flaky test: the repository roottests/integration/App.test.tsx::App integration with MSW covers basic provider flows via real hooks — Passed 2×, failed 1× across repeated runs.
Flaky test: the repository roottests/integration/App.test.tsx::App integration with MSW refreshes the route pointer when the proxy fails over to another provider — Passed 2×, failed 1× across repeated runs.
AC2 · Forms & labels· <textarea> without a programmatic label · ×3
<textarea> without a programmatic label deplink.html:586— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label deplink.html:785— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label deplink.html:796— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×2
Click handler on a non-interactive <div> src/components/providers/forms/EndpointSpeedTest.tsx:575— 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}.
Click handler on a non-interactive <div> src/components/usage/UsageDateRangePicker.tsx:269— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×2
Hover-only interaction on <div> src/components/quota/QuotaLines.tsx:420— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> src/components/usage/UsageHeatmap.tsx:387— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×2
Click handler on a non-interactive <span> src/components/quota/QuotaLines.tsx:587— 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 <span> src/components/usage/UsageHero.tsx:147— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <p> · ×2
Click handler on a non-interactive <p> src/components/workspace/DailyMemoryPanel.tsx:361— 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 <p> src/components/workspace/WorkspaceFilesPanel.tsx:89— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a <div> nested inside <button> · ×2
Click handler on a <div> nested inside <button> src/components/workspace/DailyMemoryPanel.tsx:483— This <div> 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 <div> nested inside <button> src/components/workspace/DailyMemoryPanel.tsx:532— This <div> 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.
AC2 · Forms & labels· <button> with no accessible text · ×1
<button> with no accessible text src/components/providers/forms/EndpointSpeedTest.tsx:628— 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).
AC2 · Forms & labels· <input> without a programmatic label · ×1
<input> without a programmatic label src/components/sessions/reader/SessionMarkdown.tsx:1003— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Clickable role="button" that no keyboard user can reach · ×1
Clickable role="button" that no keyboard user can reach src/components/usage/ModelsDevPickerDialog.tsx:247— This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
AC4 · Keyboard semantics· Click handler on a non-interactive <tr> · ×1
Click handler on a non-interactive <tr> src/components/usage/RequestLogTable.tsx:612— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw (cognitive 1436) src-tauri/src/proxy/providers/streaming_responses.rs:2399— cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw has cognitive complexity 1436 (threshold 15). Drivers by points: if/else 216 (1174 pts), loops 35 (216 pts), match/switch 6 (24 pts), boolean chains 22 (nesting depth added 1157). 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.
cc_switch::proxy::providers::streaming::create_anthropic_sse_stream (cognitive 619) src-tauri/src/proxy/providers/streaming.rs:242— cc_switch::proxy::providers::streaming::create_anthropic_sse_stream has cognitive complexity 619 (threshold 15). Drivers by points: if/else 59 (443 pts), loops 23 (169 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 531). 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.
cc_switch::run (cognitive 182) src-tauri/src/lib.rs:399— cc_switch::run has cognitive complexity 182 (threshold 15). Drivers by points: if/else 75 (114 pts), match/switch 32 (50 pts), loops 10 (13 pts), boolean chains 5 (nesting depth added 60). Of this number, 175 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.
cc_switch::services::session_usage_codex::parse_codex_file_with_index (cognitive 147) src-tauri/src/services/session_usage_codex.rs:1224— cc_switch::services::session_usage_codex::parse_codex_file_with_index has cognitive complexity 147 (threshold 15). Drivers by points: if/else 42 (112 pts), match/switch 7 (22 pts), boolean chains 12, loops 1 (nesting depth added 85). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini (cognitive 125) src-tauri/src/proxy/providers/streaming_gemini.rs:237— cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini has cognitive complexity 125 (threshold 15). Drivers by points: if/else 31 (110 pts), loops 4 (9 pts), match/switch 2 (6 pts) (nesting depth added 88). 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.
cc_switch::mcp::codex::import_from_codex (cognitive 115) src-tauri/src/mcp/codex.rs:69— cc_switch::mcp::codex::import_from_codex has cognitive complexity 115 (threshold 15). Drivers by points: if/else 31 (89 pts), loops 5 (15 pts), match/switch 4 (11 pts) (nesting depth added 75). 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.
cc_switch::proxy::providers::transform_responses::responses_to_anthropic_with_web_search_options (cognitive 94) src-tauri/src/proxy/providers/transform_responses.rs:2519— cc_switch::proxy::providers::transform_responses::responses_to_anthropic_with_web_search_options has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (76 pts), loops 7 (12 pts), match/switch 2 (6 pts) (nesting depth added 58). 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.
cc_switch::proxy::providers::transform_responses::convert_messages_to_input (cognitive 89) src-tauri/src/proxy/providers/transform_responses.rs:2297— cc_switch::proxy::providers::transform_responses::convert_messages_to_input has cognitive complexity 89 (threshold 15). Drivers by points: if/else 20 (75 pts), loops 3 (7 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value (cognitive 87) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:1411— cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value has cognitive complexity 87 (threshold 15). Drivers by points: if/else 26 (67 pts), loops 4 (9 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 50). 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.
cc_switch::proxy::response_processor::create_logged_passthrough_stream (cognitive 87) src-tauri/src/proxy/response_processor.rs:731— cc_switch::proxy::response_processor::create_logged_passthrough_stream has cognitive complexity 87 (threshold 15). Drivers by points: if/else 17 (49 pts), match/switch 5 (26 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 61). 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.
cc_switch::commands::misc::build_tool_search_paths (cognitive 81) src-tauri/src/commands/misc.rs:2508— cc_switch::commands::misc::build_tool_search_paths has cognitive complexity 81 (threshold 15). Drivers by points: if/else 27 (59 pts), loops 7 (22 pts) (nesting depth added 47). 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.
cc_switch::proxy::providers::transform_responses::anthropic_to_responses (cognitive 72) src-tauri/src/proxy/providers/transform_responses.rs:1775— cc_switch::proxy::providers::transform_responses::anthropic_to_responses has cognitive complexity 72 (threshold 15). Drivers by points: if/else 37 (65 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages (cognitive 71) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:513— cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages has cognitive complexity 71 (threshold 15). Drivers by points: if/else 16 (55 pts), match/switch 3 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::services::session_usage_codex::sync_single_codex_file (cognitive 71) src-tauri/src/services/session_usage_codex.rs:1983— cc_switch::services::session_usage_codex::sync_single_codex_file has cognitive complexity 71 (threshold 15). Drivers by points: if/else 26 (50 pts), match/switch 5 (12 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::proxy::cache_injector::inject (cognitive 70) src-tauri/src/proxy/cache_injector.rs:9— cc_switch::proxy::cache_injector::inject has cognitive complexity 70 (threshold 15). Drivers by points: if/else 21 (61 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic (cognitive 70) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:229— cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic has cognitive complexity 70 (threshold 15). Drivers by points: if/else 34 (60 pts), boolean chains 7, loops 1 (2 pts), match/switch 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.
cc_switch::proxy::providers::transform_codex_responses_namespace::flatten_request_namespaces (cognitive 69) src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:92— cc_switch::proxy::providers::transform_codex_responses_namespace::flatten_request_namespaces has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (61 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::proxy::providers::transform::openai_to_anthropic (cognitive 67) src-tauri/src/proxy/providers/transform.rs:597— cc_switch::proxy::providers::transform::openai_to_anthropic has cognitive complexity 67 (threshold 15). Drivers by points: if/else 26 (53 pts), match/switch 3 (8 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cc_switch::proxy::providers::transform_responses::markdown_code_scan (cognitive 67) src-tauri/src/proxy/providers/transform_responses.rs:769— cc_switch::proxy::providers::transform_responses::markdown_code_scan has cognitive complexity 67 (threshold 15). Drivers by points: if/else 21 (58 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cc_switch::proxy::providers::streaming_codex_chat::create_responses_sse_stream_from_chat_with_context (cognitive 65) src-tauri/src/proxy/providers/streaming_codex_chat.rs:764— cc_switch::proxy::providers::streaming_codex_chat::create_responses_sse_stream_from_chat_with_context has cognitive complexity 65 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 7 (23 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::proxy::providers::streaming_codex_anthropic::create_responses_sse_stream_from_anthropic_with_context (cognitive 62) src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:724— cc_switch::proxy::providers::streaming_codex_anthropic::create_responses_sse_stream_from_anthropic_with_context has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 7 (24 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cc_switch::proxy::providers::transform::convert_message_to_openai (cognitive 60) src-tauri/src/proxy/providers/transform.rs:405— cc_switch::proxy::providers::transform::convert_message_to_openai has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (47 pts), match/switch 3 (9 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cc_switch::omp_config::edit_provider (cognitive 59) src-tauri/src/omp_config.rs:543— cc_switch::omp_config::edit_provider has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (40 pts), boolean chains 10, loops 5 (9 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::services::session_usage::sync_single_file (cognitive 59) src-tauri/src/services/session_usage.rs:627— cc_switch::services::session_usage::sync_single_file has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (35 pts), match/switch 9 (17 pts), boolean chains 4, loops 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cc_switch::session_manager::providers::codex::parse_session_lines (cognitive 58) src-tauri/src/session_manager/providers/codex.rs:1963— cc_switch::session_manager::providers::codex::parse_session_lines has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (48 pts), boolean chains 5, match/switch 2 (3 pts), loops 2 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FunctionTooLong: ProviderForm.ProviderFormFull src/components/providers/forms/ProviderForm.tsx:346— FunctionTooLong — ProviderFormFull runs 2123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2023 over it, 21.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: PiProviderForm.PiProviderForm REDACTED:499— FunctionTooLong — PiProviderForm runs 1426 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1326 over it, 14.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: CodexFormFields.CodexFormFields src/components/providers/forms/CodexFormFields.tsx:535— FunctionTooLong — CodexFormFields runs 1354 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1254 over it, 13.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.
FunctionTooLong: WebdavSyncSection.WebdavSyncSection src/components/settings/WebdavSyncSection.tsx:234— FunctionTooLong — WebdavSyncSection runs 1346 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1246 over it, 13.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: UnifiedSkillsPanel.UnifiedSkillsPanel src/components/skills/UnifiedSkillsPanel.tsx:120— FunctionTooLong — UnifiedSkillsPanel runs 1311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1211 over it, 13.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: App.App src/App.tsx:161— FunctionTooLong — App runs 1288 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1188 over it, 12.88× 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: UsageScriptModal.UsageScriptModal src/components/UsageScriptModal.tsx:248— FunctionTooLong — UsageScriptModal runs 1129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1029 over it, 11.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.
FunctionTooLong: cc_switch::run src-tauri/src/lib.rs:399— FunctionTooLong — cc_switch::run runs 1033 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 933 over it, 10.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: McpFormModal.McpFormModal src/components/mcp/McpFormModal.tsx:117— FunctionTooLong — McpFormModal runs 1029 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 929 over it, 10.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.
FunctionTooLong: SessionManagerPage.SessionManagerPage src/components/sessions/SessionManagerPage.tsx:136— FunctionTooLong — SessionManagerPage runs 963 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 863 over it, 9.63× 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: ClaudeFormFields.ClaudeFormFields src/components/providers/forms/ClaudeFormFields.tsx:184— FunctionTooLong — ClaudeFormFields runs 922 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 822 over it, 9.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: ClaudeDesktopProviderForm.ClaudeDesktopProviderForm src/components/providers/forms/ClaudeDesktopProviderForm.tsx:249— FunctionTooLong — ClaudeDesktopProviderForm runs 921 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 821 over it, 9.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.
FunctionTooLong: UnifiedMcpPanel.UnifiedMcpPanel src/components/mcp/UnifiedMcpPanel.tsx:128— FunctionTooLong — UnifiedMcpPanel runs 852 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 752 over it, 8.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: OmoFormFields.OmoFormFields src/components/providers/forms/OmoFormFields.tsx:309— FunctionTooLong — OmoFormFields runs 815 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 715 over it, 8.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: DeepLinkImportDialog.DeepLinkImportDialog src/components/DeepLinkImportDialog.tsx:86— FunctionTooLong — DeepLinkImportDialog runs 736 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 636 over it, 7.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: OpenCodeFormFields.OpenCodeFormFields src/components/providers/forms/OpenCodeFormFields.tsx:205— FunctionTooLong — OpenCodeFormFields runs 703 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 603 over it, 7.03× 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: KimiProviderForm.KimiProviderForm src/components/providers/forms/KimiProviderForm.tsx:103— FunctionTooLong — KimiProviderForm runs 658 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 558 over it, 6.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.
FunctionTooLong: UsageDashboard.UsageDashboard src/components/usage/UsageDashboard.tsx:250— FunctionTooLong — UsageDashboard runs 639 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 539 over it, 6.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: UniversalProviderFormModal.UniversalProviderFormModal src/components/universal/UniversalProviderFormModal.tsx:30— FunctionTooLong — UniversalProviderFormModal runs 568 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 468 over it, 5.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.
FunctionTooLong: SkillsPage.SkillsPage src/components/skills/SkillsPage.tsx:157— FunctionTooLong — SkillsPage runs 551 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 451 over it, 5.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.
FunctionTooLong: SessionReader.SessionReader src/components/sessions/reader/SessionReader.tsx:155— FunctionTooLong — SessionReader runs 532 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 432 over it, 5.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: TrayPanel.TrayPanel src/tray-panel/TrayPanel.tsx:515— FunctionTooLong — TrayPanel runs 508 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 408 over it, 5.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: OpenClawFormFields.OpenClawFormFields src/components/providers/forms/OpenClawFormFields.tsx:59— FunctionTooLong — OpenClawFormFields runs 494 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 394 over it, 4.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: useToolManagement.useToolManagement src/components/apps/useToolManagement.ts:332— FunctionTooLong — useToolManagement runs 487 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 387 over it, 4.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.
FunctionTooLong: SwitchModePanel.SwitchModePanel src/components/providers/mode/SwitchModePanel.tsx:101— FunctionTooLong — SwitchModePanel runs 479 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 379 over it, 4.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: src/components/providers/forms/ProviderForm.tsx src/components/providers/forms/ProviderForm.tsx:346— src/components/providers/forms/ProviderForm.tsx changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 478 in ProviderForm.ProviderFormFull at line 346. 14 of those changes were fix/bug commits, and the other 32 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/forms/ProviderForm.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/App.tsx src/App.tsx:161— src/App.tsx changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 265 in App.App at line 161. 19 of those changes were fix/bug commits, and the other 40 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/App.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/lib.rs src-tauri/src/lib.rs:399— src-tauri/src/lib.rs changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 134 in cc_switch::run at line 399. 17 of those changes were fix/bug commits, and the other 57 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +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/proxy/forwarder.rs src-tauri/src/proxy/forwarder.rs:1374— src-tauri/src/proxy/forwarder.rs changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 205 in RequestForwarder::forward at line 1374. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/proxy/forwarder.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/providers/forms/CodexFormFields.tsx src/components/providers/forms/CodexFormFields.tsx:535— src/components/providers/forms/CodexFormFields.tsx changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 209 in CodexFormFields.CodexFormFields at line 535. 10 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/forms/CodexFormFields.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:499— REDACTED changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 211 in PiProviderForm.PiProviderForm at line 499. 5 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +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/components/skills/UnifiedSkillsPanel.tsx src/components/skills/UnifiedSkillsPanel.tsx:120— src/components/skills/UnifiedSkillsPanel.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 216 in UnifiedSkillsPanel.UnifiedSkillsPanel at line 120. 4 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/skills/UnifiedSkillsPanel.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/providers/ProviderCard.tsx src/components/providers/ProviderCard.tsx:178— src/components/providers/ProviderCard.tsx changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in ProviderCard.ProviderCard at line 178. 7 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/ProviderCard.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/DeepLinkImportDialog.tsx src/components/DeepLinkImportDialog.tsx:86— src/components/DeepLinkImportDialog.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in DeepLinkImportDialog.DeepLinkImportDialog at line 86. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/DeepLinkImportDialog.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/providers/AddProviderDialog.tsx src/components/providers/AddProviderDialog.tsx:58— src/components/providers/AddProviderDialog.tsx changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 118 in AddProviderDialog.AddProviderDialog at line 58. 4 of those changes were fix/bug commits, and the other 18 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/AddProviderDialog.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/providers/forms/ClaudeFormFields.tsx src/components/providers/forms/ClaudeFormFields.tsx:184— src/components/providers/forms/ClaudeFormFields.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in ClaudeFormFields.ClaudeFormFields at line 184. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/forms/ClaudeFormFields.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/providers/ProviderList.tsx src/components/providers/ProviderList.tsx:103— src/components/providers/ProviderList.tsx changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in ProviderList.ProviderList at line 103. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/ProviderList.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/mcp/UnifiedMcpPanel.tsx src/components/mcp/UnifiedMcpPanel.tsx:128— src/components/mcp/UnifiedMcpPanel.tsx changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in UnifiedMcpPanel.UnifiedMcpPanel at line 128. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/mcp/UnifiedMcpPanel.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/UsageScriptModal.tsx src/components/UsageScriptModal.tsx:248— src/components/UsageScriptModal.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 200 in UsageScriptModal.UsageScriptModal at line 248. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/UsageScriptModal.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/services/provider/mod.rs src-tauri/src/services/provider/mod.rs:6186— src-tauri/src/services/provider/mod.rs changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in ProviderService::update at line 6186. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/provider/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.
Hotspot: src/components/providers/mode/SwitchModePanel.tsx src/components/providers/mode/SwitchModePanel.tsx:101— src/components/providers/mode/SwitchModePanel.tsx changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in SwitchModePanel.SwitchModePanel at line 101. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/mode/SwitchModePanel.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/misc.rs src-tauri/src/commands/misc.rs:2508— src-tauri/src/commands/misc.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in cc_switch::commands::misc::build_tool_search_paths at line 2508. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/commands/misc.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/usage/RequestLogTable.tsx src/components/usage/RequestLogTable.tsx:179— src/components/usage/RequestLogTable.tsx changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in RequestLogTable.RequestLogTable at line 179. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/usage/RequestLogTable.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/providers/forms/ClaudeDesktopProviderForm.tsx src/components/providers/forms/ClaudeDesktopProviderForm.tsx:249— src/components/providers/forms/ClaudeDesktopProviderForm.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in ClaudeDesktopProviderForm.ClaudeDesktopProviderForm at line 249. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/forms/ClaudeDesktopProviderForm.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/providers/EditProviderDialog.tsx src/components/providers/EditProviderDialog.tsx:67— src/components/providers/EditProviderDialog.tsx changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in EditProviderDialog.EditProviderDialog at line 67. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/EditProviderDialog.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/usage/UsageDashboard.tsx src/components/usage/UsageDashboard.tsx:250— src/components/usage/UsageDashboard.tsx changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in UsageDashboard.UsageDashboard at line 250. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/usage/UsageDashboard.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/proxy/providers/streaming_responses.rs src-tauri/src/proxy/providers/streaming_responses.rs:2399— src-tauri/src/proxy/providers/streaming_responses.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 280 in cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw at line 2399. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/proxy/providers/streaming_responses.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/services/session_usage_codex.rs src-tauri/src/services/session_usage_codex.rs:1224— src-tauri/src/services/session_usage_codex.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in cc_switch::services::session_usage_codex::parse_codex_file_with_index at line 1224. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/session_usage_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/sessions/SessionManagerPage.tsx src/components/sessions/SessionManagerPage.tsx:136— src/components/sessions/SessionManagerPage.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 127 in SessionManagerPage.SessionManagerPage at line 136. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/sessions/SessionManagerPage.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/database/schema.rs src-tauri/src/database/schema.rs:451— src-tauri/src/database/schema.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in Database::apply_schema_migrations_on_conn at line 451. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/database/schema.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: config/openclawProviderPresets.ts src/config/openclawProviderPresets.ts— FileTooLong — 5219 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4719 over it, 10.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: commands/misc.rs src-tauri/src/commands/misc.rs— FileTooLong — 3665 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 222 free functions. The bar is 500 significant lines; this is 3165 over it, 7.33× 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: config/opencodeProviderPresets.ts src/config/opencodeProviderPresets.ts— FileTooLong — 3617 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3117 over it, 7.23× 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: providers/streaming_responses.rs src-tauri/src/proxy/providers/streaming_responses.rs— FileTooLong — 3377 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2877 over it, 6.75× 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: services/skill.rs src-tauri/src/services/skill.rs— FileTooLong — 2973 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2473 over it, 5.95× 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: proxy/forwarder.rs src-tauri/src/proxy/forwarder.rs— FileTooLong — 2910 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: RequestForwarder (2 blocks, 342-3354), declaring 57 free functions. The bar is 500 significant lines; this is 2410 over it, 5.82× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: config/hermesProviderPresets.ts src/config/hermesProviderPresets.ts— FileTooLong — 2745 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2245 over it, 5.49× 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: config/piProviderPresets.ts src/config/piProviderPresets.ts— FileTooLong — 2534 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2034 over it, 5.07× 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: forms/ProviderForm.tsx src/components/providers/forms/ProviderForm.tsx— FileTooLong — 2415 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: ProviderFormFull (346-3118). The bar is 500 significant lines; this is 1915 over it, 4.83× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/tray.rs src-tauri/src/tray.rs— FileTooLong — 2286 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 94 free functions. The bar is 500 significant lines; this is 1786 over it, 4.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: proxy/handlers.rs src-tauri/src/proxy/handlers.rs— FileTooLong — 2260 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 1760 over it, 4.52× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: provider/mod.rs src-tauri/src/services/provider/mod.rs— FileTooLong — 2149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1649 over it, 4.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 2133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1633 over it, 4.27× 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: config/claudeDesktopProviderPresets.ts src/config/claudeDesktopProviderPresets.ts— FileTooLong — 1918 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1418 over it, 3.84× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: database/schema.rs src-tauri/src/database/schema.rs— FileTooLong — 1891 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 100% of them inside a single declaration: Database (16-3892). The bar is 500 significant lines; this is 1391 over it, 3.78× 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: providers/transform_responses.rs src-tauri/src/proxy/providers/transform_responses.rs— FileTooLong — 1887 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 1387 over it, 3.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1844 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: PiProviderForm (499-2291). The bar is 500 significant lines; this is 1344 over it, 3.69× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/codex_config.rs src-tauri/src/codex_config.rs— FileTooLong — 1824 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 103 free functions. The bar is 500 significant lines; this is 1324 over it, 3.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: forms/CodexFormFields.tsx src/components/providers/forms/CodexFormFields.tsx— FileTooLong — 1770 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: CodexFormFields (535-2312). The bar is 500 significant lines; this is 1270 over it, 3.54× 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: skills/UnifiedSkillsPanel.tsx src/components/skills/UnifiedSkillsPanel.tsx— FileTooLong — 1709 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: UnifiedSkillsPanel (120-1759). The bar is 500 significant lines; this is 1209 over it, 3.42× 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: providers/transform_codex_chat.rs src-tauri/src/proxy/providers/transform_codex_chat.rs— FileTooLong — 1624 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 67 free functions. The bar is 500 significant lines; this is 1124 over it, 3.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: services/session_usage_codex.rs src-tauri/src/services/session_usage_codex.rs— FileTooLong — 1592 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 46 free functions. The bar is 500 significant lines; this is 1092 over it, 3.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: providers/codex.rs src-tauri/src/session_manager/providers/codex.rs— FileTooLong — 1532 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1032 over it, 3.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: settings/WebdavSyncSection.tsx src/components/settings/WebdavSyncSection.tsx— FileTooLong — 1514 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: WebdavSyncSection (234-1849). The bar is 500 significant lines; this is 1014 over it, 3.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/lib.rs src-tauri/src/lib.rs— FileTooLong — 1508 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1008 over it, 3.02× 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.
cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw (cyclomatic 280) src-tauri/src/proxy/providers/streaming_responses.rs:2399— cc_switch::proxy::providers::streaming_responses::create_anthropic_sse_stream_from_responses_raw has cyclomatic complexity 280 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::run (cyclomatic 134) src-tauri/src/lib.rs:399— cc_switch::run has cyclomatic complexity 134 (threshold 15). Of this number, 127 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.
cc_switch::proxy::providers::streaming::create_anthropic_sse_stream (cyclomatic 82) src-tauri/src/proxy/providers/streaming.rs:242— cc_switch::proxy::providers::streaming::create_anthropic_sse_stream has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::services::session_usage_codex::parse_codex_file_with_index (cyclomatic 61) src-tauri/src/services/session_usage_codex.rs:1224— cc_switch::services::session_usage_codex::parse_codex_file_with_index has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::session_manager::providers::blocks::normalize_tool (cyclomatic 53) src-tauri/src/session_manager/providers/blocks.rs:63— cc_switch::session_manager::providers::blocks::normalize_tool has cyclomatic complexity 53 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
cc_switch::mcp::codex::import_from_codex (cyclomatic 48) src-tauri/src/mcp/codex.rs:69— cc_switch::mcp::codex::import_from_codex has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value (cyclomatic 47) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:1411— cc_switch::proxy::providers::transform_codex_anthropic::anthropic_sse_to_message_value has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic (cyclomatic 44) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:229— cc_switch::proxy::providers::transform_codex_anthropic::responses_request_to_anthropic has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::proxy::handlers::chat_sse_to_response_value (cyclomatic 41) src-tauri/src/proxy/handlers.rs:2868— cc_switch::proxy::handlers::chat_sse_to_response_value has cyclomatic complexity 41 (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.
cc_switch::services::session_usage_codex::sync_single_codex_file (cyclomatic 41) src-tauri/src/services/session_usage_codex.rs:1983— cc_switch::services::session_usage_codex::sync_single_codex_file has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::proxy::providers::transform_responses::anthropic_to_responses (cyclomatic 39) src-tauri/src/proxy/providers/transform_responses.rs:1775— cc_switch::proxy::providers::transform_responses::anthropic_to_responses has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::proxy::providers::transform_responses::responses_to_anthropic_with_web_search_options (cyclomatic 38) src-tauri/src/proxy/providers/transform_responses.rs:2519— cc_switch::proxy::providers::transform_responses::responses_to_anthropic_with_web_search_options has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cc_switch::proxy::providers::transform::openai_to_anthropic (cyclomatic 36) src-tauri/src/proxy/providers/transform.rs:597— cc_switch::proxy::providers::transform::openai_to_anthropic 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.
cc_switch::commands::misc::build_tool_search_paths (cyclomatic 35) src-tauri/src/commands/misc.rs:2508— cc_switch::commands::misc::build_tool_search_paths 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.
cc_switch::omp_config::edit_provider (cyclomatic 35) src-tauri/src/omp_config.rs:543— cc_switch::omp_config::edit_provider 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.
cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini (cyclomatic 35) src-tauri/src/proxy/providers/streaming_gemini.rs:237— cc_switch::proxy::providers::streaming_gemini::create_anthropic_sse_stream_from_gemini 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.
cc_switch::services::session_usage::sync_single_file (cyclomatic 34) src-tauri/src/services/session_usage.rs:627— cc_switch::services::session_usage::sync_single_file 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.
cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages (cyclomatic 33) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:513— cc_switch::proxy::providers::transform_codex_anthropic::convert_input_to_messages 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.
cc_switch::proxy::providers::transform_codex_chat::append_responses_item_as_chat_message (cyclomatic 31) src-tauri/src/proxy/providers/transform_codex_chat.rs:818— cc_switch::proxy::providers::transform_codex_chat::append_responses_item_as_chat_message 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.
cc_switch::proxy::providers::transform_codex_responses_namespace::flatten_request_namespaces (cyclomatic 31) src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:92— cc_switch::proxy::providers::transform_codex_responses_namespace::flatten_request_namespaces 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.
cc_switch::proxy::providers::transform_responses::convert_messages_to_input (cyclomatic 31) src-tauri/src/proxy/providers/transform_responses.rs:2297— cc_switch::proxy::providers::transform_responses::convert_messages_to_input 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.
cc_switch::proxy::handlers::handle_claude_transform (cyclomatic 28) src-tauri/src/proxy/handlers.rs:539— cc_switch::proxy::handlers::handle_claude_transform 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.
cc_switch::session_manager::providers::codex::parse_session_lines (cyclomatic 28) src-tauri/src/session_manager/providers/codex.rs:1963— cc_switch::session_manager::providers::codex::parse_session_lines 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.
cc_switch::proxy::providers::transform::convert_message_to_openai (cyclomatic 27) src-tauri/src/proxy/providers/transform.rs:405— cc_switch::proxy::providers::transform::convert_message_to_openai 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.
cc_switch::proxy::providers::transform_gemini::convert_message_content_to_parts (cyclomatic 27) src-tauri/src/proxy/providers/transform_gemini.rs:573— cc_switch::proxy::providers::transform_gemini::convert_message_content_to_parts 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.
Swallowed exception (empty catch) src/App.tsx:1042— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/main.tsx:42— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:461— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:889— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:1052— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:1528— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/utils/tomlUtils.ts:216— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/types/omo.ts:421— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/tray-panel/usePanelTheme.ts:12— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/tray-panel/TrayPanel.tsx:82— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/tray-panel/TrayPanel.tsx:866— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/tray-panel/UsageTab.tsx:56— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/tray-panel/UsageTab.tsx:65— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/lib/localCache.ts:19— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/lib/navigation.ts:115— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/lib/errors/skillErrorParser.ts:22— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/hooks/useModelMetadataFill.ts:126— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/hooks/useProviderActions.ts:283— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/hooks/useSidebarCollapsed.ts:111— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/hooks/useSidebarCollapsed.ts:156— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/components/UsageFooter.tsx:47— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/components/usage/rememberedChoice.ts:40— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/components/skills/useSkillInstallTargets.ts:27— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/components/skills/UnifiedSkillsPanel.tsx:864— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/components/shell/NewLayoutDialog.tsx:29— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
ClassTooLong: RequestForwarder src-tauri/src/proxy/forwarder.rs:342— ClassTooLong — 1907 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 342-3354. The bar is 400 significant lines; this is 1507 over it, 4.77× 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: PiProviderForm REDACTED:1— ClassTooLong — 1426 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 1026 over it, 3.57× 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: CodexFormFields src/components/providers/forms/CodexFormFields.tsx:1— ClassTooLong — 1354 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 954 over it, 3.39× 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: WebdavSyncSection src/components/settings/WebdavSyncSection.tsx:1— ClassTooLong — 1346 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 946 over it, 3.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UnifiedSkillsPanel src/components/skills/UnifiedSkillsPanel.tsx:1— ClassTooLong — 1311 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 911 over it, 3.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: App src/App.tsx:1— ClassTooLong — 1288 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 888 over it, 3.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UsageScriptModal src/components/UsageScriptModal.tsx:1— ClassTooLong — 1129 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 729 over it, 2.82× 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: CodexOAuthManager src-tauri/src/proxy/providers/codex_oauth_auth.rs:374— ClassTooLong — 1078 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 43 methods, 2 blocks, lines 374-2110. The bar is 400 significant lines; this is 678 over it, 2.70× 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: McpFormModal src/components/mcp/McpFormModal.tsx:1— ClassTooLong — 1029 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 629 over it, 2.57× 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: SessionManagerPage src/components/sessions/SessionManagerPage.tsx:1— ClassTooLong — 963 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 563 over it, 2.41× 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: ClaudeFormFields src/components/providers/forms/ClaudeFormFields.tsx:1— ClassTooLong — 922 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 522 over it, 2.31× 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: ClaudeDesktopProviderForm src/components/providers/forms/ClaudeDesktopProviderForm.tsx:1— ClassTooLong — 921 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 521 over it, 2.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.
ClassTooLong: UnifiedMcpPanel src/components/mcp/UnifiedMcpPanel.tsx:1— ClassTooLong — 852 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 452 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OmoFormFields src/components/providers/forms/OmoFormFields.tsx:1— ClassTooLong — 815 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 415 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BufferedCitationTextState src-tauri/src/proxy/providers/streaming_responses.rs:705— ClassTooLong — 806 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 705-1802. The bar is 400 significant lines; this is 406 over it, 2.02× 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: DeepLinkImportDialog src/components/DeepLinkImportDialog.tsx:1— ClassTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 336 over it, 1.84× 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: OpenCodeFormFields src/components/providers/forms/OpenCodeFormFields.tsx:1— ClassTooLong — 703 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 303 over it, 1.76× 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: CopilotAuthManager src-tauri/src/proxy/providers/copilot_auth.rs:556— ClassTooLong — 693 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 556-1693. The bar is 400 significant lines; this is 293 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: KimiProviderForm src/components/providers/forms/KimiProviderForm.tsx:1— ClassTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 258 over it, 1.65× 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: UsageDashboard src/components/usage/UsageDashboard.tsx:1— ClassTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 239 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UniversalProviderFormModal src/components/universal/UniversalProviderFormModal.tsx:1— ClassTooLong — 568 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 168 over it, 1.42× 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: SkillsPage src/components/skills/SkillsPage.tsx:1— ClassTooLong — 551 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 151 over it, 1.38× 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: SessionReader src/components/sessions/reader/SessionReader.tsx:1— ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 132 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.
ClassTooLong: XaiOAuthManager src-tauri/src/proxy/providers/xai_oauth_auth.rs:190— ClassTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 28 methods, 2 blocks, lines 190-865. The bar is 400 significant lines; this is 112 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TrayPanel src/tray-panel/TrayPanel.tsx:1— ClassTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 108 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (5 lines × 2) src-tauri/src/claude_mcp.rs:91— src-tauri/src/claude_mcp.rs:91-95 | src-tauri/src/gemini_mcp.rs:25-29 — before extracting anything, compare `src-tauri/src/claude_mcp.rs` and `src-tauri/src/gemini_mcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src-tauri/src/commands/provider.rs:68— src-tauri/src/commands/provider.rs:68-72 | src-tauri/src/commands/provider.rs:98-102 — both copies are in the same file, so extract the block into 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/mcp/hermes.rs:143— src-tauri/src/mcp/hermes.rs:143-147 | src-tauri/src/mcp/opencode.rs:155-160 — before extracting anything, compare `src-tauri/src/mcp/hermes.rs` and `src-tauri/src/mcp/opencode.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src-tauri/src/opencode_config.rs:20— src-tauri/src/opencode_config.rs:20-24 | src-tauri/src/services/omo.rs:330-334 — 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/pi_config/mod.rs:123— src-tauri/src/pi_config/mod.rs:123-128 | src-tauri/src/pi_config/mod.rs:226-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/pi_config/mod.rs:177— src-tauri/src/pi_config/mod.rs:177-181 | src-tauri/src/pi_config/mod.rs:207-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/proxy/forwarder.rs:3707— src-tauri/src/proxy/forwarder.rs:3707-3711 | src-tauri/src/proxy/forwarder.rs:3759-3763 — both copies are in the same file, so extract the block into 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/proxy/providers/responses_late_arguments.rs:32— src-tauri/src/proxy/providers/responses_late_arguments.rs:32-36 | src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:578-582 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:481— src-tauri/src/proxy/providers/streaming_responses.rs:481-485 | src-tauri/src/proxy/providers/streaming_responses.rs:975-979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/proxy/providers/transform.rs:235— src-tauri/src/proxy/providers/transform.rs:235-239 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:241-248 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src-tauri/src/proxy/providers/transform.rs:686— src-tauri/src/proxy/providers/transform.rs:686-690 | src-tauri/src/proxy/providers/transform_responses.rs:2688-2692 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.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 (5 lines × 2) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:885— src-tauri/src/proxy/providers/transform_codex_anthropic.rs:885-889 | src-tauri/src/proxy/providers/transform_responses.rs:222-226 — before extracting anything, compare `src-tauri/src/proxy/providers/transform_codex_anthropic.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src-tauri/src/proxy/providers/transform_codex_chat.rs:1826— src-tauri/src/proxy/providers/transform_codex_chat.rs:1826-1830 | src-tauri/src/proxy/providers/transform_codex_chat.rs:1847-1851 — both copies are in the same file, so extract the block into 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/services/profile.rs:397— src-tauri/src/services/profile.rs:397-401 | src-tauri/src/services/profile.rs:417-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) REDACTED:1056— REDACTED:1056-1061 | REDACTED:1212-1216 — both copies are in the same file, so extract the block into 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) REDACTED:1484— REDACTED:1484-1488 | REDACTED:1560-1564 — both copies are in the same file, so extract the block into 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/session_manager/providers/hermes.rs:259— src-tauri/src/session_manager/providers/hermes.rs:259-264 | src-tauri/src/session_manager/providers/opencode.rs:694-698 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src-tauri/src/proxy/forwarder.rs:3486— src-tauri/src/proxy/forwarder.rs:3486-3490 | src-tauri/src/proxy/gemini_url.rs:158-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src-tauri/src/commands/hermes.rs:29— src-tauri/src/commands/hermes.rs:29-33 | src-tauri/src/commands/openclaw.rs:23-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src-tauri/src/commands/s3_sync.rs:14— src-tauri/src/commands/s3_sync.rs:14-18 | src-tauri/src/commands/webdav_sync.rs:14-18 — before extracting anything, compare `src-tauri/src/commands/s3_sync.rs` and `src-tauri/src/commands/webdav_sync.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src-tauri/src/services/s3_auto_sync.rs:72— src-tauri/src/services/s3_auto_sync.rs:72-76 | src-tauri/src/services/webdav_auto_sync.rs:72-76 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/proxy/copilot_optimizer.rs:465— src-tauri/src/proxy/copilot_optimizer.rs:465-469 | src-tauri/src/proxy/copilot_optimizer.rs:524-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src-tauri/src/proxy/providers/codex.rs:1076— src-tauri/src/proxy/providers/codex.rs:1076-1080 | src-tauri/src/proxy/providers/codex.rs:1082-1086 — both copies are in the same file, so extract the block into 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/proxy/providers/streaming_responses.rs:159— src-tauri/src/proxy/providers/streaming_responses.rs:159-163 | src-tauri/src/proxy/providers/streaming_responses.rs:251-255 — both copies are in the same file, so extract the block into 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/live/project/grok.rs:233— src-tauri/src/live/project/grok.rs:233-237 | src-tauri/src/live/project/grok.rs:344-348 — both copies are in the same file, so extract the block into 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/auth.rs:364— src-tauri/src/commands/auth.rs:364-371 | src-tauri/src/commands/auth.rs:400-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/commands/config.rs:207— src-tauri/src/commands/config.rs:207-214 | src-tauri/src/commands/config.rs:233-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/commands/misc.rs:5680— src-tauri/src/commands/misc.rs:5680-5687 | src-tauri/src/session_manager/terminal/mod.rs:328-335 — before extracting anything, compare `src-tauri/src/commands/misc.rs` and `src-tauri/src/session_manager/terminal/mod.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.
Duplicated block (8 lines × 2) REDACTED:902— REDACTED:902-909 | src-tauri/src/database/dao/profiles.rs:53-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) src-tauri/src/hermes_config.rs:384— src-tauri/src/hermes_config.rs:384-391 | src-tauri/src/openclaw_config.rs:406-413 — before extracting anything, compare `src-tauri/src/hermes_config.rs` and `src-tauri/src/openclaw_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src-tauri/src/jsonc_document.rs:377— src-tauri/src/jsonc_document.rs:377-384 | src-tauri/src/jsonc_document.rs:422-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:734— src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:734-741 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:772-779 — before extracting anything, compare `src-tauri/src/proxy/providers/streaming_codex_anthropic.rs` and `src-tauri/src/proxy/providers/streaming_codex_chat.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src-tauri/src/services/profile.rs:215— src-tauri/src/services/profile.rs:215-222 | src-tauri/src/services/profile.rs:224-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src-tauri/src/services/skill.rs:2272— src-tauri/src/services/skill.rs:2272-2279 | src-tauri/src/services/skill.rs:2346-2353 — both copies are in the same file, so extract the block into 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/session_manager/providers/opencode.rs:654— src-tauri/src/session_manager/providers/opencode.rs:654-661 | src-tauri/src/session_manager/providers/opencode.rs:671-678 — both copies are in the same file, so extract the block into 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/deeplink/codex_link.rs:249— src-tauri/src/deeplink/codex_link.rs:249-256 | src-tauri/src/live/project/codex.rs:217-224 — 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/services/session_usage_codex.rs:554— src-tauri/src/services/session_usage_codex.rs:554-561 | REDACTED:72-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/commands/s3_sync.rs:45— src-tauri/src/commands/s3_sync.rs:45-52 | src-tauri/src/commands/webdav_sync.rs:50-57 — before extracting anything, compare `src-tauri/src/commands/s3_sync.rs` and `src-tauri/src/commands/webdav_sync.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src-tauri/src/proxy/providers/codex.rs:958— src-tauri/src/proxy/providers/codex.rs:958-965 | src-tauri/src/proxy/providers/gemini.rs:129-140 — before extracting anything, compare `src-tauri/src/proxy/providers/codex.rs` and `src-tauri/src/proxy/providers/gemini.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src-tauri/src/proxy/providers/transform.rs:391— src-tauri/src/proxy/providers/transform.rs:391-398 | src-tauri/src/proxy/providers/transform_codex_chat.rs:1908-1917 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/deeplink/provider.rs:795— src-tauri/src/deeplink/provider.rs:795-802 | src-tauri/src/deeplink/provider.rs:826-834 — both copies are in the same file, so extract the block into 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/proxy/forwarder.rs:3513— src-tauri/src/proxy/forwarder.rs:3513-3520 | src-tauri/src/proxy/forwarder.rs:3829-3836 — both copies are in the same file, so extract the block into 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/mcp/validation.rs:30— src-tauri/src/mcp/validation.rs:30-37 | src-tauri/src/mcp/validation.rs:38-45 — both copies are in the same file, so extract the block into 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/provider.rs:876— src-tauri/src/provider.rs:876-883 | src-tauri/src/provider.rs:976-983 — both copies are in the same file, so extract the block into 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/proxy/forwarder.rs:3784— src-tauri/src/proxy/forwarder.rs:3784-3791 | src-tauri/src/proxy/forwarder.rs:3803-3810 — both copies are in the same file, so extract the block into 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/session_manager/content.rs:587— src-tauri/src/session_manager/content.rs:587-594 | src-tauri/src/session_manager/content.rs:681-688 — both copies are in the same file, so extract the block into 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/services/stream_check.rs:307— src-tauri/src/services/stream_check.rs:307-314 | src-tauri/src/services/stream_check.rs:324-331 — both copies are in the same file, so extract the block into 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/codex_config.rs:365— src-tauri/src/codex_config.rs:365-372 | src-tauri/src/codex_config.rs:375-382 — both copies are in the same file, so extract the block into 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/session_manager/terminal/mod.rs:247— src-tauri/src/session_manager/terminal/mod.rs:247-254 | src-tauri/src/session_manager/terminal/mod.rs:263-270 — both copies are in the same file, so extract the block into 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/codex_config.rs:980— src-tauri/src/codex_config.rs:980-987 | src-tauri/src/proxy/providers/codex.rs:918-925 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) src-tauri/src/commands/workspace.rs:88— src-tauri/src/commands/workspace.rs:88-94 | src-tauri/src/commands/workspace.rs:263-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/live/project/codex.rs:315— src-tauri/src/live/project/codex.rs:315-321 | src-tauri/src/live/project/codex.rs:325-331 — both copies are in the same file, so extract the block into 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/mcp/codex.rs:728— src-tauri/src/mcp/codex.rs:728-734 | src-tauri/src/mcp/codex.rs:744-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 (7 lines × 2) src-tauri/src/proxy/handlers.rs:376— src-tauri/src/proxy/handlers.rs:376-383 | src-tauri/src/proxy/handlers.rs:2562-2568 — both copies are in the same file, so extract the block into 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/proxy/providers/streaming_responses.rs:420— src-tauri/src/proxy/providers/streaming_responses.rs:420-426 | src-tauri/src/proxy/providers/streaming_responses.rs:845-851 — both copies are in the same file, so extract the block into 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/proxy/providers/streaming_responses.rs:1936— src-tauri/src/proxy/providers/streaming_responses.rs:1936-1942 | src-tauri/src/proxy/providers/streaming_responses.rs:1947-1953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/proxy/providers/transform.rs:658— src-tauri/src/proxy/providers/transform.rs:658-664 | src-tauri/src/proxy/providers/transform_codex_chat.rs:1611-1620 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:904— src-tauri/src/proxy/providers/transform_codex_anthropic.rs:904-910 | src-tauri/src/proxy/providers/transform_responses.rs:237-243 — before extracting anything, compare `src-tauri/src/proxy/providers/transform_codex_anthropic.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:60— src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:60-66 | src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:127-133 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_gemini.rs:202— src-tauri/src/proxy/providers/transform_gemini.rs:202-208 | src-tauri/src/proxy/providers/transform_gemini.rs:859-865 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_responses.rs:348— src-tauri/src/proxy/providers/transform_responses.rs:348-354 | src-tauri/src/proxy/providers/transform_responses.rs:429-435 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_responses.rs:775— src-tauri/src/proxy/providers/transform_responses.rs:775-781 | src-tauri/src/proxy/providers/transform_responses.rs:1075-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/proxy/providers/transform_responses.rs:931— src-tauri/src/proxy/providers/transform_responses.rs:931-937 | src-tauri/src/proxy/providers/transform_responses.rs:1035-1041 — both copies are in the same file, so extract the block into 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/services/balance.rs:498— src-tauri/src/services/balance.rs:498-504 | src-tauri/src/services/coding_plan.rs:501-507 — before extracting anything, compare `src-tauri/src/services/balance.rs` and `src-tauri/src/services/coding_plan.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src-tauri/src/services/provider/mod.rs:7751— src-tauri/src/services/provider/mod.rs:7751-7757 | src-tauri/src/services/provider/mod.rs:7772-7778 — both copies are in the same file, so extract the block into 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/services/provider/pi.rs:185— src-tauri/src/services/provider/pi.rs:185-191 | src-tauri/src/services/provider/pi.rs:209-215 — both copies are in the same file, so extract the block into 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/misc.rs:1843— src-tauri/src/commands/misc.rs:1843-1849 | src-tauri/src/session_manager/terminal/mod.rs:148-154 — before extracting anything, compare `src-tauri/src/commands/misc.rs` and `src-tauri/src/session_manager/terminal/mod.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.
Duplicated block (7 lines × 2) src-tauri/src/services/coding_plan.rs:1350— src-tauri/src/services/coding_plan.rs:1350-1356 | src-tauri/src/services/s3.rs:91-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) src-tauri/src/commands/s3_sync.rs:33— src-tauri/src/commands/s3_sync.rs:33-39 | src-tauri/src/commands/webdav_sync.rs:38-44 — before extracting anything, compare `src-tauri/src/commands/s3_sync.rs` and `src-tauri/src/commands/webdav_sync.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src-tauri/src/commands/s3_sync.rs:184— src-tauri/src/commands/s3_sync.rs:184-190 | src-tauri/src/commands/webdav_sync.rs:192-198 — before extracting anything, compare `src-tauri/src/commands/s3_sync.rs` and `src-tauri/src/commands/webdav_sync.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src-tauri/src/mcp/claude.rs:41— src-tauri/src/mcp/claude.rs:41-47 | src-tauri/src/mcp/gemini.rs:41-47 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/gemini.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src-tauri/src/proxy/providers/transform_responses.rs:2375— src-tauri/src/proxy/providers/transform_responses.rs:2375-2381 | src-tauri/src/proxy/providers/transform_responses.rs:2398-2409 — both copies are in the same file, so extract the block into 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/hermes_config.rs:798— src-tauri/src/hermes_config.rs:798-804 | src-tauri/src/hermes_config.rs:876-884 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_codex_responses_namespace.rs:53— src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:53-59 | src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:64-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src-tauri/src/session_manager/providers/opencode.rs:394— src-tauri/src/session_manager/providers/opencode.rs:394-400 | src-tauri/src/session_manager/providers/opencode.rs:452-458 — both copies are in the same file, so extract the block into 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/claude_desktop_config.rs:939— src-tauri/src/claude_desktop_config.rs:939-947 | src-tauri/src/proxy/model_mapper.rs:161-169 — 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/auth.rs:313— src-tauri/src/commands/auth.rs:313-321 | src-tauri/src/commands/auth.rs:323-331 — both copies are in the same file, so extract the block into 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/commands/codex_oauth.rs:97— src-tauri/src/commands/codex_oauth.rs:97-105 | src-tauri/src/commands/xai_oauth.rs:36-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src-tauri/src/commands/failover.rs:205— src-tauri/src/commands/failover.rs:205-213 | src-tauri/src/commands/failover.rs:240-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src-tauri/src/jsonc_document.rs:306— src-tauri/src/jsonc_document.rs:306-314 | src-tauri/src/jsonc_document.rs:343-351 — both copies are in the same file, so extract the block into 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/proxy/providers/codex.rs:917— src-tauri/src/proxy/providers/codex.rs:917-925 | src-tauri/src/tray.rs:1009-1017 — 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/proxy/providers/streaming_codex_anthropic.rs:517— src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:517-525 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:523-531 — before extracting anything, compare `src-tauri/src/proxy/providers/streaming_codex_anthropic.rs` and `src-tauri/src/proxy/providers/streaming_codex_chat.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) src-tauri/src/proxy/providers/streaming_gemini.rs:73— src-tauri/src/proxy/providers/streaming_gemini.rs:73-81 | src-tauri/src/proxy/providers/transform_gemini.rs:1136-1144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/proxy/providers/streaming_responses.rs:234— src-tauri/src/proxy/providers/streaming_responses.rs:234-246 | src-tauri/src/proxy/providers/streaming_responses.rs:274-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3006— src-tauri/src/proxy/providers/streaming_responses.rs:3006-3014 | src-tauri/src/proxy/providers/streaming_responses.rs:4242-4250 — both copies are in the same file, so extract the block into 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/services/kimi_oauth/account.rs:252— src-tauri/src/services/kimi_oauth/account.rs:252-260 | src-tauri/src/services/kimi_oauth/account.rs:270-278 — both copies are in the same file, so extract the block into 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/services/s3_sync.rs:162— src-tauri/src/services/s3_sync.rs:162-170 | src-tauri/src/services/webdav_sync.rs:191-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src-tauri/src/session_manager/providers/opencode.rs:200— src-tauri/src/session_manager/providers/opencode.rs:200-208 | src-tauri/src/session_manager/providers/opencode.rs:224-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 (9 lines × 2) src-tauri/src/session_manager/providers/pi_blocks.rs:140— src-tauri/src/session_manager/providers/pi_blocks.rs:140-148 | src-tauri/src/session_manager/providers/pi_blocks.rs:326-334 — both copies are in the same file, so extract the block into 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/settings.rs:189— src-tauri/src/settings.rs:189-197 | src-tauri/src/settings.rs:286-294 — both copies are in the same file, so extract the block into 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/commands/s3_sync.rs:89— src-tauri/src/commands/s3_sync.rs:89-97 | src-tauri/src/commands/webdav_sync.rs:94-102 — before extracting anything, compare `src-tauri/src/commands/s3_sync.rs` and `src-tauri/src/commands/webdav_sync.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) src-tauri/src/services/s3_auto_sync.rs:55— src-tauri/src/services/s3_auto_sync.rs:55-63 | src-tauri/src/services/webdav_auto_sync.rs:55-63 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/proxy/providers/claude.rs:753— src-tauri/src/proxy/providers/claude.rs:753-761 | src-tauri/src/proxy/providers/gemini.rs:182-190 — before extracting anything, compare `src-tauri/src/proxy/providers/claude.rs` and `src-tauri/src/proxy/providers/gemini.rs` as WHOLE FILES: this scan already matched 5 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.
Duplicated block (9 lines × 2) src-tauri/src/deeplink/provider.rs:1143— src-tauri/src/deeplink/provider.rs:1143-1151 | src-tauri/src/deeplink/provider.rs:1206-1214 — both copies are in the same file, so extract the block into 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/commands/config.rs:240— src-tauri/src/commands/config.rs:240-248 | src-tauri/src/commands/workspace.rs:350-358 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src-tauri/src/openclaw_config.rs:746— src-tauri/src/openclaw_config.rs:746-754 | src-tauri/src/openclaw_config.rs:785-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src-tauri/src/database/schema.rs:3832— src-tauri/src/database/schema.rs:3832-3840 | src-tauri/src/database/schema.rs:3858-3866 — both copies are in the same file, so extract the block into 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/hermes_config.rs:370— src-tauri/src/hermes_config.rs:370-378 | src-tauri/src/openclaw_config.rs:392-400 — before extracting anything, compare `src-tauri/src/hermes_config.rs` and `src-tauri/src/openclaw_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src-tauri/src/deeplink/provider.rs:1047— src-tauri/src/deeplink/provider.rs:1047-1052 | src-tauri/src/deeplink/provider.rs:1317-1324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/deeplink/provider.rs:1182— src-tauri/src/deeplink/provider.rs:1182-1187 | src-tauri/src/deeplink/provider.rs:1305-1313 — both copies are in the same file, so extract the block into 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/lightweight.rs:38— src-tauri/src/lightweight.rs:38-43 | src-tauri/src/lightweight.rs:73-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/mode/stack.rs:594— src-tauri/src/mode/stack.rs:594-599 | src-tauri/src/mode/stack.rs:611-616 — both copies are in the same file, so extract the block into 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/proxy/cache_injector.rs:36— src-tauri/src/proxy/cache_injector.rs:36-41 | src-tauri/src/proxy/cache_injector.rs:60-65 — both copies are in the same file, so extract the block into 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/proxy/copilot_optimizer.rs:316— src-tauri/src/proxy/copilot_optimizer.rs:316-322 | src-tauri/src/proxy/copilot_optimizer.rs:345-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src-tauri/src/proxy/providers/codex_chat_common.rs:7— src-tauri/src/proxy/providers/codex_chat_common.rs:7-12 | src-tauri/src/proxy/providers/codex_chat_common.rs:52-57 — both copies are in the same file, so extract the block into 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/proxy/providers/streaming_responses.rs:475— src-tauri/src/proxy/providers/streaming_responses.rs:475-480 | src-tauri/src/proxy/providers/streaming_responses.rs:969-974 — both copies are in the same file, so extract the block into 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/proxy/providers/transform.rs:287— src-tauri/src/proxy/providers/transform.rs:287-292 | src-tauri/src/proxy/providers/transform_responses.rs:1830-1835 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.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 (6 lines × 2) src-tauri/src/services/env_checker.rs:77— src-tauri/src/services/env_checker.rs:77-82 | src-tauri/src/services/env_checker.rs:93-98 — both copies are in the same file, so extract the block into 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/services/provider/mod.rs:6535— src-tauri/src/services/provider/mod.rs:6535-6540 | src-tauri/src/services/provider/mod.rs:6661-6666 — both copies are in the same file, so extract the block into 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:1359— REDACTED:1359-1364 | REDACTED:1473-1478 — both copies are in the same file, so extract the block into 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/services/provider/codex_client_catalog.rs:140— src-tauri/src/services/provider/codex_client_catalog.rs:140-145 | src-tauri/src/services/provider/codex_official_models.rs:159-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) src-tauri/src/services/s3_auto_sync.rs:32— src-tauri/src/services/s3_auto_sync.rs:32-37 | src-tauri/src/services/webdav_auto_sync.rs:32-37 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src-tauri/src/services/s3_auto_sync.rs:48— src-tauri/src/services/s3_auto_sync.rs:48-53 | src-tauri/src/services/webdav_auto_sync.rs:48-53 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src-tauri/src/mcp/kimi.rs:35— src-tauri/src/mcp/kimi.rs:35-40 | src-tauri/src/mcp/mcode.rs:25-30 — before extracting anything, compare `src-tauri/src/mcp/kimi.rs` and `src-tauri/src/mcp/mcode.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src-tauri/src/claude_mcp.rs:179— src-tauri/src/claude_mcp.rs:179-184 | src-tauri/src/mcp/validation.rs:10-16 — 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) REDACTED:242— REDACTED:242-248 | REDACTED:1081-1086 — both copies are in the same file, so extract the block into 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/mcp/agy.rs:80— src-tauri/src/mcp/agy.rs:80-85 | src-tauri/src/mcp/mcode.rs:53-58 — before extracting anything, compare `src-tauri/src/mcp/agy.rs` and `src-tauri/src/mcp/mcode.rs` as WHOLE FILES: this scan already matched 7 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.
Duplicated block (6 lines × 2) src-tauri/src/mcp/opencode.rs:81— src-tauri/src/mcp/opencode.rs:81-86 | src-tauri/src/mcp/opencode.rs:155-160 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_gemini.rs:625— src-tauri/src/proxy/providers/transform_gemini.rs:625-630 | src-tauri/src/proxy/providers/transform_gemini.rs:648-653 — both copies are in the same file, so extract the block into 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/proxy/providers/transform.rs:648— src-tauri/src/proxy/providers/transform.rs:648-653 | src-tauri/src/proxy/providers/transform_codex_chat.rs:2048-2053 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/mode/controller.rs src-tauri/src/mode/controller.rs:377— src-tauri/src/mode/controller.rs changed 52 times in last 90 days and 27 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 cc_switch::mode::controller::write_proxy at line 377), 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(providers): let an idle card be deleted when only the stale DB current flag points at it”; “fix(codex): keep the ChatGPT login when CC Switch detaches from routing”; “fix(codex): stop aggregated sessions from compacting on the previous provider”; “fix(codex): honor configured GPT context windows (#8385)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/mode/controller.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/services/proxy.rs src-tauri/src/services/proxy.rs:277— src-tauri/src/services/proxy.rs changed 26 times in last 90 days and 16 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ProxyService::live_has_proxy_placeholder at line 277), 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): let clients reach local routing through a separate connection address (#7878)”; “fix(proxy): roll back the saved listen address when the restart fails to bind”; “fix(proxy): save global routing settings without clobbering per-app retries and timeouts”; “fix(codex): keep proxy sessions in the same history bucket as direct”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/proxy.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/config.rs src-tauri/src/config.rs:215— src-tauri/src/config.rs changed 14 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is cc_switch::config::derive_wsl_home_dir at line 215), 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(wsl): skip syscalls 9P rejects when piConfigDir targets WSL (#8249)”; “fix(config): let the test home override win over the legacy HOME fallback (#7812)”; “fix(codex): skip Codex state DBs on WSL paths Windows cannot lock”; “fix(live): keep staged bytes and roll forward interrupted writes around external edits”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/config.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/services/provider/codex_editor.rs src-tauri/src/services/provider/codex_editor.rs:412— src-tauri/src/services/provider/codex_editor.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is cc_switch::services::provider::codex_editor::store_into_row at line 412), 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(codex): show the on-disk login in the official card's auth.json editor”; “fix(codex): keep a top-level base_url when saving a provider”; “fix(codex): treat model_catalog_json as a plain key field”; “fix(codex): let users switch back to CC Switch's model catalog when aggregation is blocked”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/provider/codex_editor.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/proxy/server.rs src-tauri/src/proxy/server.rs:102— src-tauri/src/proxy/server.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 7 (its worst body is ProxyServer::start at line 102), 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): stop child processes from inheriting the listener socket on Windows”; “fix(codex): keep proxy sessions in the same history bucket as direct”; “fix(codex): proxy image edits and Images API follow-ups (#7177)”; “fix(codex): proxy image edits endpoint”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/proxy/server.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src-tauri/src/services/balance.rs src-tauri/src/services/balance.rs:215— src-tauri/src/services/balance.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is cc_switch::services::balance::query_siliconflow at line 215), 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(usage): stop treating an empty DeepSeek balance as an expired plan”; “fix(usage): show the balance amount even when it is used up”; “fix(usage): show account balance when a Zhipu account has no coding plan”; “fix(usage): hide empty DeepSeek wallets when another currency has funds”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/balance.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/modelMetadata.ts src/lib/modelMetadata.ts:174— src/lib/modelMetadata.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 12 (its worst body is modelMetadata.indexModelsDev at line 174), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(models): don't borrow a vendor-hosted entry that points at another vendor”; “fix(models): match old OpenCode Zen/Go addresses to the moved models.dev entries”; “fix(models): cap only borrowed GPT windows and warn on oversized entries”; “fix(presets): cap GPT context windows at the 272K subscription window”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/lib/modelMetadata.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/grok_config.rs src-tauri/src/grok_config.rs:243— src-tauri/src/grok_config.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 8 (its worst body is cc_switch::grok_config::strip_grok_mcp_servers_from_settings at line 243), 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: stop shared config and live files from leaking provider settings”; “fix(grokbuild): keep provider model table selected when backfilling live config”; “fix(grokbuild): complete proxy and deep-link integrations (#5677)”; “fix(Security): zip-slip on skill install, two credential leaks, and three panic paths (#5811)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/grok_config.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/services/provider/codex_client_catalog.rs src-tauri/src/services/provider/codex_client_catalog.rs:351— src-tauri/src/services/provider/codex_client_catalog.rs changed 4 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 9 (its worst body is cc_switch::services::provider::codex_client_catalog::stale_clients at line 351), 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(codex): warn about stale Codex clients on Windows without a process table”; “fix(codex): run stale-client detection outside the aggregate stack view (#7892)”; “fix(codex): expose cached-account restart notice outside Stack mode (#8006)”; “fix(codex): keep proxy sessions in the same history bucket as direct”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/provider/codex_client_catalog.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/model_capabilities.rs src-tauri/src/model_capabilities.rs:19— src-tauri/src/model_capabilities.rs changed 4 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 5 (its worst body is cc_switch::model_capabilities::resolve_image_input_capability at line 19), 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(presets): move MiniMax CN and BaiLing to their current official endpoints”; “fix(pricing): move retired DeepSeek V4 family to the V4.1 Flash tier”; “fix(codex): mirror vision-capable DeepSeek catalog and un-gate the legacy v4-flash alias (#7286)”; “fix(codex): mark glm-5.3 as text-only (#6851)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/model_capabilities.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/tray_panel.rs src-tauri/src/tray_panel.rs:668— src-tauri/src/tray_panel.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is cc_switch::tray_panel::platform::apply at line 668), 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(tray): release the tray panel WebView in lightweight mode”; “fix(tray): align quota bars and show time until reset”; “fix(tray): keep tray panel rows stable and fit scaled displays (#8572)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/tray_panel.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/providers/forms/ApiKeyInput.tsx src/components/providers/forms/ApiKeyInput.tsx:22— src/components/providers/forms/ApiKeyInput.tsx changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ApiKeyInput.ApiKeyInput at line 22), 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(provider-form): stop macOS from capitalizing typed API keys”; “fix(providers): mark API Key as required where saving checks it”; “fix(providers): show the preset's promotion under the API Key field again”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/forms/ApiKeyInput.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/services/session_usage_grokbuild.rs src-tauri/src/services/session_usage_grokbuild.rs:188— src-tauri/src/services/session_usage_grokbuild.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is cc_switch::services::session_usage_grokbuild::sync_single_grok_file at line 188), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(usage): bill Claude 1-hour cache writes at the 1h rate (#7653)”; “fix(usage): import Grok Build session usage after 60s instead of 10min”; “fix(security): cap scripts, file reads, and proxy bodies; surface deeplink usage fields (#5919)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/session_usage_grokbuild.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/services/provider/claude_direct.rs src-tauri/src/services/provider/claude_direct.rs:48— src-tauri/src/services/provider/claude_direct.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is cc_switch::services::provider::claude_direct::write at line 48), 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(live): settle before acting, mark publishing before the first rename and keep live-owned fields out of new rows”; “fix(editor): keep live-owned exclusive fields and route tables out of provider rows”; “fix(live): keep staged bytes and roll forward interrupted writes around external edits”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/provider/claude_direct.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/proxy/session.rs src-tauri/src/proxy/session.rs:129— src-tauri/src/proxy/session.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is cc_switch::proxy::session::extract_responses_session at line 129), 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): recognize Codex session header aliases (#8718)”; “fix(proxy): preserve Claude JSON session identity (#8236)”; “fix(grokbuild): complete proxy and deep-link integrations (#5677)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/proxy/session.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/providers/CodexStaleClientsNotice.tsx src/components/providers/CodexStaleClientsNotice.tsx:24— src/components/providers/CodexStaleClientsNotice.tsx changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is CodexStaleClientsNotice.CodexStaleClientsNotice at line 24), 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(codex): warn about stale Codex clients on Windows without a process table”; “fix(codex): run stale-client detection outside the aggregate stack view (#7892)”; “fix(codex): expose cached-account restart notice outside Stack mode (#8006)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src/components/providers/CodexStaleClientsNotice.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/services/codex_oauth_models.rs src-tauri/src/services/codex_oauth_models.rs:56— src-tauri/src/services/codex_oauth_models.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is cc_switch::services::codex_oauth_models::parse_models at line 56), 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(codex): raise OAuth client identity to 0.159.0 for GPT-6.1 Sol (#7806)”; “fix(codex): raise OAuth client identity to 0.155.0 for GPT-6 Sol/Luna (#7597)”; “fix(codex): align OAuth client identity for GPT-6 (#7132)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/codex_oauth_models.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/services/sync_protocol.rs src-tauri/src/services/sync_protocol.rs:255— src-tauri/src/services/sync_protocol.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is cc_switch::services::sync_protocol::validate_manifest_compat at line 255), 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(sync): stop cutting off slow WebDAV/S3 transfers at a fixed 300s”; “fix(sync): preserve skills recovery snapshots after restore failures (#8155)”; “fix(sync): harden sync and restore consistency (#6147)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/services/sync_protocol.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/proxy/providers/codex_chat_common.rs src-tauri/src/proxy/providers/codex_chat_common.rs:5— src-tauri/src/proxy/providers/codex_chat_common.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is cc_switch::proxy::providers::codex_chat_common::extract_reasoning_field_text at line 5), 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): fall back to Gemini's skip signature when a cached one is lost”; “fix(proxy): round-trip Gemini thought signatures on Codex chat tool calls”; “fix(proxy): strip inline <think>/<thinking> blocks on the Claude and Codex chat paths (#7741)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 09:05:47 +08:00' --until='2026-10-25 09:05:47 +08:00' --full-history --no-merges -- src-tauri/src/proxy/providers/codex_chat_common.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.
Change coupling: ModelStatsTable.tsx ↔ ProviderStatsTable.tsx src/components/usage/ModelStatsTable.tsx:1— `src/components/usage/ModelStatsTable.tsx` and `src/components/usage/ProviderStatsTable.tsx` change together 100% of the time (10 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `cb3c9fef` fix(usage): left-align every usage table column and rebalance request…; `a0dd3b39` feat(usage): show first-token time in stats and estimate it without r…; `c615c3ee` feat(usage): show success rate and speed in model stats — run `git show` on any of them.
Change coupling: ClaudeStackModelsField.tsx ↔ CodexFormFields.tsx src/components/providers/forms/ClaudeStackModelsField.tsx:1— `src/components/providers/forms/ClaudeStackModelsField.tsx` and `src/components/providers/forms/CodexFormFields.tsx` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `644b7d5c` feat(forms): show model parameters in the picker and fill picks quietly; `f7244745` feat(forms): pick fetched models in a dialog that can also remove them; `e615a6f4` refactor(forms): make provider form hints follow the app's actual mode — run `git show` on any of them.
Change coupling: claudeProviderPresets.ts ↔ geminiProviderPresets.ts src/config/claudeProviderPresets.ts:1— `src/config/claudeProviderPresets.ts` and `src/config/geminiProviderPresets.ts` change together 81% of the time (21 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 21 shared commits counted here, the most recent 3 are `3494d0d1` chore(presets): add V-API backup endpoints; `30409878` chore(presets): add PackyCode backup endpoints; `f4a90214` feat(presets): add LemonData provider across all six apps — run `git show` on any of them.
Change coupling: settings.rs ↔ useSettingsForm.ts src-tauri/src/settings.rs:1— `src-tauri/src/settings.rs` and `src/hooks/useSettingsForm.ts` change together 78% of the time (14 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 14 shared commits counted here, the most recent 3 are `c21106ff` feat(i18n): add Turkish interface and tray localization (#8208); `6760cfbb` feat(codex): add an opt-in classic sub-agent tools toggle for aggrega…; `948d7627` feat(codex): add unified session history toggle for official providers — run `git show` on any of them.
Change coupling: provider.rs ↔ vite-env.d.ts src-tauri/src/commands/provider.rs:1— `src-tauri/src/commands/provider.rs` and `src/vite-env.d.ts` change together 70% of the time (23 of the 33 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 23 shared commits counted here, the most recent 3 are `9eb991d0` feat(ui): add drag-and-drop sorting for provider list (#126) (at that commit the file was still `src-tauri/src/commands.rs`); `3b6048b1` feat(config): migrate app_config_dir to Tauri Store for independent m… (at that commit the file was still `src-tauri/src/commands.rs`); `3e4df2c9` feat: add provider usage query with JavaScript scripting support (#101) (at that commit the file was still `src-tauri/src/commands.rs`) — run `git show` on any of them.
Change coupling: REDACTED ↔ ModelStatsTable.tsx REDACTED:1— `REDACTED` and `src/components/usage/ModelStatsTable.tsx` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `a0dd3b39` feat(usage): show first-token time in stats and estimate it without r…; `c615c3ee` feat(usage): show success rate and speed in model stats; `a75f4795` feat(usage): lift provider/model filters to dashboard-wide scope — run `git show` on any of them.
Change coupling: REDACTED ↔ ProviderStatsTable.tsx REDACTED:1— `REDACTED` and `src/components/usage/ProviderStatsTable.tsx` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 7 shared commits counted here, the most recent 3 are `a0dd3b39` feat(usage): show first-token time in stats and estimate it without r…; `a0be6456` fix(usage): keep provider stats rows distinct across apps (#8032); `c615c3ee` feat(usage): show success rate and speed in model stats — run `git show` on any of them.
Change coupling: CodexFormFields.tsx ↔ useCodexConfigState.ts src/components/providers/forms/CodexFormFields.tsx:1— `src/components/providers/forms/CodexFormFields.tsx` and `src/components/providers/forms/hooks/useCodexConfigState.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) 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 `e70e844c` feat(codex): let Auto Review use another model; `ac2eebc0` revert(forms): drop the Codex main reasoning effort picker; `6e7811e5` fix(proxy): send Bearer to OpenAI-format Claude upstreams and merge s… — run `git show` on any of them.
Change coupling: claudeDesktopProviderPresets.ts ↔ opencodeProviderPresets.ts src/config/claudeDesktopProviderPresets.ts:1— `src/config/claudeDesktopProviderPresets.ts` and `src/config/opencodeProviderPresets.ts` change together 52% of the time (37 of the 71 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 37 shared commits counted here, the most recent 3 are `0a129e94` feat(presets): add Fireworks AI provider presets; `58a9e8e2` fix(presets): drop the expired OpenCode Go referral code; `b45b2bd1` feat(presets): add Tencent Token Plan presets across six apps (#7011) — run `git show` on any of them.
Change coupling: REDACTED ↔ DeepLinkImportDialog.tsx src-tauri/src/deeplink/tests.rs:1— `src-tauri/src/deeplink/tests.rs` and `src/components/DeepLinkImportDialog.tsx` 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 `8b09732a` fix(usage): don't auto-enable Volcengine plan quota without AccessKey; `b13797e3` feat(deeplink): enable coding-plan usage by default on import; `bee47fdf` feat(deeplink): let provider links bring their own icon via iconUrl — run `git show` on any of them.
Change coupling: claude_mcp.rs ↔ codex.rs src-tauri/src/claude_mcp.rs:1— `src-tauri/src/claude_mcp.rs` and `src-tauri/src/mcp/codex.rs` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `67bd8f5c` fix(mcp): correct Codex MCP configuration format to [mcp_servers] (at that commit the file was still `src-tauri/src/mcp.rs`); `bfc27349` feat(mcp): add SSE (Server-Sent Events) transport type support (at that commit the file was still `src-tauri/src/mcp.rs`); `c985db8f` feat(mcp): implement unified MCP management for v3.7.0 (at that commit the file was still `src-tauri/src/mcp.rs`) — run `git show` on any of them.
Change coupling: usage.rs ↔ UsageDashboard.tsx src-tauri/src/commands/usage.rs:1— `src-tauri/src/commands/usage.rs` and `src/components/usage/UsageDashboard.tsx` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 8 shared commits counted here, the most recent 3 are `eff1e0cc` feat(db): rebuild Codex usage on upgrade and via maintenance action; `a75f4795` feat(usage): lift provider/model filters to dashboard-wide scope; `edf28b64` feat(usage): filter-driven Hero with cache-normalized totals — run `git show` on any of them.
Change coupling: usage.rs ↔ usage.ts src-tauri/src/commands/usage.rs:1— `src-tauri/src/commands/usage.rs` and `src/lib/query/usage.ts` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 7 shared commits counted here, the most recent 3 are `5d24fdf9` feat(usage): show all history in the all-time heatmap; `31e5ae3f` feat(sessions): show total tokens and API-price cost in the reader he…; `a75f4795` feat(usage): lift provider/model filters to dashboard-wide scope — run `git show` on any of them.
Change coupling: HermesFormFields.tsx ↔ OpenClawFormFields.tsx src/components/providers/forms/HermesFormFields.tsx:1— `src/components/providers/forms/HermesFormFields.tsx` and `src/components/providers/forms/OpenClawFormFields.tsx` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `ab5d4a12` fix(ui): trim redundant provider and settings helper copy (#8633); `8d7a7415` fix(models): cap only borrowed GPT windows and warn on oversized entries; `e675d586` refactor(providers): share models.dev query options and committable refs — run `git show` on any of them.
Change coupling: mcp.rs ↔ provider.rs src-tauri/src/commands/mcp.rs:1— `src-tauri/src/commands/mcp.rs` and `src-tauri/src/commands/provider.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `7997b2c7` feat(opencode): Phase 6 - Tauri command extensions for OpenCode; `80dd6e93` refactor(api): unify AppType parsing with FromStr trait; `931ef7d3` refactor(api): simplify app type parameter handling to single require… — run `git show` on any of them.
Change coupling: UnifiedMcpPanel.tsx ↔ PromptPanel.tsx src/components/mcp/UnifiedMcpPanel.tsx:1— `src/components/mcp/UnifiedMcpPanel.tsx` and `src/components/prompts/PromptPanel.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a4d07f31` feat(ui): edit MCP and prompts in full pages and confirm before leavi…; `fc08a5d3` fix(ui): replace hardcoded height calc with flex-1 to eliminate botto…; `3d733a3b` fix(ui): unify layout padding across all panels — run `git show` on any of them.
Change coupling: parser.rs ↔ DeepLinkImportDialog.tsx src-tauri/src/deeplink/parser.rs:1— `src-tauri/src/deeplink/parser.rs` and `src/components/DeepLinkImportDialog.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 `bee47fdf` feat(deeplink): let provider links bring their own icon via iconUrl; `16e7ff1c` feat(deeplink): let links declare the API format, import Pi providers…; `98222d19` fix(deeplink): stop losing links on cold start and tighten import checks — run `git show` on any of them.
Change coupling: mod.rs ↔ opencodeFormUtils.ts src-tauri/src/services/provider/mod.rs:1— `src-tauri/src/services/provider/mod.rs` and `src/components/providers/forms/helpers/opencodeFormUtils.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 `3af74823` feat(opencode): round-trip native v2 providers via JSON editor (#7579); `38a7c9c4` fix(opencode): 支持导入和编辑内置供应商覆盖 (#7749); `46fa2e0e` refactor(usage): drop per-provider and global cost multipliers — run `git show` on any of them.
Duplicated block (10 lines × 2) src-tauri/src/claude_mcp.rs:186— src-tauri/src/claude_mcp.rs:186-195 | src-tauri/src/mcp/validation.rs:18-27 — 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/commands/auth.rs:384— src-tauri/src/commands/auth.rs:384-393 | src-tauri/src/commands/auth.rs:402-411 — both copies are in the same file, so extract the block into 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/commands/config.rs:196— src-tauri/src/commands/config.rs:196-205 | src-tauri/src/commands/config.rs:222-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/commands/misc.rs:1106— src-tauri/src/commands/misc.rs:1106-1115 | src-tauri/src/commands/misc.rs:1137-1146 — both copies are in the same file, so extract the block into 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/hermes_config.rs:393— src-tauri/src/hermes_config.rs:393-402 | src-tauri/src/openclaw_config.rs:415-424 — before extracting anything, compare `src-tauri/src/hermes_config.rs` and `src-tauri/src/openclaw_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) src-tauri/src/lib.rs:313— src-tauri/src/lib.rs:313-322 | src-tauri/src/tray.rs:2776-2785 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/mcp/kimi.rs:55— src-tauri/src/mcp/kimi.rs:55-64 | src-tauri/src/mcp/mcode.rs:45-54 — before extracting anything, compare `src-tauri/src/mcp/kimi.rs` and `src-tauri/src/mcp/mcode.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) src-tauri/src/proxy/providers/codex.rs:106— src-tauri/src/proxy/providers/codex.rs:106-115 | src-tauri/src/proxy/providers/codex.rs:670-679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/proxy/providers/codex_compaction.rs:345— src-tauri/src/proxy/providers/codex_compaction.rs:345-354 | src-tauri/src/proxy/providers/responses_late_arguments.rs:206-215 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_compaction.rs` and `src-tauri/src/proxy/providers/responses_late_arguments.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) src-tauri/src/proxy/providers/copilot_auth.rs:1101— src-tauri/src/proxy/providers/copilot_auth.rs:1101-1110 | src-tauri/src/proxy/providers/copilot_auth.rs:1215-1224 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_codex_responses_namespace.rs:131— src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:131-140 | src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:182-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/services/coding_plan.rs:218— src-tauri/src/services/coding_plan.rs:218-227 | src-tauri/src/services/coding_plan.rs:241-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/services/skill.rs:479— src-tauri/src/services/skill.rs:479-488 | src-tauri/src/services/skill.rs:489-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) REDACTED:197— REDACTED:197-206 | src-tauri/src/services/subscription_grok.rs:43-52 — before extracting anything, compare `REDACTED` and `src-tauri/src/services/subscription_grok.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) REDACTED:1003— REDACTED:1003-1012 | src-tauri/src/services/subscription_grok.rs:594-603 — before extracting anything, compare `REDACTED` and `src-tauri/src/services/subscription_grok.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) src-tauri/src/services/subscription_grok.rs:292— src-tauri/src/services/subscription_grok.rs:292-301 | src-tauri/src/services/subscription_grok.rs:329-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src-tauri/src/live/project/grok.rs:238— src-tauri/src/live/project/grok.rs:238-247 | src-tauri/src/live/project/grok.rs:349-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src-tauri/src/codex_config.rs:1088— src-tauri/src/codex_config.rs:1088-1098 | src-tauri/src/codex_config.rs:1162-1172 — both copies are in the same file, so extract the block into 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) REDACTED:1017— REDACTED:1017-1027 | REDACTED:1159-1169 — both copies are in the same file, so extract the block into 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/live/project/codex.rs:894— src-tauri/src/live/project/codex.rs:894-904 | src-tauri/src/live/project/grok.rs:286-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/openclaw_config.rs:763— src-tauri/src/openclaw_config.rs:763-773 | src-tauri/src/openclaw_config.rs:804-814 — both copies are in the same file, so extract the block into 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/proxy/providers/codex_oauth_auth.rs:878— src-tauri/src/proxy/providers/codex_oauth_auth.rs:878-888 | src-tauri/src/proxy/providers/codex_oauth_auth.rs:923-933 — both copies are in the same file, so extract the block into 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/proxy/providers/codex_oauth_auth.rs:1919— src-tauri/src/proxy/providers/codex_oauth_auth.rs:1919-1929 | src-tauri/src/proxy/providers/copilot_auth.rs:1389-1399 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src-tauri/src/proxy/providers/xai_oauth_auth.rs:296— src-tauri/src/proxy/providers/xai_oauth_auth.rs:296-306 | src-tauri/src/proxy/providers/xai_oauth_auth.rs:520-531 — both copies are in the same file, so extract the block into 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/services/coding_plan.rs:695— src-tauri/src/services/coding_plan.rs:695-705 | src-tauri/src/services/coding_plan.rs:716-726 — both copies are in the same file, so extract the block into 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/services/s3_auto_sync.rs:79— src-tauri/src/services/s3_auto_sync.rs:79-89 | src-tauri/src/services/webdav_auto_sync.rs:79-89 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) REDACTED:691— REDACTED:691-701 | REDACTED:1213-1223 — both copies are in the same file, so extract the block into 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/proxy/providers/streaming_codex_anthropic.rs:136— src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:136-146 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:193-205 — before extracting anything, compare `src-tauri/src/proxy/providers/streaming_codex_anthropic.rs` and `src-tauri/src/proxy/providers/streaming_codex_chat.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src-tauri/src/commands/s3_sync.rs:74— src-tauri/src/commands/s3_sync.rs:74-84 | src-tauri/src/commands/webdav_sync.rs:79-89 — before extracting anything, compare `src-tauri/src/commands/s3_sync.rs` and `src-tauri/src/commands/webdav_sync.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:702— src-tauri/src/proxy/providers/transform_codex_anthropic.rs:702-712 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:715-725 — both copies are in the same file, so extract the block into 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/services/provider/live.rs:1347— src-tauri/src/services/provider/live.rs:1347-1357 | src-tauri/src/services/provider/live.rs:1435-1445 — both copies are in the same file, so extract the block into 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/mcp/codex.rs:410— src-tauri/src/mcp/codex.rs:410-420 | src-tauri/src/mcp/grokbuild.rs:197-207 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) src-tauri/src/hermes_config.rs:403— src-tauri/src/hermes_config.rs:403-413 | src-tauri/src/openclaw_config.rs:425-435 — before extracting anything, compare `src-tauri/src/hermes_config.rs` and `src-tauri/src/openclaw_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
R4 · Test Coverage· No test reaches this file · ×16
No test reaches this file src/components/DatabaseUpgrade.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/types/proxy.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/main.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/table.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/card.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 scripts/generate-download-manifest.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/lib/windowActivity.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/ui/accordion.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/tabs.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/scroll-area.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 scripts/rewrite-updater-manifest.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/components/ui/sonner.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/toggle-row.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/tray-panel/main.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/common/ListItemRow.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/hooks/useDebouncedValue.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.
SkillService::import_from_apps (cognitive 64) src-tauri/src/services/skill.rs:2326— SkillService::import_from_apps has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (50 pts), loops 5 (8 pts), match/switch 2 (4 pts), boolean chains 2 (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.
SkillService::migrate_storage (cognitive 47) src-tauri/src/services/skill.rs:1895— SkillService::migrate_storage has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (32 pts), match/switch 4 (8 pts), loops 6 (7 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.
SkillService::uninstall (cognitive 42) src-tauri/src/services/skill.rs:1056— SkillService::uninstall has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 5 (10 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SkillService::update_managed_skill_files (cognitive 33) src-tauri/src/services/skill.rs:1770— SkillService::update_managed_skill_files has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (6 pts), boolean chains 4 (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.
SkillService::check_updates_report (cognitive 30) src-tauri/src/services/skill.rs:1367— SkillService::check_updates_report has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 6 (17 pts), if/else 3 (9 pts), loops 3 (4 pts) (nesting depth added 18). 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.
SkillService::update_skill (cognitive 30) src-tauri/src/services/skill.rs:1526— SkillService::update_skill has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillService::sync_to_app_unlocked (cognitive 24) src-tauri/src/services/skill.rs:2996— SkillService::sync_to_app_unlocked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillService::toggle_app (cognitive 23) src-tauri/src/services/skill.rs:2190— SkillService::toggle_app has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 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.
SkillService::extract_repo_archive (cognitive 22) src-tauri/src/services/skill.rs:3936— SkillService::extract_repo_archive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 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.
SkillService::resolve_symlinks_in_dir (cognitive 21) src-tauri/src/services/skill.rs:4246— SkillService::resolve_symlinks_in_dir has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (10 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.
SkillService::scan_unmanaged (cognitive 20) src-tauri/src/services/skill.rs:2262— SkillService::scan_unmanaged has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillService::sync_to_app_dir (cognitive 18) src-tauri/src/services/skill.rs:2718— SkillService::sync_to_app_dir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillService::install_from_zip (cognitive 17) src-tauri/src/services/skill.rs:4339— SkillService::install_from_zip has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillService::extract_local_zip_in (cognitive 17) src-tauri/src/services/skill.rs:4498— SkillService::extract_local_zip_in has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 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.
SkillService::get_app_skills_dir (cognitive 16) src-tauri/src/services/skill.rs:655— SkillService::get_app_skills_dir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (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.
MethodTooLong: RequestForwarder.forward src-tauri/src/proxy/forwarder.rs:1374— MethodTooLong — forward runs 913 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 813 over it, 9.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Database.seed_model_pricing src-tauri/src/database/schema.rs:1676— MethodTooLong — seed_model_pricing runs 557 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 457 over it, 5.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: RequestForwarder.forward_with_retry_inner src-tauri/src/proxy/forwarder.rs:781— MethodTooLong — forward_with_retry_inner runs 406 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 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Database.create_tables_on_conn src-tauri/src/database/schema.rs:24— MethodTooLong — create_tables_on_conn runs 276 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 176 over it, 2.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: TrayTexts.from_language src-tauri/src/tray.rs:187— MethodTooLong — from_language runs 272 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 172 over it, 2.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.
MethodTooLong: Database.get_daily_trends REDACTED:1274— MethodTooLong — get_daily_trends runs 271 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 171 over it, 2.71× 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: Database.get_model_stats REDACTED:1903— MethodTooLong — get_model_stats runs 161 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 61 over it, 1.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: Database.get_provider_stats REDACTED:1710— MethodTooLong — get_provider_stats runs 159 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 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CodexOAuthManager.add_account_internal src-tauri/src/proxy/providers/codex_oauth_auth.rs:1697— MethodTooLong — add_account_internal runs 149 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 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Database.apply_schema_migrations_on_conn src-tauri/src/database/schema.rs:451— MethodTooLong — apply_schema_migrations_on_conn runs 148 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Database.get_usage_summary_by_app REDACTED:1109— MethodTooLong — get_usage_summary_by_app runs 135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BufferedCitationTextState.render_message_part src-tauri/src/proxy/providers/streaming_responses.rs:1653— MethodTooLong — render_message_part runs 118 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Database.migrate_proxy_config_to_per_app src-tauri/src/database/schema.rs:847— MethodTooLong — migrate_proxy_config_to_per_app 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.
MethodTooLong: Database.migrate_v1_to_v2 src-tauri/src/database/schema.rs:709— MethodTooLong — migrate_v1_to_v2 runs 109 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CodexOAuthManager.resolve_valid_cached_token_under_lock src-tauri/src/proxy/providers/codex_oauth_auth.rs:900— MethodTooLong — resolve_valid_cached_token_under_lock runs 104 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 4 over it, 1.04× 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.
AC2 · Forms & labels· <Select> field component without a label · ×14
<Select> field component without a label src/components/apps/AppsPage.tsx:834— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/apps/AppsPage.tsx:854— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/openclaw/AgentsDefaultsPanel.tsx:241— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/openclaw/AgentsDefaultsPanel.tsx:284— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/openclaw/ToolsPanel.tsx:146— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/providers/forms/ClaudeDesktopProviderForm.tsx:1120— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/providers/forms/ClaudeFormFields.tsx:919— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/providers/forms/CodexFormFields.tsx:496— 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.
<Select> field component without a label src/components/providers/forms/CodexFormFields.tsx:1451— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/providers/forms/CopilotAuthSection.tsx:184— 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.
<Select> field component without a label src/components/providers/forms/XaiOAuthSection.tsx:253— 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.
<Select> field component without a label src/components/settings/BackupListSection.tsx:183— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/BackupListSection.tsx:238— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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/WebdavSyncSection.tsx:974— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). 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.
Duplicated block (14 lines × 2) src-tauri/src/codex_history_migration.rs:703— src-tauri/src/codex_history_migration.rs:703-716 | src-tauri/src/codex_history_migration.rs:1282-1295 — both copies are in the same file, so extract the block into 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/mcp/claude.rs:62— src-tauri/src/mcp/claude.rs:62-75 | src-tauri/src/mcp/gemini.rs:58-71 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/gemini.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) src-tauri/src/mcp/hermes.rs:306— src-tauri/src/mcp/hermes.rs:306-319 | src-tauri/src/mcp/opencode.rs:250-263 — before extracting anything, compare `src-tauri/src/mcp/hermes.rs` and `src-tauri/src/mcp/opencode.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:380— src-tauri/src/proxy/providers/streaming_responses.rs:380-393 | src-tauri/src/proxy/providers/streaming_responses.rs:804-817 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:2073— src-tauri/src/proxy/providers/streaming_responses.rs:2073-2086 | src-tauri/src/proxy/providers/transform_responses.rs:2643-2656 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) src-tauri/src/services/provider/live.rs:949— src-tauri/src/services/provider/live.rs:949-962 | src-tauri/src/services/provider/live.rs:1106-1119 — both copies are in the same file, so extract the block into 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/services/s3.rs:315— src-tauri/src/services/s3.rs:315-328 | src-tauri/src/services/webdav.rs:450-463 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) src-tauri/src/services/s3_auto_sync.rs:138— src-tauri/src/services/s3_auto_sync.rs:138-151 | src-tauri/src/services/webdav_auto_sync.rs:142-155 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) REDACTED:1845— REDACTED:1845-1858 | REDACTED:2045-2058 — both copies are in the same file, so extract the block into 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/session_manager/providers/gemini.rs:455— src-tauri/src/session_manager/providers/gemini.rs:455-468 | src-tauri/src/session_manager/providers/pi_blocks.rs:454-467 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:1868— src-tauri/src/proxy/providers/streaming_responses.rs:1868-1881 | src-tauri/src/proxy/providers/streaming_responses.rs:1885-1898 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_gemini.rs:611— src-tauri/src/proxy/providers/transform_gemini.rs:611-624 | src-tauri/src/proxy/providers/transform_gemini.rs:634-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.
Duplicated block (13 lines × 2) src-tauri/src/mcp/hermes.rs:287— src-tauri/src/mcp/hermes.rs:287-299 | src-tauri/src/mcp/opencode.rs:231-243 — before extracting anything, compare `src-tauri/src/mcp/hermes.rs` and `src-tauri/src/mcp/opencode.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src-tauri/src/mcp/kimi.rs:74— src-tauri/src/mcp/kimi.rs:74-86 | src-tauri/src/mcp/mcode.rs:59-71 — before extracting anything, compare `src-tauri/src/mcp/kimi.rs` and `src-tauri/src/mcp/mcode.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src-tauri/src/proxy/forwarder.rs:2914— src-tauri/src/proxy/forwarder.rs:2914-2926 | src-tauri/src/proxy/forwarder.rs:2941-2953 — both copies are in the same file, so extract the block into 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/proxy/providers/streaming_responses.rs:3292— src-tauri/src/proxy/providers/streaming_responses.rs:3292-3304 | src-tauri/src/proxy/providers/streaming_responses.rs:4150-4162 — both copies are in the same file, so extract the block into 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/proxy/providers/transform.rs:800— src-tauri/src/proxy/providers/transform.rs:800-812 | src-tauri/src/proxy/providers/transform_responses.rs:2805-2817 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.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 (13 lines × 2) src-tauri/src/session_manager/providers/opencode.rs:534— src-tauri/src/session_manager/providers/opencode.rs:534-546 | src-tauri/src/session_manager/providers/opencode.rs:824-836 — both copies are in the same file, so extract the block into 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/usage_script.rs:70— src-tauri/src/usage_script.rs:70-82 | src-tauri/src/usage_script.rs:145-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src-tauri/src/mcp/claude.rs:142— src-tauri/src/mcp/claude.rs:142-154 | src-tauri/src/mcp/gemini.rs:137-149 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/gemini.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src-tauri/src/session_manager/terminal/mod.rs:35— src-tauri/src/session_manager/terminal/mod.rs:35-47 | src-tauri/src/session_manager/terminal/mod.rs:157-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src-tauri/src/services/skill.rs:1032— src-tauri/src/services/skill.rs:1032-1045 | src-tauri/src/services/skill.rs:4466-4478 — both copies are in the same file, so extract the block into 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) REDACTED:1396— REDACTED:1396-1408 | REDACTED:1455-1467 — both copies are in the same file, so extract the block into 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/mcp/claude.rs:79— src-tauri/src/mcp/claude.rs:79-91 | src-tauri/src/mcp/gemini.rs:75-87 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/gemini.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×11
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×10
ProviderService::update (cognitive 60) src-tauri/src/services/provider/mod.rs:6186— ProviderService::update has cognitive complexity 60 (threshold 15). Drivers by points: if/else 26 (50 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderService::validate_provider_settings (cognitive 31) src-tauri/src/services/provider/mod.rs:7894— ProviderService::validate_provider_settings has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 1, match/switch 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.
ProviderService::delete (cognitive 29) src-tauri/src/services/provider/mod.rs:6502— ProviderService::delete has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderService::switch_normal (cognitive 27) src-tauri/src/services/provider/mod.rs:6866— ProviderService::switch_normal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 3 (8 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProviderService::list (cognitive 26) src-tauri/src/services/provider/mod.rs:5459— ProviderService::list has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderService::add (cognitive 26) src-tauri/src/services/provider/mod.rs:5611— ProviderService::add has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderService::scrub_leaked_gemini_common_config (cognitive 22) src-tauri/src/services/provider/mod.rs:7550— ProviderService::scrub_leaked_gemini_common_config has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 3, match/switch 2 (3 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.
ProviderService::extract_codex_common_config (cognitive 20) src-tauri/src/services/provider/mod.rs:7392— ProviderService::extract_codex_common_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderService::remove_from_live_config (cognitive 16) src-tauri/src/services/provider/mod.rs:6630— ProviderService::remove_from_live_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 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.
Duplicated block (12 lines × 2) src-tauri/src/commands/misc.rs:2623— src-tauri/src/commands/misc.rs:2623-2634 | src-tauri/src/commands/misc.rs:2638-2649 — both copies are in the same file, so extract the block into 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) REDACTED:614— REDACTED:614-625 | src-tauri/src/services/config.rs:50-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) src-tauri/src/proxy/providers/streaming.rs:582— src-tauri/src/proxy/providers/streaming.rs:582-593 | src-tauri/src/proxy/providers/streaming.rs:596-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 (12 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:630— src-tauri/src/proxy/providers/streaming_responses.rs:630-641 | src-tauri/src/proxy/providers/streaming_responses.rs:647-658 — both copies are in the same file, so extract the block into 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/proxy/providers/transform_responses.rs:1504— src-tauri/src/proxy/providers/transform_responses.rs:1504-1515 | src-tauri/src/proxy/providers/transform_responses.rs:1554-1565 — both copies are in the same file, so extract the block into 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/services/session_usage_codex.rs:2303— src-tauri/src/services/session_usage_codex.rs:2303-2314 | src-tauri/src/services/session_usage_gemini.rs:250-261 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) src-tauri/src/session_manager/providers/claude.rs:139— src-tauri/src/session_manager/providers/claude.rs:139-150 | src-tauri/src/session_manager/providers/codex.rs:1973-1984 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) src-tauri/src/services/s3_auto_sync.rs:124— src-tauri/src/services/s3_auto_sync.rs:124-135 | src-tauri/src/services/webdav_auto_sync.rs:128-139 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) src-tauri/src/services/coding_plan.rs:1180— src-tauri/src/services/coding_plan.rs:1180-1191 | src-tauri/src/services/coding_plan.rs:1221-1232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×8
Animation without a prefers-reduced-motion guard deplink.html:306— `.toast` moves (`animation: tin 200ms cubic-bezier(.4, 0, .2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/components/universal/UniversalProviderPanel.tsx:244— <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/index.css:269— `.ui-checkbox::before` moves (`transition: transform 120ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/index.css:450— `.pi-thinking-popover[data-state="open"]` moves (`animation: pi-thinking-popover-in 260ms cubic-bezier(0.16, 1, 0.3, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/index.css:454— `.pi-thinking-popover[data-state="closed"]` moves (`animation: pi-thinking-popover-out 150ms cubic-bezier(0.4, 0, 1, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/tray-panel/tray-panel.css:123— `html[data-layout="floating"] .tp-sub[data-side="right"]` moves (`animation: tp-sub-in-right 140ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/tray-panel/tray-panel.css:126— `html[data-layout="floating"] .tp-sub[data-side="left"]` moves (`animation: tp-sub-in-left 140ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard src/components/usage/RequestLogTable.tsx:306— `row.animate()` moves (`Web Animations API keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
RolloutParser::finish_call (cognitive 65) src-tauri/src/session_manager/providers/codex.rs:1558— RolloutParser::finish_call has cognitive complexity 65 (threshold 15). Drivers by points: if/else 26 (46 pts), match/switch 4 (8 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RolloutParser::backfill_finished_result (cognitive 32) src-tauri/src/session_manager/providers/codex.rs:1422— RolloutParser::backfill_finished_result has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (29 pts), loops 2 (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.
RolloutParser::process_line (cognitive 25) src-tauri/src/session_manager/providers/codex.rs:615— RolloutParser::process_line has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (23 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.
RolloutParser::on_user_message (cognitive 22) src-tauri/src/session_manager/providers/codex.rs:937— RolloutParser::on_user_message has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RolloutParser::finish (cognitive 22) src-tauri/src/session_manager/providers/codex.rs:1760— RolloutParser::finish has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4, 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.
RolloutParser::response_item (cognitive 19) src-tauri/src/session_manager/providers/codex.rs:674— RolloutParser::response_item has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RolloutParser::event_msg (cognitive 16) src-tauri/src/session_manager/providers/codex.rs:725— RolloutParser::event_msg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 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.
TooManyMethods: Database src-tauri/src/database/mod.rs:78— TooManyMethods — 224 methods, declared across 18 files: REDACTED (35), database/schema.rs (35), dao/proxy.rs (29), dao/settings.rs (25), +14 more file(s). The bar is 30 methods; this is 194 over it, 7.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SkillService src-tauri/src/services/skill.rs:576— TooManyMethods — 111 methods. The bar is 30 methods; this is 81 over it, 3.70× 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: ProviderService src-tauri/src/services/provider/mod.rs:149— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.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: CodexOAuthManager src-tauri/src/proxy/providers/codex_oauth_auth.rs:374— TooManyMethods — 43 methods, declared across 2 files: providers/codex_oauth_auth.rs (39), codex_oauth_auth/browser.rs (4). The bar is 30 methods; this is 13 over it, 1.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: CopilotAuthManager src-tauri/src/proxy/providers/copilot_auth.rs:556— 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: BufferedCitationTextState src-tauri/src/proxy/providers/streaming_responses.rs:705— 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: ProxyService src-tauri/src/services/proxy.rs:20— 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×7
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×7
Members sharing a duplicated core (4 members, 50+ identical tokens) src-tauri/src/mcp/agy.rs:11— src-tauri/src/mcp/agy.rs:11-29 | src-tauri/src/mcp/kimi.rs:19-33 | src-tauri/src/mcp/mcode.rs:11-23 | src-tauri/src/mcp/pi.rs:57-69 — 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/mcp/agy.rs:66— src-tauri/src/mcp/agy.rs:66-109 | src-tauri/src/mcp/kimi.rs:54-86 | src-tauri/src/mcp/mcode.rs:44-71 | src-tauri/src/mcp/pi.rs:145-195 — 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/mcp/agy.rs:171— src-tauri/src/mcp/agy.rs:171-187 | src-tauri/src/mcp/kimi.rs:147-162 | src-tauri/src/mcp/mcode.rs:132-142 | src-tauri/src/mcp/pi.rs:272-282 — 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/mcp/claude.rs:51— src-tauri/src/mcp/claude.rs:51-119 | src-tauri/src/mcp/codex.rs:69-295 | src-tauri/src/mcp/gemini.rs:51-115 | src-tauri/src/mcp/opencode.rs:213-291 — 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/mcp/hermes.rs:61— src-tauri/src/mcp/hermes.rs:61-105 | src-tauri/src/mcp/hermes.rs:117-163 | src-tauri/src/mcp/opencode.rs:44-105 | src-tauri/src/mcp/opencode.rs:116-178 — 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/proxy/handlers.rs:547— src-tauri/src/proxy/handlers.rs:547-859 | src-tauri/src/proxy/handlers.rs:1696-1919 | src-tauri/src/proxy/handlers.rs:2091-2169 | src-tauri/src/proxy/response_processor.rs:501-591 — 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/services/s3.rs:333— src-tauri/src/services/s3.rs:333-367 | src-tauri/src/services/s3.rs:375-411 | src-tauri/src/services/s3.rs:420-485 | src-tauri/src/services/s3.rs:491-532 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (15 lines × 2) src-tauri/src/proxy/providers/codex.rs:970— src-tauri/src/proxy/providers/codex.rs:970-984 | src-tauri/src/proxy/providers/gemini.rs:134-148 — before extracting anything, compare `src-tauri/src/proxy/providers/codex.rs` and `src-tauri/src/proxy/providers/gemini.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3448— src-tauri/src/proxy/providers/streaming_responses.rs:3448-3462 | src-tauri/src/proxy/providers/streaming_responses.rs:3503-3517 — both copies are in the same file, so extract the block into 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/proxy/usage/logger.rs:269— src-tauri/src/proxy/usage/logger.rs:269-283 | src-tauri/src/proxy/usage/logger.rs:310-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) src-tauri/src/services/s3_auto_sync.rs:158— src-tauri/src/services/s3_auto_sync.rs:158-172 | src-tauri/src/services/webdav_auto_sync.rs:162-176 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) REDACTED:1394— REDACTED:1394-1408 | REDACTED:1593-1607 — both copies are in the same file, so extract the block into 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/session_manager/providers/codex.rs:1992— src-tauri/src/session_manager/providers/codex.rs:1992-2006 | src-tauri/src/session_manager/providers/openclaw.rs:172-186 — before extracting anything, compare `src-tauri/src/session_manager/providers/codex.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) src-tauri/src/services/s3_sync.rs:65— src-tauri/src/services/s3_sync.rs:65-79 | src-tauri/src/services/webdav_sync.rs:88-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
ProviderService::update (cyclomatic 36) src-tauri/src/services/provider/mod.rs:6186— ProviderService::update 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.
ProviderService::validate_provider_settings (cyclomatic 27) src-tauri/src/services/provider/mod.rs:7894— ProviderService::validate_provider_settings 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.
ProviderService::switch_normal (cyclomatic 24) src-tauri/src/services/provider/mod.rs:6866— ProviderService::switch_normal 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.
ProviderService::add (cyclomatic 23) src-tauri/src/services/provider/mod.rs:5611— ProviderService::add 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.
ProviderService::delete (cyclomatic 21) src-tauri/src/services/provider/mod.rs:6502— ProviderService::delete 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.
ProviderService::scrub_leaked_gemini_common_config (cyclomatic 18) src-tauri/src/services/provider/mod.rs:7550— ProviderService::scrub_leaked_gemini_common_config 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.
SkillService::get_app_skills_dir (cyclomatic 30) src-tauri/src/services/skill.rs:655— SkillService::get_app_skills_dir has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SkillService::import_from_apps (cyclomatic 27) src-tauri/src/services/skill.rs:2326— SkillService::import_from_apps 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.
SkillService::migrate_storage (cyclomatic 25) src-tauri/src/services/skill.rs:1895— SkillService::migrate_storage 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.
SkillService::update_skill (cyclomatic 21) src-tauri/src/services/skill.rs:1526— SkillService::update_skill 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.
SkillService::uninstall (cyclomatic 19) src-tauri/src/services/skill.rs:1056— SkillService::uninstall 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.
SkillService::update_managed_skill_files (cyclomatic 19) src-tauri/src/services/skill.rs:1770— SkillService::update_managed_skill_files 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.
Change-coupling hub: RequestLogTable.tsx → usage.rs, ModelStatsTable.tsx, PricingConfigPanel.tsx, ProviderStatsTable.tsx src/components/usage/RequestLogTable.tsx— `src/components/usage/RequestLogTable.tsx` changes together with 4 other files — `src-tauri/src/commands/usage.rs`, `src/components/usage/ModelStatsTable.tsx`, `src/components/usage/PricingConfigPanel.tsx`, `src/components/usage/ProviderStatsTable.tsx` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: hermesProviderPresets.ts → claudeDesktopProviderPresets.ts, openclawProviderPresets.ts, opencodeProviderPresets.ts, piProviderPresets.ts src/config/hermesProviderPresets.ts— `src/config/hermesProviderPresets.ts` changes together with 4 other files — `src/config/claudeDesktopProviderPresets.ts`, `src/config/openclawProviderPresets.ts`, `src/config/opencodeProviderPresets.ts`, `src/config/piProviderPresets.ts` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: codexProviderPresets.ts → claudeDesktopProviderPresets.ts, geminiProviderPresets.ts, hermesProviderPresets.ts, openclawProviderPresets.ts, opencodeProviderPresets.ts, piProviderPresets.ts src/config/codexProviderPresets.ts— `src/config/codexProviderPresets.ts` changes together with 6 other files — `src/config/claudeDesktopProviderPresets.ts`, `src/config/geminiProviderPresets.ts`, `src/config/hermesProviderPresets.ts`, `src/config/openclawProviderPresets.ts`, `src/config/opencodeProviderPresets.ts`, `src/config/piProviderPresets.ts` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
Change-coupling hub: lib.rs → index.ts, usage.ts, vite-env.d.ts src-tauri/src/lib.rs— `src-tauri/src/lib.rs` changes together with 3 other files — `src/lib/api/index.ts`, `src/lib/api/usage.ts`, `src/vite-env.d.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.
Change-coupling hub: openclawProviderPresets.ts → claudeDesktopProviderPresets.ts, opencodeProviderPresets.ts, piProviderPresets.ts src/config/openclawProviderPresets.ts— `src/config/openclawProviderPresets.ts` changes together with 3 other files — `src/config/claudeDesktopProviderPresets.ts`, `src/config/opencodeProviderPresets.ts`, `src/config/piProviderPresets.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.
Change-coupling hub: App.tsx → FullScreenPanel.tsx, PromptFormPanel.tsx, index.ts src/App.tsx— `src/App.tsx` changes together with 3 other files — `src/components/common/FullScreenPanel.tsx`, `src/components/prompts/PromptFormPanel.tsx`, `src/lib/api/index.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.
Duplicated block (10 lines × 3) src-tauri/src/commands/misc.rs:2562— src-tauri/src/commands/misc.rs:2562-2571 | src-tauri/src/commands/misc.rs:2658-2667 | src-tauri/src/commands/misc.rs:2670-2679 — 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/proxy/providers/codex.rs:734— src-tauri/src/proxy/providers/codex.rs:734-743 | src-tauri/src/proxy/providers/codex.rs:746-755 | src-tauri/src/proxy/providers/codex.rs:782-791 — 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/proxy/providers/codex.rs:758— src-tauri/src/proxy/providers/codex.rs:758-767 | src-tauri/src/proxy/providers/codex.rs:827-836 | src-tauri/src/proxy/providers/codex.rs:844-853 — 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/proxy/providers/codex_compaction.rs:361— src-tauri/src/proxy/providers/codex_compaction.rs:361-370 | src-tauri/src/proxy/providers/responses_late_arguments.rs:225-234 | src-tauri/src/proxy/providers/transform_codex_responses_xai_sanitize.rs:1088-1097 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_compaction.rs` and `src-tauri/src/proxy/providers/responses_late_arguments.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) src-tauri/src/proxy/providers/streaming_responses.rs:522— src-tauri/src/proxy/providers/streaming_responses.rs:522-531 | src-tauri/src/proxy/providers/streaming_responses.rs:547-556 | src-tauri/src/proxy/providers/streaming_responses.rs:717-726 — 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/services/s3.rs:376— src-tauri/src/services/s3.rs:376-385 | src-tauri/src/services/s3.rs:421-430 | src-tauri/src/services/s3.rs:492-501 — 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.
RolloutParser::finish_call (cyclomatic 38) src-tauri/src/session_manager/providers/codex.rs:1558— RolloutParser::finish_call has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RolloutParser::response_item (cyclomatic 19) src-tauri/src/session_manager/providers/codex.rs:674— RolloutParser::response_item 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.
RolloutParser::process_line (cyclomatic 17) src-tauri/src/session_manager/providers/codex.rs:615— RolloutParser::process_line 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.
RolloutParser::event_msg (cyclomatic 16) src-tauri/src/session_manager/providers/codex.rs:725— RolloutParser::event_msg 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.
RolloutParser::on_item (cyclomatic 16) src-tauri/src/session_manager/providers/codex.rs:1323— RolloutParser::on_item 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.
Database::get_daily_trends (cognitive 40) REDACTED:1274— Database::get_daily_trends has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 5 (7 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.
Database::apply_schema_migrations_on_conn (cognitive 32) src-tauri/src/database/schema.rs:451— Database::apply_schema_migrations_on_conn has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 4 (10 pts), match/switch 2 (3 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.
Database::dump_sql (cognitive 31) REDACTED:709— Database::dump_sql has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 5 (8 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.
Database::migrate_v5_to_v6 (cognitive 19) src-tauri/src/database/schema.rs:1216— Database::migrate_v5_to_v6 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (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.
Database::get_model_stats (cognitive 17) REDACTED:1903— Database::get_model_stats has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 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.
TranscriptBuilder::push_assistant (cognitive 33) src-tauri/src/session_manager/providers/claude.rs:566— TranscriptBuilder::push_assistant has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscriptBuilder::tool_result_block (cognitive 28) src-tauri/src/session_manager/providers/claude.rs:786— TranscriptBuilder::tool_result_block has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 4 (7 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.
TranscriptBuilder::backfill_call (cognitive 23) src-tauri/src/session_manager/providers/claude.rs:906— TranscriptBuilder::backfill_call has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscriptBuilder::push_user_texts (cognitive 19) src-tauri/src/session_manager/providers/claude.rs:718— TranscriptBuilder::push_user_texts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 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.
TranscriptBuilder::push_user (cognitive 17) src-tauri/src/session_manager/providers/claude.rs:656— TranscriptBuilder::push_user has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (16 lines × 2) src-tauri/src/deeplink/codex_link.rs:273— src-tauri/src/deeplink/codex_link.rs:273-288 | src-tauri/src/deeplink/grok_link.rs:210-225 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:2863— src-tauri/src/proxy/providers/streaming_responses.rs:2863-2878 | src-tauri/src/proxy/providers/streaming_responses.rs:4200-4216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) src-tauri/src/services/provider/codex_editor.rs:78— src-tauri/src/services/provider/codex_editor.rs:78-93 | src-tauri/src/services/provider/grok_editor.rs:48-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) src-tauri/src/services/session_usage_codex.rs:1167— src-tauri/src/services/session_usage_codex.rs:1167-1182 | src-tauri/src/services/session_usage_codex.rs:1188-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 (16 lines × 2) REDACTED:1885— REDACTED:1885-1900 | REDACTED:2087-2102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) src-tauri/src/proxy/hyper_client.rs:440— src-tauri/src/proxy/hyper_client.rs:440-450 | src-tauri/src/proxy/hyper_client.rs:453-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3162— src-tauri/src/proxy/providers/streaming_responses.rs:3162-3173 | src-tauri/src/proxy/providers/streaming_responses.rs:3241-3251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:4458— src-tauri/src/proxy/providers/streaming_responses.rs:4458-4468 | src-tauri/src/proxy/providers/streaming_responses.rs:4482-4493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) src-tauri/src/services/session_usage.rs:1141— src-tauri/src/services/session_usage.rs:1141-1151 | src-tauri/src/services/session_usage_agy.rs:98-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 2) src-tauri/src/session_manager/providers/codex.rs:1976— src-tauri/src/session_manager/providers/codex.rs:1976-1986 | src-tauri/src/session_manager/providers/openclaw.rs:156-167 — before extracting anything, compare `src-tauri/src/session_manager/providers/codex.rs` and `src-tauri/src/session_manager/providers/openclaw.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
AC2 · Forms & labels· <Textarea> field component without a label · ×4
<Textarea> field component without a label src/components/providers/forms/LocalProxyRequestOverridesField.tsx:47— 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/providers/forms/LocalProxyRequestOverridesField.tsx:70— 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/providers/forms/OmoFormFields.tsx:701— 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/providers/forms/OmoFormFields.tsx:1321— 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.
OmoFormFields.OmoFormFields::handleFillAllRecommended (cognitive 23) src/components/providers/forms/OmoFormFields.tsx:727— OmoFormFields.OmoFormFields::handleFillAllRecommended has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 3 other methods here (OmoFormFields.OmoFormFields::handleModelChange, OmoFormFields.OmoFormFields::handleAdvancedChange, OmoFormFields.OmoFormFields::renderCustomModelRow) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
OmoFormFields.OmoFormFields::handleAdvancedChange (cognitive 20) src/components/providers/forms/OmoFormFields.tsx:583— OmoFormFields.OmoFormFields::handleAdvancedChange has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (5 pts), boolean chains 4, 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. This shape REPEATS in the file: 3 other methods here (OmoFormFields.OmoFormFields::handleModelChange, OmoFormFields.OmoFormFields::handleFillAllRecommended, OmoFormFields.OmoFormFields::renderCustomModelRow) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
OmoFormFields.OmoFormFields::renderCustomModelRow (cognitive 18) src/components/providers/forms/OmoFormFields.tsx:972— OmoFormFields.OmoFormFields::renderCustomModelRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 13, boolean chains 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. This shape REPEATS in the file: 3 other methods here (OmoFormFields.OmoFormFields::handleModelChange, OmoFormFields.OmoFormFields::handleAdvancedChange, OmoFormFields.OmoFormFields::handleFillAllRecommended) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
OmoFormFields.OmoFormFields::handleModelChange (cognitive 17) src/components/providers/forms/OmoFormFields.tsx:521— OmoFormFields.OmoFormFields::handleModelChange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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. This shape REPEATS in the file: 3 other methods here (OmoFormFields.OmoFormFields::handleAdvancedChange, OmoFormFields.OmoFormFields::handleFillAllRecommended, OmoFormFields.OmoFormFields::renderCustomModelRow) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
TooManyFunctions: cc_switch::opencode_config src-tauri/src/opencode_config.rs:13— 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: cc_switch::commands::proxy src-tauri/src/commands/proxy.rs:12— TooManyFunctions — 42 free functions. The bar is 30 free functions; this is 12 over it, 1.40× 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: cc_switch::config src-tauri/src/config.rs:22— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: cc_switch::pi_config src-tauri/src/pi_config/mod.rs:34— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (12 lines × 3) src-tauri/src/proxy/handlers.rs:364— src-tauri/src/proxy/handlers.rs:364-375 | src-tauri/src/proxy/handlers.rs:1087-1098 | src-tauri/src/proxy/handlers.rs:1416-1427 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) src-tauri/src/services/coding_plan.rs:175— src-tauri/src/services/coding_plan.rs:175-186 | src-tauri/src/services/coding_plan.rs:559-570 | src-tauri/src/services/coding_plan.rs:641-652 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) src-tauri/src/services/s3.rs:335— src-tauri/src/services/s3.rs:335-346 | src-tauri/src/services/s3.rs:422-433 | src-tauri/src/services/s3.rs:493-504 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) src-tauri/src/session_manager/providers/claude.rs:293— src-tauri/src/session_manager/providers/claude.rs:293-304 | src-tauri/src/session_manager/providers/codex.rs:2177-2188 | src-tauri/src/session_manager/providers/opencode.rs:847-858 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/provider.rs:884— src-tauri/src/provider.rs:884-892 | src-tauri/src/provider.rs:949-957 | src-tauri/src/provider.rs:984-992 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) src-tauri/src/session_manager/providers/claude.rs:142— src-tauri/src/session_manager/providers/claude.rs:142-151 | src-tauri/src/session_manager/providers/codex.rs:1976-1984 | src-tauri/src/session_manager/providers/openclaw.rs:156-165 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/session_manager/providers/opencode.rs:538— src-tauri/src/session_manager/providers/opencode.rs:538-546 | src-tauri/src/session_manager/providers/opencode.rs:759-767 | src-tauri/src/session_manager/providers/opencode.rs:828-836 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) src-tauri/src/session_manager/providers/claude.rs:153— src-tauri/src/session_manager/providers/claude.rs:153-161 | src-tauri/src/session_manager/providers/codex.rs:1995-2003 | src-tauri/src/session_manager/providers/openclaw.rs:175-183 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/commands/misc.rs:1736— src-tauri/src/commands/misc.rs:1736-1742 | src-tauri/src/commands/misc.rs:3051-3057 | src-tauri/src/commands/misc.rs:3083-3089 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) src-tauri/src/mcp/codex.rs:129— src-tauri/src/mcp/codex.rs:129-135 | src-tauri/src/mcp/codex.rs:151-157 | src-tauri/src/mcp/codex.rs:202-208 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1894— src-tauri/src/proxy/providers/codex_oauth_auth.rs:1894-1900 | src-tauri/src/proxy/providers/copilot_auth.rs:1362-1368 | src-tauri/src/proxy/providers/xai_oauth_auth.rs:757-764 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/proxy/providers/copilot_auth.rs:904— src-tauri/src/proxy/providers/copilot_auth.rs:904-910 | src-tauri/src/proxy/providers/copilot_auth.rs:1091-1097 | src-tauri/src/proxy/providers/copilot_auth.rs:1205-1211 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) src-tauri/src/mcp/agy.rs:117— src-tauri/src/mcp/agy.rs:117-122 | src-tauri/src/mcp/kimi.rs:94-99 | src-tauri/src/mcp/mcode.rs:79-84 | src-tauri/src/mcp/pi.rs:205-210 — before extracting anything, compare `src-tauri/src/mcp/agy.rs` and `src-tauri/src/mcp/kimi.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) src-tauri/src/mcp/agy.rs:182— src-tauri/src/mcp/agy.rs:182-187 | src-tauri/src/mcp/kimi.rs:157-162 | src-tauri/src/mcp/mcode.rs:137-142 | src-tauri/src/mcp/pi.rs:277-282 — before extracting anything, compare `src-tauri/src/mcp/agy.rs` and `src-tauri/src/mcp/kimi.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) src-tauri/src/proxy/providers/streaming_responses.rs:2883— src-tauri/src/proxy/providers/streaming_responses.rs:2883-2891 | src-tauri/src/proxy/providers/streaming_responses.rs:3364-3372 | src-tauri/src/proxy/providers/streaming_responses.rs:4089-4097 | src-tauri/src/proxy/providers/streaming_responses.rs:4496-4501 — 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 (6 lines × 4) src-tauri/src/app_config.rs:1031— src-tauri/src/app_config.rs:1031-1038 | src-tauri/src/proxy/providers/gemini.rs:99-104 | src-tauri/src/services/provider/mod.rs:8292-8298 | src-tauri/src/services/provider/mod.rs:8301-8306 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1907— src-tauri/src/proxy/providers/codex_oauth_auth.rs:1907-1911 | src-tauri/src/proxy/providers/copilot_auth.rs:1376-1381 | src-tauri/src/proxy/providers/xai_oauth_auth.rs:777-781 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:539— src-tauri/src/proxy/providers/transform_codex_anthropic.rs:539-543 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:575-580 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:597-602 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1412— src-tauri/src/proxy/providers/codex_oauth_auth.rs:1412-1416 | src-tauri/src/proxy/providers/copilot_auth.rs:608-612 | src-tauri/src/proxy/providers/xai_oauth_auth.rs:432-436 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) src-tauri/src/proxy/providers/claude.rs:598— src-tauri/src/proxy/providers/claude.rs:598-603 | src-tauri/src/proxy/providers/codex.rs:956-960 | src-tauri/src/proxy/providers/gemini.rs:126-131 — before extracting anything, compare `src-tauri/src/proxy/providers/claude.rs` and `src-tauri/src/proxy/providers/codex.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
AC2 · Forms & labels· <fieldset> without a <legend> · ×3
<fieldset> without a <legend> src/components/providers/forms/KimiProviderForm.tsx:507— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/components/providers/forms/McodeProviderForm.tsx:225— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> REDACTED:1601— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
Focus outline removed inline src/components/providers/forms/OmoFormFields.tsx:158— <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/usage/TablePagination.tsx:112— <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/tray-panel/TrayPanel.tsx:450— <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).
ProviderForm.ProviderFormFull::performSubmit (cyclomatic 133) src/components/providers/forms/ProviderForm.tsx:1671— ProviderForm.ProviderFormFull::performSubmit has cyclomatic complexity 133 (threshold 15). To reduce it, separate the cases: extract each independent 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: 3 other methods here (ProviderForm.ProviderFormFull, ProviderForm.ProviderFormFull::handleSubmit, ProviderForm.ProviderFormFull::handlePresetChange) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ProviderForm.ProviderFormFull::handleSubmit (cyclomatic 84) src/components/providers/forms/ProviderForm.tsx:1276— ProviderForm.ProviderFormFull::handleSubmit 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. This shape REPEATS in the file: 3 other methods here (ProviderForm.ProviderFormFull, ProviderForm.ProviderFormFull::performSubmit, ProviderForm.ProviderFormFull::handlePresetChange) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ProviderForm.ProviderFormFull::handlePresetChange (cyclomatic 25) src/components/providers/forms/ProviderForm.tsx:2165— ProviderForm.ProviderFormFull::handlePresetChange 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. This shape REPEATS in the file: 3 other methods here (ProviderForm.ProviderFormFull, ProviderForm.ProviderFormFull::handleSubmit, ProviderForm.ProviderFormFull::performSubmit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
Database::apply_schema_migrations_on_conn (cyclomatic 35) src-tauri/src/database/schema.rs:451— Database::apply_schema_migrations_on_conn 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.
Database::get_daily_trends (cyclomatic 21) REDACTED:1274— Database::get_daily_trends 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.
Database::dump_sql (cyclomatic 16) REDACTED:709— Database::dump_sql 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.
CodexOAuthManager::adopt_account_refresh_token_under_lock (cyclomatic 26) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1256— CodexOAuthManager::adopt_account_refresh_token_under_lock 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.
CodexOAuthManager::add_account_internal (cyclomatic 19) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1697— CodexOAuthManager::add_account_internal 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.
CodexOAuthManager::resolve_valid_cached_token_under_lock (cyclomatic 16) src-tauri/src/proxy/providers/codex_oauth_auth.rs:900— CodexOAuthManager::resolve_valid_cached_token_under_lock 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.
BufferedCitationTextState::render_message_part (cyclomatic 26) src-tauri/src/proxy/providers/streaming_responses.rs:1653— BufferedCitationTextState::render_message_part 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.
BufferedCitationTextState::merge_part_indices (cyclomatic 24) src-tauri/src/proxy/providers/streaming_responses.rs:870— BufferedCitationTextState::merge_part_indices 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.
BufferedCitationTextState::finish_unkeyed_text (cyclomatic 18) src-tauri/src/proxy/providers/streaming_responses.rs:1116— BufferedCitationTextState::finish_unkeyed_text has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
App.App::handleDuplicateProvider (cyclomatic 25) src/App.tsx:1066— App.App::handleDuplicateProvider 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. This shape REPEATS in the file: 3 other methods here (App.App, App.App::renderAppPageHeader, App.App::renderProviderList) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
App.App::renderAppPageHeader (cyclomatic 18) src/App.tsx:1346— App.App::renderAppPageHeader has cyclomatic complexity 18 (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. This shape REPEATS in the file: 3 other methods here (App.App, App.App::handleDuplicateProvider, App.App::renderProviderList) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
App.App::renderProviderList (cyclomatic 16) src/App.tsx:1479— App.App::renderProviderList 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: 3 other methods here (App.App, App.App::handleDuplicateProvider, App.App::renderAppPageHeader) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
RequestForwarder::forward (cognitive 384) src-tauri/src/proxy/forwarder.rs:1374— RequestForwarder::forward has cognitive complexity 384 (threshold 15). Drivers by points: if/else 173 (283 pts), boolean chains 48, match/switch 14 (41 pts), loops 6 (12 pts) (nesting depth added 143). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestForwarder::forward_with_retry_inner (cognitive 131) src-tauri/src/proxy/forwarder.rs:781— RequestForwarder::forward_with_retry_inner has cognitive complexity 131 (threshold 15). Drivers by points: if/else 30 (100 pts), match/switch 6 (26 pts), boolean chains 4, loops 1 (nesting depth added 90). 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.
RequestForwarder::validate_responses_stream_start (cognitive 25) src-tauri/src/proxy/forwarder.rs:2964— RequestForwarder::validate_responses_stream_start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), 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.
ProviderForm.ProviderFormFull::performSubmit (cognitive 163) src/components/providers/forms/ProviderForm.tsx:1671— ProviderForm.ProviderFormFull::performSubmit has cognitive complexity 163 (threshold 15). Drivers by points: ternaries 36 (65 pts), if/else 36 (55 pts), boolean chains 39, error handling 2 (4 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent 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: 3 other methods here (ProviderForm.ProviderFormFull, ProviderForm.ProviderFormFull::handleSubmit, ProviderForm.ProviderFormFull::handlePresetChange) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ProviderForm.ProviderFormFull::handleSubmit (cognitive 119) src/components/providers/forms/ProviderForm.tsx:1276— ProviderForm.ProviderFormFull::handleSubmit has cognitive complexity 119 (threshold 15). Drivers by points: if/else 47 (81 pts), boolean chains 25, ternaries 4 (11 pts), error handling 1 (2 pts) (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. This shape REPEATS in the file: 3 other methods here (ProviderForm.ProviderFormFull, ProviderForm.ProviderFormFull::performSubmit, ProviderForm.ProviderFormFull::handlePresetChange) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ProviderForm.ProviderFormFull::handlePresetChange (cognitive 39) src/components/providers/forms/ProviderForm.tsx:2165— ProviderForm.ProviderFormFull::handlePresetChange has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 9 (17 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. This shape REPEATS in the file: 3 other methods here (ProviderForm.ProviderFormFull, ProviderForm.ProviderFormFull::handleSubmit, ProviderForm.ProviderFormFull::performSubmit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
BufferedCitationTextState::render_message_part (cognitive 42) src-tauri/src/proxy/providers/streaming_responses.rs:1653— BufferedCitationTextState::render_message_part has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 5 (13 pts), boolean chains 4, match/switch 2 (3 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.
BufferedCitationTextState::merge_part_indices (cognitive 30) src-tauri/src/proxy/providers/streaming_responses.rs:870— BufferedCitationTextState::merge_part_indices has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
BufferedCitationTextState::finish_unkeyed_text (cognitive 28) src-tauri/src/proxy/providers/streaming_responses.rs:1116— BufferedCitationTextState::finish_unkeyed_text has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6 (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.
CodexOAuthManager::adopt_account_refresh_token_under_lock (cognitive 37) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1256— CodexOAuthManager::adopt_account_refresh_token_under_lock has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (31 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.
CodexOAuthManager::add_account_internal (cognitive 24) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1697— CodexOAuthManager::add_account_internal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CodexOAuthManager::resolve_valid_cached_token_under_lock (cognitive 19) src-tauri/src/proxy/providers/codex_oauth_auth.rs:900— CodexOAuthManager::resolve_valid_cached_token_under_lock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ChatToResponsesState::finalize_tools (cognitive 29) src-tauri/src/proxy/providers/streaming_codex_chat.rs:566— ChatToResponsesState::finalize_tools has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatToResponsesState::handle_chat_chunk (cognitive 21) src-tauri/src/proxy/providers/streaming_codex_chat.rs:106— ChatToResponsesState::handle_chat_chunk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatToResponsesState::push_tool_call_delta (cognitive 17) src-tauri/src/proxy/providers/streaming_codex_chat.rs:293— ChatToResponsesState::push_tool_call_delta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFields: AppSettings src-tauri/src/settings.rs:407— TooManyFields — 63 stored fields beside 4 methods. The bar is 30 stored fields; this is 33 over it, 2.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: TrayTexts src-tauri/src/tray.rs:85— TooManyFields — 52 stored fields beside 2 methods. The bar is 30 stored fields; this is 22 over it, 1.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: DeepLinkImportRequest src-tauri/src/deeplink/mod.rs:92— 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· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (6 members, 50+ identical tokens) src-tauri/src/proxy/handlers.rs:314— src-tauri/src/proxy/handlers.rs:314-423 | src-tauri/src/proxy/handlers.rs:919-992 | src-tauri/src/proxy/handlers.rs:1038-1178 | src-tauri/src/proxy/handlers.rs:1285-1348 | src-tauri/src/proxy/handlers.rs:1370-1493 | src-tauri/src/proxy/handlers.rs:2500-2580 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src-tauri/src/services/mcp.rs:570— src-tauri/src/services/mcp.rs:570-605 | src-tauri/src/services/mcp.rs:608-643 | src-tauri/src/services/mcp.rs:646-681 | src-tauri/src/services/mcp.rs:684-707 | src-tauri/src/services/mcp.rs:710-745 | src-tauri/src/services/mcp.rs:748-783 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) REDACTED:950— REDACTED:950-1066 | REDACTED:1115-1271 | REDACTED:1281-1613 | REDACTED:1624-1707 | REDACTED:1717-1900 | REDACTED:1910-2102 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (18 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:2972— src-tauri/src/proxy/providers/streaming_responses.rs:2972-2989 | src-tauri/src/proxy/providers/streaming_responses.rs:4217-4234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:840— src-tauri/src/proxy/providers/transform_codex_anthropic.rs:840-857 | src-tauri/src/proxy/providers/transform_responses.rs:190-207 — before extracting anything, compare `src-tauri/src/proxy/providers/transform_codex_anthropic.rs` and `src-tauri/src/proxy/providers/transform_responses.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) src-tauri/src/proxy/providers/transform_codex_chat.rs:853— src-tauri/src/proxy/providers/transform_codex_chat.rs:853-870 | src-tauri/src/proxy/providers/transform_codex_chat.rs:894-911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) src-tauri/src/commands/s3_sync.rs:138— src-tauri/src/commands/s3_sync.rs:138-154 | src-tauri/src/commands/webdav_sync.rs:146-162 — before extracting anything, compare `src-tauri/src/commands/s3_sync.rs` and `src-tauri/src/commands/webdav_sync.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) src-tauri/src/proxy/handlers.rs:956— src-tauri/src/proxy/handlers.rs:956-972 | src-tauri/src/proxy/handlers.rs:1313-1329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) src-tauri/src/proxy/providers/codex.rs:29— src-tauri/src/proxy/providers/codex.rs:29-45 | src-tauri/src/proxy/providers/codex.rs:173-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 3) src-tauri/src/proxy/handlers.rs:677— src-tauri/src/proxy/handlers.rs:677-690 | src-tauri/src/proxy/handlers.rs:1781-1794 | src-tauri/src/proxy/handlers.rs:2154-2167 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) src-tauri/src/proxy/providers/streaming_responses.rs:2882— src-tauri/src/proxy/providers/streaming_responses.rs:2882-2895 | src-tauri/src/proxy/providers/streaming_responses.rs:3363-3376 | src-tauri/src/proxy/providers/streaming_responses.rs:4088-4101 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) src-tauri/src/mcp/codex.rs:239— src-tauri/src/mcp/codex.rs:239-252 | src-tauri/src/mcp/hermes.rs:303-316 | src-tauri/src/mcp/opencode.rs:247-260 — before extracting anything, compare `src-tauri/src/mcp/hermes.rs` and `src-tauri/src/mcp/opencode.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 2) src-tauri/src/proxy/handlers.rs:961— src-tauri/src/proxy/handlers.rs:961-973 | src-tauri/src/proxy/handlers.rs:2548-2561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) src-tauri/src/proxy/handlers.rs:1220— src-tauri/src/proxy/handlers.rs:1220-1233 | src-tauri/src/proxy/handlers.rs:1520-1532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:2848— src-tauri/src/proxy/providers/streaming_responses.rs:2848-2861 | src-tauri/src/proxy/providers/streaming_responses.rs:4639-4651 — both copies are in the same file, so extract the block into 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 × 3) src-tauri/src/services/provider/mod.rs:8440— src-tauri/src/services/provider/mod.rs:8440-8447 | src-tauri/src/services/provider/mod.rs:8465-8472 | src-tauri/src/services/provider/mod.rs:8489-8496 — 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/proxy/providers/codex_oauth_auth.rs:2021— src-tauri/src/proxy/providers/codex_oauth_auth.rs:2021-2028 | src-tauri/src/proxy/providers/copilot_auth.rs:1447-1454 | src-tauri/src/proxy/providers/xai_oauth_auth.rs:817-824 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/session_manager/providers/opencode_blocks.rs:84— src-tauri/src/session_manager/providers/opencode_blocks.rs:84-91 | src-tauri/src/session_manager/providers/pi_blocks.rs:141-148 | src-tauri/src/session_manager/providers/pi_blocks.rs:327-334 — 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/deeplink/codex_link.rs:258— src-tauri/src/deeplink/codex_link.rs:258-263 | src-tauri/src/deeplink/grok_link.rs:195-200 | src-tauri/src/live/project/codex.rs:226-231 — 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/proxy/providers/transform_codex_responses_namespace.rs:121— src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:121-126 | src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:131-136 | src-tauri/src/proxy/providers/transform_codex_responses_namespace.rs:182-187 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) src-tauri/src/deeplink/provider.rs:1054— src-tauri/src/deeplink/provider.rs:1054-1059 | src-tauri/src/deeplink/provider.rs:1143-1148 | src-tauri/src/deeplink/provider.rs:1206-1211 — 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 (35 lines × 2 locations) src/components/UsageScriptModal.tsx:1201— src/components/UsageScriptModal.tsx:1201 · src/components/UsageScriptModal.tsx:1283 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (35 lines × 2 locations) src/components/UsageScriptModal.tsx:1322— src/components/UsageScriptModal.tsx:1322 · src/components/UsageScriptModal.tsx:1415 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (35 lines × 2 locations) src/components/providers/forms/OpenCodeFormFields.tsx:969— src/components/providers/forms/OpenCodeFormFields.tsx:969 · src/components/providers/forms/OpenCodeFormFields.tsx:1057 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (34 lines × 2 locations) src/components/settings/WebdavSyncSection.tsx:1529— src/components/settings/WebdavSyncSection.tsx:1529 · src/components/settings/WebdavSyncSection.tsx:1690 — both copies are in the same file, so extract the block into 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 locations) src/components/universal/UniversalProviderFormModal.tsx:191— src/components/universal/UniversalProviderFormModal.tsx:191 · src/components/universal/UniversalProviderFormModal.tsx:250 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (34 lines × 2 locations) src/config/codexProviderPresets.ts:3209— src/config/codexProviderPresets.ts:3209 · src/config/codexProviderPresets.ts:3259 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (33 lines × 2 locations) src/components/providers/forms/ClaudeDesktopProviderForm.tsx:705— src/components/providers/forms/ClaudeDesktopProviderForm.tsx:705 · src/components/providers/forms/ProviderForm.tsx:1480 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (33 lines × 2 locations) src/components/providers/forms/ClaudeFormFields.tsx:396— src/components/providers/forms/ClaudeFormFields.tsx:396 · src/components/providers/forms/ClaudeFormFields.tsx:432 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (33 lines × 2 locations) src/components/settings/WebdavSyncSection.tsx:505— src/components/settings/WebdavSyncSection.tsx:505 · src/components/settings/WebdavSyncSection.tsx:724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
RequestForwarder::forward (cyclomatic 205) src-tauri/src/proxy/forwarder.rs:1374— RequestForwarder::forward has cyclomatic complexity 205 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RequestForwarder::forward_with_retry_inner (cyclomatic 39) src-tauri/src/proxy/forwarder.rs:781— RequestForwarder::forward_with_retry_inner has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageScriptModal.UsageScriptModal::handleTest (cyclomatic 32) src/components/UsageScriptModal.tsx:560— UsageScriptModal.UsageScriptModal::handleTest 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. This shape REPEATS in the file: 2 other methods here (UsageScriptModal.UsageScriptModal, UsageScriptModal.UsageScriptModal::handleUsePreset) 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.
UsageScriptModal.UsageScriptModal::handleUsePreset (cyclomatic 18) src/components/UsageScriptModal.tsx:787— UsageScriptModal.UsageScriptModal::handleUsePreset has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (UsageScriptModal.UsageScriptModal, UsageScriptModal.UsageScriptModal::handleTest) 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.
CodexConfigPatch::write_route (cyclomatic 24) src-tauri/src/live/project/codex.rs:706— CodexConfigPatch::write_route 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.
CodexConfigPatch::apply_to (cyclomatic 19) src-tauri/src/live/project/codex.rs:605— CodexConfigPatch::apply_to 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.
OmoFormFields.OmoFormFields::renderCustomModelRow (cyclomatic 20) src/components/providers/forms/OmoFormFields.tsx:972— OmoFormFields.OmoFormFields::renderCustomModelRow 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. This shape REPEATS in the file: one other method here (OmoFormFields.OmoFormFields::handleFillAllRecommended) 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.
OmoFormFields.OmoFormFields::handleFillAllRecommended (cyclomatic 17) src/components/providers/forms/OmoFormFields.tsx:727— OmoFormFields.OmoFormFields::handleFillAllRecommended 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. This shape REPEATS in the file: one other method here (OmoFormFields.OmoFormFields::renderCustomModelRow) 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.
TranscriptBuilder::push_assistant (cyclomatic 17) src-tauri/src/session_manager/providers/claude.rs:566— TranscriptBuilder::push_assistant 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.
TranscriptBuilder::tool_result_block (cyclomatic 17) src-tauri/src/session_manager/providers/claude.rs:786— TranscriptBuilder::tool_result_block has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageScriptModal.UsageScriptModal::handleTest (cognitive 48) src/components/UsageScriptModal.tsx:560— UsageScriptModal.UsageScriptModal::handleTest has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 12 (15 pts), boolean chains 9, error handling 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. This shape REPEATS in the file: 2 other methods here (UsageScriptModal.UsageScriptModal, UsageScriptModal.UsageScriptModal::handleUsePreset) 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.
UsageScriptModal.UsageScriptModal::handleUsePreset (cognitive 29) src/components/UsageScriptModal.tsx:787— UsageScriptModal.UsageScriptModal::handleUsePreset has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 8 (9 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. This shape REPEATS in the file: 2 other methods here (UsageScriptModal.UsageScriptModal, UsageScriptModal.UsageScriptModal::handleTest) 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.
ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleSubmit (cognitive 45) src/components/providers/forms/ClaudeDesktopProviderForm.tsx:672— ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleSubmit has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 8 (15 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (ClaudeDesktopProviderForm.ClaudeDesktopProviderForm, ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleFetchManagedModels) 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.
ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleFetchManagedModels (cognitive 19) src/components/providers/forms/ClaudeDesktopProviderForm.tsx:565— ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleFetchManagedModels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, 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. This shape REPEATS in the file: 2 other methods here (ClaudeDesktopProviderForm.ClaudeDesktopProviderForm, ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleSubmit) 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.
CodexAdapter::extract_base_url (cognitive 30) src-tauri/src/proxy/providers/codex.rs:1025— CodexAdapter::extract_base_url has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (30 pts) (nesting depth added 16). 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.
CodexAdapter::extract_key (cognitive 18) src-tauri/src/proxy/providers/codex.rs:954— CodexAdapter::extract_key has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 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.
CodexConfigPatch::apply_to (cognitive 27) src-tauri/src/live/project/codex.rs:605— CodexConfigPatch::apply_to has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (9 pts), boolean chains 4 (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.
CodexConfigPatch::write_route (cognitive 27) src-tauri/src/live/project/codex.rs:706— CodexConfigPatch::write_route has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, loops 2, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpService::upsert_server (cognitive 27) src-tauri/src/services/mcp.rs:29— McpService::upsert_server has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, boolean chains 11. 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.
McpService::delete_server (cognitive 27) src-tauri/src/services/mcp.rs:133— McpService::delete_server has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (27 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.
MultiAppConfig::load (cognitive 18) src-tauri/src/app_config.rs:681— MultiAppConfig::load has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MultiAppConfig::migrate_mcp_to_unified (cognitive 17) src-tauri/src/app_config.rs:965— MultiAppConfig::migrate_mcp_to_unified has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedSkillsPanel.UnifiedSkillsPanel::renderInstalledBody (cognitive 18) src/components/skills/UnifiedSkillsPanel.tsx:1058— UnifiedSkillsPanel.UnifiedSkillsPanel::renderInstalledBody has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (UnifiedSkillsPanel.UnifiedSkillsPanel, UnifiedSkillsPanel.UnifiedSkillsPanel::uninstallIds) 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.
UnifiedSkillsPanel.UnifiedSkillsPanel::uninstallIds (cognitive 16) src/components/skills/UnifiedSkillsPanel.tsx:534— UnifiedSkillsPanel.UnifiedSkillsPanel::uninstallIds has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 1 (2 pts), boolean chains 1, 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. This shape REPEATS in the file: 2 other methods here (UnifiedSkillsPanel.UnifiedSkillsPanel, UnifiedSkillsPanel.UnifiedSkillsPanel::renderInstalledBody) 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.
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/proxy/handlers.rs:547— src-tauri/src/proxy/handlers.rs:547-859 | src-tauri/src/proxy/handlers.rs:1551-1687 | src-tauri/src/proxy/handlers.rs:1696-1919 | src-tauri/src/proxy/handlers.rs:1936-2083 | src-tauri/src/proxy/handlers.rs:2183-2247 — 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/proxy/providers/codex_chat_history.rs:375— src-tauri/src/proxy/providers/codex_chat_history.rs:375-396 | src-tauri/src/proxy/providers/codex_compaction.rs:339-377 | src-tauri/src/proxy/providers/responses_late_arguments.rs:200-244 | src-tauri/src/proxy/providers/streaming_gemini.rs:243-574 | src-tauri/src/proxy/providers/transform_codex_responses_xai_sanitize.rs:1069-1102 — 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.
Duplicated block (25 lines × 2) src-tauri/src/proxy/http_client.rs:110— src-tauri/src/proxy/http_client.rs:110-134 | src-tauri/src/proxy/http_client.rs:154-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) src-tauri/src/services/s3.rs:336— src-tauri/src/services/s3.rs:336-360 | src-tauri/src/services/s3.rs:494-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) src-tauri/src/claude_desktop_config.rs:1042— src-tauri/src/claude_desktop_config.rs:1042-1065 | src-tauri/src/proxy/providers/claude.rs:249-272 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (24 lines × 2) src-tauri/src/proxy/providers/streaming_gemini.rs:366— src-tauri/src/proxy/providers/streaming_gemini.rs:366-389 | src-tauri/src/proxy/providers/streaming_gemini.rs:428-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) src-tauri/src/commands/misc.rs:5505— src-tauri/src/commands/misc.rs:5505-5526 | src-tauri/src/session_manager/terminal/mod.rs:124-145 — before extracting anything, compare `src-tauri/src/commands/misc.rs` and `src-tauri/src/session_manager/terminal/mod.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.
Duplicated block (22 lines × 2) src-tauri/src/mcp/claude.rs:98— src-tauri/src/mcp/claude.rs:98-119 | src-tauri/src/mcp/gemini.rs:94-115 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/gemini.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–22 lines × 2) src-tauri/src/commands/misc.rs:5708— src-tauri/src/commands/misc.rs:5708-5729 | src-tauri/src/commands/misc.rs:6082-6099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–22 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3667— src-tauri/src/proxy/providers/streaming_responses.rs:3667-3688 | src-tauri/src/proxy/providers/streaming_responses.rs:4258-4275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 3) src-tauri/src/proxy/providers/claude.rs:737— src-tauri/src/proxy/providers/claude.rs:737-751 | src-tauri/src/proxy/providers/codex.rs:1041-1056 | src-tauri/src/proxy/providers/gemini.rs:174-188 — before extracting anything, compare `src-tauri/src/proxy/providers/claude.rs` and `src-tauri/src/proxy/providers/codex.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 3) src-tauri/src/services/coding_plan.rs:181— src-tauri/src/services/coding_plan.rs:181-196 | src-tauri/src/services/coding_plan.rs:565-580 | src-tauri/src/services/coding_plan.rs:911-925 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–15 lines × 3) src-tauri/src/proxy/handlers.rs:1894— src-tauri/src/proxy/handlers.rs:1894-1908 | src-tauri/src/proxy/handlers.rs:2059-2072 | src-tauri/src/proxy/handlers.rs:2224-2238 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–15 lines × 3) src-tauri/src/session_manager/providers/claude.rs:256— src-tauri/src/session_manager/providers/claude.rs:256-270 | src-tauri/src/session_manager/providers/codex.rs:2067-2081 | src-tauri/src/session_manager/providers/openclaw.rs:243-256 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) src-tauri/src/commands/misc.rs:5755— src-tauri/src/commands/misc.rs:5755-5769 | src-tauri/src/commands/misc.rs:6122-6135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) src-tauri/src/proxy/providers/streaming_codex_chat.rs:389— src-tauri/src/proxy/providers/streaming_codex_chat.rs:389-403 | src-tauri/src/proxy/providers/streaming_codex_chat.rs:625-638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) src-tauri/src/jsonc_document.rs:204— src-tauri/src/jsonc_document.rs:204-215 | src-tauri/src/jsonc_document.rs:245-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) src-tauri/src/proxy/handlers.rs:681— src-tauri/src/proxy/handlers.rs:681-695 | src-tauri/src/proxy/handlers.rs:1785-1796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) src-tauri/src/services/s3_auto_sync.rs:111— src-tauri/src/services/s3_auto_sync.rs:111-122 | src-tauri/src/services/webdav_auto_sync.rs:113-126 — before extracting anything, compare `src-tauri/src/services/s3_auto_sync.rs` and `src-tauri/src/services/webdav_auto_sync.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–14 lines × 2) src-tauri/src/services/skill.rs:4006— src-tauri/src/services/skill.rs:4006-4019 | src-tauri/src/services/skill.rs:4558-4569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) src-tauri/src/codex_config.rs:439— src-tauri/src/codex_config.rs:439-450 | src-tauri/src/codex_config.rs:467-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) src-tauri/src/proxy/handlers.rs:1801— src-tauri/src/proxy/handlers.rs:1801-1812 | src-tauri/src/proxy/handlers.rs:1961-1973 — both copies are in the same file, so extract the block into 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–12 lines × 2) src-tauri/src/services/skill.rs:944— src-tauri/src/services/skill.rs:944-953 | src-tauri/src/services/skill.rs:1600-1611 — both copies are in the same file, so extract the block into 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–12 lines × 2) src-tauri/src/session_manager/providers/claude.rs:199— src-tauri/src/session_manager/providers/claude.rs:199-210 | src-tauri/src/session_manager/providers/codex.rs:2035-2044 — before extracting anything, compare `src-tauri/src/session_manager/providers/claude.rs` and `src-tauri/src/session_manager/providers/codex.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) src-tauri/src/commands/misc.rs:2858— src-tauri/src/commands/misc.rs:2858-2868 | src-tauri/src/commands/misc.rs:3254-3263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) src-tauri/src/proxy/providers/codex_oauth_auth.rs:1907— src-tauri/src/proxy/providers/codex_oauth_auth.rs:1907-1916 | src-tauri/src/proxy/providers/copilot_auth.rs:1376-1386 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–11 lines × 2) src-tauri/src/commands/xai_oauth.rs:33— src-tauri/src/commands/xai_oauth.rs:33-43 | src-tauri/src/commands/xai_oauth.rs:95-103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) src-tauri/src/services/skill.rs:2288— src-tauri/src/services/skill.rs:2288-2296 | src-tauri/src/services/skill.rs:4849-4859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) src-tauri/src/codex_history_migration.rs:675— src-tauri/src/codex_history_migration.rs:675-682 | src-tauri/src/codex_history_migration.rs:1201-1210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) src-tauri/src/deeplink/provider.rs:830— src-tauri/src/deeplink/provider.rs:830-839 | src-tauri/src/deeplink/provider.rs:922-929 — both copies are in the same file, so extract the block into 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/commands/workspace.rs:69— src-tauri/src/commands/workspace.rs:69-78 | src-tauri/src/commands/workspace.rs:206-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) src-tauri/src/proxy/forwarder.rs:3198— src-tauri/src/proxy/forwarder.rs:3198-3206 | src-tauri/src/proxy/forwarder.rs:3271-3280 — both copies are in the same file, so extract the block into 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/kimi_config.rs:369— src-tauri/src/kimi_config.rs:369-376 | src-tauri/src/kimi_config.rs:384-392 — both copies are in the same file, so extract the block into 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/services/s3.rs:461— src-tauri/src/services/s3.rs:461-469 | src-tauri/src/services/webdav.rs:289-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 2) src-tauri/src/commands/misc.rs:3050— src-tauri/src/commands/misc.rs:3050-3056 | src-tauri/src/commands/misc.rs:3081-3088 — both copies are in the same file, so extract the block into 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/session_manager/providers/claude.rs:175— src-tauri/src/session_manager/providers/claude.rs:175-181 | src-tauri/src/session_manager/providers/claude.rs:223-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 4) src-tauri/src/proxy/handlers.rs:610— src-tauri/src/proxy/handlers.rs:610-618 | src-tauri/src/proxy/handlers.rs:1713-1720 | src-tauri/src/proxy/handlers.rs:2093-2099 | src-tauri/src/proxy/response_processor.rs:511-519 — before extracting anything, compare `src-tauri/src/proxy/handlers.rs` and `src-tauri/src/proxy/response_processor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) src-tauri/src/mcp/agy.rs:163— src-tauri/src/mcp/agy.rs:163-169 | src-tauri/src/mcp/kimi.rs:139-145 | src-tauri/src/mcp/mcode.rs:124-130 | src-tauri/src/mcp/pi.rs:250-256 — before extracting anything, compare `src-tauri/src/mcp/agy.rs` and `src-tauri/src/mcp/kimi.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 2) src-tauri/src/commands/misc.rs:218— src-tauri/src/commands/misc.rs:218-223 | src-tauri/src/commands/misc.rs:540-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) src-tauri/src/mcp/mcode.rs:56— src-tauri/src/mcp/mcode.rs:56-61 | src-tauri/src/mcp/pi.rs:169-175 — before extracting anything, compare `src-tauri/src/mcp/mcode.rs` and `src-tauri/src/mcp/pi.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) src-tauri/src/mcp/kimi.rs:104— src-tauri/src/mcp/kimi.rs:104-108 | src-tauri/src/mcp/mcode.rs:89-93 | src-tauri/src/mcp/omp.rs:220-224 | src-tauri/src/mcp/pi.rs:215-219 — before extracting anything, compare `src-tauri/src/mcp/kimi.rs` and `src-tauri/src/mcp/mcode.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) src-tauri/src/mcp/agy.rs:12— src-tauri/src/mcp/agy.rs:12-16 | src-tauri/src/mcp/kimi.rs:20-24 | src-tauri/src/mcp/mcode.rs:12-16 | src-tauri/src/mcp/pi.rs:58-62 — before extracting anything, compare `src-tauri/src/mcp/agy.rs` and `src-tauri/src/mcp/kimi.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
R10 · Code Duplication· Duplicated block with local edits (44 matched lines × 2 locations) · ×2
Duplicated block with local edits (44 matched lines × 2 locations) src/components/providers/forms/GeminiConfigSections.tsx:18— src/components/providers/forms/GeminiConfigSections.tsx:18 · src/components/providers/forms/GeminiConfigSections.tsx:97 — the two spans are one implementation copied and then locally edited — 235 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 with local edits (44 matched lines × 2 locations) src/components/providers/forms/OpenClawFormFields.tsx:332— src/components/providers/forms/OpenClawFormFields.tsx:332 · REDACTED:1717 — the two spans are one implementation copied and then locally edited — 192 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 (37 matched lines × 2 locations) · ×2
Duplicated block with local edits (37 matched lines × 2 locations) src/components/providers/forms/KimiProviderForm.tsx:233— src/components/providers/forms/KimiProviderForm.tsx:233 · src/components/providers/forms/OpenCodeFormFields.tsx:231 — the two spans are one implementation copied and then locally edited — 217 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (37 matched lines × 2 locations) src/components/providers/forms/OpenCodeFormFields.tsx:243— src/components/providers/forms/OpenCodeFormFields.tsx:243 · REDACTED:1160 — the two spans are one implementation copied and then locally edited — 192 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 (31 lines × 2 locations) src/components/JsonEditor.tsx:154— src/components/JsonEditor.tsx:154 · src/components/JsonEditor.tsx:224 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (31 lines × 2 locations) src/components/settings/WebdavSyncSection.tsx:546— src/components/settings/WebdavSyncSection.tsx:546 · src/components/settings/WebdavSyncSection.tsx:763 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×2
Recursive walk over a caller-supplied document has no depth cap REDACTED:119— `applyTemplateValues` is exported, takes a document from its caller (line 90) and hands it to `traverse`, which calls itself at line 119 (`traverse`) with a piece of `obj` (and at line 124) — and nowhere in `traverse` 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 `traverse` 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/query/sessions.ts:37— `stableKey` is exported and takes `value: unknown` from its caller, and it calls itself at line 37 (`stableKey`) with a piece of `value` (and at line 42) — and nowhere in `stableKey` 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 `stableKey` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×2
Untrusted text written into markup unescaped REDACTED:89— `iconSvg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped src/components/sessions/reader/SessionMarkdown.tsx:343— `raw` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
AC3 · Page structure· Heading level jumps from h2 to h4 · ×1
Heading level jumps from h2 to h4 deplink.html:404— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×1
Focus outline removed in CSS without a :focus replacement src/index.css:509— `html:not([data-keyboard]) :is(*:not(input, textarea, select, [contenteditable="true"])):focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 240 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
UnifiedSkillsPanel.UnifiedSkillsPanel (cyclomatic 216) src/components/skills/UnifiedSkillsPanel.tsx:120— UnifiedSkillsPanel.UnifiedSkillsPanel has cyclomatic complexity 216 (threshold 15). Of this number, 54 points are the body's own statements and 162 belong to 52 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.
CodexFormFields.CodexFormFields (cyclomatic 209) src/components/providers/forms/CodexFormFields.tsx:535— CodexFormFields.CodexFormFields has cyclomatic complexity 209 (threshold 15). Of this number, 122 points are the body's own statements and 87 belong to 34 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.
ProviderForm.ProviderFormFull (cyclomatic 170) src/components/providers/forms/ProviderForm.tsx:346— ProviderForm.ProviderFormFull has cyclomatic complexity 170 (threshold 15). To reduce it, separate the cases: extract each independent 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: 3 other methods here (ProviderForm.ProviderFormFull::handleSubmit, ProviderForm.ProviderFormFull::performSubmit, ProviderForm.ProviderFormFull::handlePresetChange) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
ClaudeFormFields.ClaudeFormFields (cyclomatic 128) src/components/providers/forms/ClaudeFormFields.tsx:184— ClaudeFormFields.ClaudeFormFields has cyclomatic complexity 128 (threshold 15). Of this number, 88 points are the body's own statements and 40 belong to 22 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.
SessionManagerPage.SessionManagerPage (cyclomatic 127) src/components/sessions/SessionManagerPage.tsx:136— SessionManagerPage.SessionManagerPage has cyclomatic complexity 127 (threshold 15). Of this number, 38 points are the body's own statements and 89 belong to 42 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.
UnifiedMcpPanel.UnifiedMcpPanel (cyclomatic 124) src/components/mcp/UnifiedMcpPanel.tsx:128— UnifiedMcpPanel.UnifiedMcpPanel has cyclomatic complexity 124 (threshold 15). Of this number, 40 points are the body's own statements and 84 belong to 27 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.
WebdavSyncSection.WebdavSyncSection (cyclomatic 121) src/components/settings/WebdavSyncSection.tsx:234— WebdavSyncSection.WebdavSyncSection has cyclomatic complexity 121 (threshold 15). Of this number, 45 points are the body's own statements and 76 belong to 33 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.
AddProviderDialog.AddProviderDialog (cyclomatic 118) src/components/providers/AddProviderDialog.tsx:58— AddProviderDialog.AddProviderDialog has cyclomatic complexity 118 (threshold 15). Of this number, 30 points are the body's own statements and 88 belong to 13 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.
McpFormModal.McpFormModal (cyclomatic 103) src/components/mcp/McpFormModal.tsx:117— McpFormModal.McpFormModal has cyclomatic complexity 103 (threshold 15). Of this number, 40 points are the body's own statements and 63 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.
TrayPanel.TrayPanel (cyclomatic 103) src/tray-panel/TrayPanel.tsx:515— TrayPanel.TrayPanel has cyclomatic complexity 103 (threshold 15). Most of this is not in the body itself: 13 of the 103 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 649, a function literal at line 873, switchTo, …). 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.
SessionReader.SessionReader (cyclomatic 96) src/components/sessions/reader/SessionReader.tsx:155— SessionReader.SessionReader has cyclomatic complexity 96 (threshold 15). Of this number, 38 points are the body's own statements and 58 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.
PromptPanel.StandardPromptPanel (cyclomatic 93) src/components/prompts/PromptPanel.tsx:37— PromptPanel.StandardPromptPanel has cyclomatic complexity 93 (threshold 15). Of this number, 26 points are the body's own statements and 67 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.
ProviderList.ProviderList (cyclomatic 86) src/components/providers/ProviderList.tsx:103— ProviderList.ProviderList has cyclomatic complexity 86 (threshold 15). Of this number, 36 points are the body's own statements and 50 belong to 17 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.
DeepLinkImportDialog.DeepLinkImportDialog (cyclomatic 85) src/components/DeepLinkImportDialog.tsx:86— DeepLinkImportDialog.DeepLinkImportDialog has cyclomatic complexity 85 (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. This shape REPEATS in the file: one other method here (DeepLinkImportDialog.DeepLinkImportDialog::handleImport) 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.
KimiProviderForm.KimiProviderForm (cyclomatic 82) src/components/providers/forms/KimiProviderForm.tsx:103— KimiProviderForm.KimiProviderForm has cyclomatic complexity 82 (threshold 15). Of this number, 38 points are the body's own statements and 44 belong to 22 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.
ProviderCard.ProviderCard (cyclomatic 81) src/components/providers/ProviderCard.tsx:178— ProviderCard.ProviderCard has cyclomatic complexity 81 (threshold 15). Of this number, 76 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.
SkillsPage.SkillsPage (cyclomatic 78) src/components/skills/SkillsPage.tsx:157— SkillsPage.SkillsPage has cyclomatic complexity 78 (threshold 15). Of this number, 30 points are the body's own statements and 48 belong to 14 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.
PiPromptPanel.PiPromptPanel (cyclomatic 77) src/components/prompts/PiPromptPanel.tsx:54— PiPromptPanel.PiPromptPanel has cyclomatic complexity 77 (threshold 15). Of this number, 41 points are the body's own statements and 36 belong to 19 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.
UniversalProviderFormModal.UniversalProviderFormModal (cyclomatic 74) src/components/universal/UniversalProviderFormModal.tsx:30— UniversalProviderFormModal.UniversalProviderFormModal has cyclomatic complexity 74 (threshold 15). Of this number, 29 points are the body's own statements and 45 belong to 11 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.
SwitchModePanel.SwitchModePanel (cyclomatic 71) src/components/providers/mode/SwitchModePanel.tsx:101— SwitchModePanel.SwitchModePanel has cyclomatic complexity 71 (threshold 15). Of this number, 49 points are the body's own statements and 22 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.
UsageScriptModal.UsageScriptModal (cyclomatic 69) src/components/UsageScriptModal.tsx:248— UsageScriptModal.UsageScriptModal 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 shape REPEATS in the file: 2 other methods here (UsageScriptModal.UsageScriptModal::handleTest, UsageScriptModal.UsageScriptModal::handleUsePreset) 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.
CodexOAuthSection.CodexOAuthSection (cyclomatic 67) src/components/providers/forms/CodexOAuthSection.tsx:77— CodexOAuthSection.CodexOAuthSection has cyclomatic complexity 67 (threshold 15). Of this number, 53 points are the body's own statements and 14 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.
deplink.html.parseDeepLink (cyclomatic 66) deplink.html:1973— deplink.html.parseDeepLink has cyclomatic complexity 66 (threshold 15). Of this number, 47 points are the body's own statements and 19 belong to 7 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.
EditProviderDialog.EditProviderDialog (cyclomatic 63) src/components/providers/EditProviderDialog.tsx:67— EditProviderDialog.EditProviderDialog has cyclomatic complexity 63 (threshold 15). Most of this is not in the body itself: 15 of the 63 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 139, 289, 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.
deplink.html.generateLink (cyclomatic 60) deplink.html:1468— deplink.html.generateLink 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.
OpenCodeFormFields.OpenCodeFormFields (cyclomatic 59) src/components/providers/forms/OpenCodeFormFields.tsx:205— OpenCodeFormFields.OpenCodeFormFields has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 4 of the 59 points are its own statements and the rest belongs to 19 function items inside it that branch (handleModelExtraFieldKeyChange, handleExtraOptionKeyChange, a function literal at line 794, …). 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.
AppsPage.ToolRow (cyclomatic 53) src/components/apps/AppsPage.tsx:700— AppsPage.ToolRow 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.
UsageDashboard.UsageDashboard (cyclomatic 52) src/components/usage/UsageDashboard.tsx:250— UsageDashboard.UsageDashboard has cyclomatic complexity 52 (threshold 15). Of this number, 26 points are the body's own statements and 26 belong to 13 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.
turns.buildTurn (cyclomatic 49) src/components/sessions/reader/turns.ts:298— turns.buildTurn has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 10 of the 49 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 368, a function literal at line 344, blocksOf, …). 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.
SessionItem.SessionItem (cyclomatic 45) src/components/sessions/SessionItem.tsx:56— SessionItem.SessionItem has cyclomatic complexity 45 (threshold 15). Of this number, 44 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.
RequestLogTable.RequestLogTable::renderRow (cyclomatic 45) src/components/usage/RequestLogTable.tsx:368— RequestLogTable.RequestLogTable::renderRow 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.
CopilotAuthSection.CopilotAuthSection (cyclomatic 44) src/components/providers/forms/CopilotAuthSection.tsx:65— CopilotAuthSection.CopilotAuthSection has cyclomatic complexity 44 (threshold 15). Of this number, 26 points are the body's own statements and 18 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.
DailyMemoryPanel.DailyMemoryPanel (cyclomatic 44) src/components/workspace/DailyMemoryPanel.tsx:43— DailyMemoryPanel.DailyMemoryPanel has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 12 of the 44 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 153, 258, 210, …). 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.
SessionMarkdown.renderNode (cyclomatic 43) src/components/sessions/reader/SessionMarkdown.tsx:932— SessionMarkdown.renderNode has cyclomatic complexity 43 (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.
UsageDateRangePicker.UsageDateRangePicker (cyclomatic 43) src/components/usage/UsageDateRangePicker.tsx:114— UsageDateRangePicker.UsageDateRangePicker has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 5 of the 43 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 495, renderField, handleDatePick, …). 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.
presentation.buildSwitchSectionsByView (cyclomatic 42) src/components/providers/presentation.ts:189— presentation.buildSwitchSectionsByView has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 14 of the 42 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 362, a function literal at line 254, a function literal at line 478, …). 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.
presentation.buildAdditiveSections (cyclomatic 42) src/components/providers/presentation.ts:711— presentation.buildAdditiveSections 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.
XaiOAuthSection.XaiOAuthSection (cyclomatic 42) src/components/providers/forms/XaiOAuthSection.tsx:54— XaiOAuthSection.XaiOAuthSection has cyclomatic complexity 42 (threshold 15). Of this number, 31 points are the body's own statements and 11 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.
SettingsPage.SettingsPage (cyclomatic 42) src/components/settings/SettingsPage.tsx:82— SettingsPage.SettingsPage has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 4 of the 42 points are its own statements and the rest belongs to 14 function items inside it that branch (renderSection, a function literal at line 145, a function literal at line 188, …). 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.
RoutingSection.RoutingSection (cyclomatic 42) src/components/settings/sections/RoutingSection.tsx:93— RoutingSection.RoutingSection has cyclomatic complexity 42 (threshold 15). Of this number, 20 points are the body's own statements and 22 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.
ModelsDevAutoSyncPanel.AutoSyncDialog (cyclomatic 42) src/components/usage/ModelsDevAutoSyncPanel.tsx:70— ModelsDevAutoSyncPanel.AutoSyncDialog has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 10 of the 42 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 123, a function literal at line 336, a function literal at line 92, …). 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.
AppsPage.AppsPage (cyclomatic 40) src/components/apps/AppsPage.tsx:175— AppsPage.AppsPage has cyclomatic complexity 40 (threshold 15). Of this number, 16 points are the body's own statements and 24 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.
AgentsDefaultsPanel.AgentsDefaultsPanel (cyclomatic 39) src/components/openclaw/AgentsDefaultsPanel.tsx:28— AgentsDefaultsPanel.AgentsDefaultsPanel has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 13 of the 39 points are its own statements and the rest belongs to 9 function items inside it that branch (handleSave, getFallbackOptions, a function literal at line 45, …). 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.
useOmoModelSource.useOmoModelSource.omoModelBuild (cyclomatic 39) src/components/providers/forms/hooks/useOmoModelSource.ts:117— useOmoModelSource.useOmoModelSource.omoModelBuild has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PromptFormPanel.PromptFormPanel (cyclomatic 38) src/components/prompts/PromptFormPanel.tsx:53— PromptFormPanel.PromptFormPanel has cyclomatic complexity 38 (threshold 15). Of this number, 22 points are the body's own statements and 16 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.
useToolManagement.useToolManagement.executeRun (cyclomatic 37) src/components/apps/useToolManagement.ts:643— useToolManagement.useToolManagement.executeRun has cyclomatic complexity 37 (threshold 15). Of this number, 17 points are the body's own statements and 20 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.
useManagedAuth.useManagedAuth (cyclomatic 36) src/components/providers/forms/hooks/useManagedAuth.ts:22— useManagedAuth.useManagedAuth has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 169, 132, 248, …). 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.
SessionStepDetails.BlockText (cyclomatic 36) src/components/sessions/reader/SessionStepDetails.tsx:73— SessionStepDetails.BlockText has cyclomatic complexity 36 (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.
DatabaseUpgrade.DatabaseUpgrade (cyclomatic 35) src/components/DatabaseUpgrade.tsx:49— DatabaseUpgrade.DatabaseUpgrade has cyclomatic complexity 35 (threshold 15). Of this number, 28 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.
ClaudeDesktopProviderForm.ClaudeDesktopProviderForm (cyclomatic 35) src/components/providers/forms/ClaudeDesktopProviderForm.tsx:249— ClaudeDesktopProviderForm.ClaudeDesktopProviderForm has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleSubmit) 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.
PiProviderForm.PiProviderForm (cyclomatic 35) REDACTED:499— PiProviderForm.PiProviderForm has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (PiProviderForm.PiProviderForm::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.
AboutSection.AboutSection (cyclomatic 35) src/components/settings/AboutSection.tsx:48— AboutSection.AboutSection has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 134, 71, 96, …). 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.
ManagedAccountsGroup.ManagedAccountsGroup (cyclomatic 35) src/components/settings/auth/ManagedAccountsGroup.tsx:111— ManagedAccountsGroup.ManagedAccountsGroup has cyclomatic complexity 35 (threshold 15). Of this number, 27 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.
JsonEditor.JsonEditor (cyclomatic 34) src/components/JsonEditor.tsx:85— JsonEditor.JsonEditor 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 7 function items inside it that branch (a function literal at line 110, a function literal at line 147, handleFormat, …). 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.
CommonConfigEditor.CommonConfigEditor (cyclomatic 34) src/components/providers/forms/CommonConfigEditor.tsx:48— CommonConfigEditor.CommonConfigEditor has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 120, 87, 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.
ModeDialog.EnterBody (cyclomatic 34) src/components/providers/mode/ModeDialog.tsx:131— ModeDialog.EnterBody has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 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.
useProviderCategory.useProviderCategory (cyclomatic 33) src/components/providers/forms/hooks/useProviderCategory.ts:22— useProviderCategory.useProviderCategory has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 33). 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.
SessionDiff.parseDiff (cyclomatic 33) src/components/sessions/reader/SessionDiff.tsx:26— SessionDiff.parseDiff has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 4 of the 33 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 41, pushFile). 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.
ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleSubmit (cyclomatic 32) src/components/providers/forms/ClaudeDesktopProviderForm.tsx:672— ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleSubmit 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. This shape REPEATS in the file: one other method here (ClaudeDesktopProviderForm.ClaudeDesktopProviderForm) 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.
McodeProviderForm.McodeProviderForm (cyclomatic 32) src/components/providers/forms/McodeProviderForm.tsx:71— McodeProviderForm.McodeProviderForm has cyclomatic complexity 32 (threshold 15). Of this number, 25 points are the body's own statements and 7 belong to 3 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.
BackupListSection.BackupListSection (cyclomatic 32) src/components/settings/BackupListSection.tsx:63— BackupListSection.BackupListSection 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 8 function items inside it that branch (a function literal at line 310, handleRestore, handleConfirmRename, …). 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.
OpenTerminalDialog.OpenTerminalDialog (cyclomatic 30) src/components/providers/OpenTerminalDialog.tsx:113— OpenTerminalDialog.OpenTerminalDialog has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 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.
PiProviderForm.PiProviderForm::submit (cyclomatic 30) REDACTED:1311— PiProviderForm.PiProviderForm::submit 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. This shape REPEATS in the file: one other method here (PiProviderForm.PiProviderForm) 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.
ModelsDevPickerDialog.ModelsDevPickerDialog (cyclomatic 30) src/components/usage/ModelsDevPickerDialog.tsx:46— ModelsDevPickerDialog.ModelsDevPickerDialog 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 items inside it that branch (a function literal at line 92, a function literal at line 246, a function literal at line 75, …). 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.
errorUtils.translateMcpBackendError (cyclomatic 30) src/utils/errorUtils.ts:88— errorUtils.translateMcpBackendError has cyclomatic complexity 30 (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.
IconPicker.IconPicker (cyclomatic 29) src/components/IconPicker.tsx:60— IconPicker.IconPicker has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 7 function items inside it that branch (handleFileChange, handleNameConfirm, handleDeleteConfirm, …). 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.
textNormalization.scanTomlQuotes (cyclomatic 29) src/utils/textNormalization.ts:41— textNormalization.scanTomlQuotes has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 2 function items inside it that branch (scan, scan::isCloser). 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.
App.App (cyclomatic 28) src/App.tsx:161— App.App has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 3 other methods here (App.App::handleDuplicateProvider, App.App::renderAppPageHeader, App.App::renderProviderList) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
SkillsStorageSheet.SkillsStorageSheet (cyclomatic 28) src/components/skills/SkillsStorageSheet.tsx:59— SkillsStorageSheet.SkillsStorageSheet has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 9 function items inside it that branch (doMigrate, handleMove, handleResync, …). 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.
mutations.useAddProviderMutation (cyclomatic 28) src/lib/query/mutations.ts:24— mutations.useAddProviderMutation 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 4 function literals inside it that branch (lines 29, 149, 104, …). 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.
HermesFormFields.HermesFormFields (cyclomatic 27) src/components/providers/forms/HermesFormFields.tsx:85— HermesFormFields.HermesFormFields has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 210, 332, 498, …). 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.NavItem (cyclomatic 27) src/components/shell/Sidebar.tsx:531— Sidebar.NavItem has cyclomatic complexity 27 (threshold 15). Of this number, 20 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.
TokenUsage::from_claude_stream_events (cyclomatic 26) src-tauri/src/proxy/usage/parser.rs:147— TokenUsage::from_claude_stream_events 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.
FetchedModelPicker.FetchedModelPickerBody (cyclomatic 26) src/components/providers/forms/FetchedModelPicker.tsx:130— FetchedModelPicker.FetchedModelPickerBody has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 174, matches, renderRow, …). 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.
QuotaLines.QuotaLines (cyclomatic 26) src/components/quota/QuotaLines.tsx:211— QuotaLines.QuotaLines has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 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.
RequestDetailPanel.useDetailSections (cyclomatic 26) src/components/usage/RequestDetailPanel.tsx:86— RequestDetailPanel.useDetailSections 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.
useSettings.useSettings.saveSettings (cyclomatic 26) src/hooks/useSettings.ts:343— useSettings.useSettings.saveSettings 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.
PiNativePromptResources.PiPromptTemplateEditor (cyclomatic 25) src/components/prompts/PiNativePromptResources.tsx:513— PiNativePromptResources.PiPromptTemplateEditor has cyclomatic complexity 25 (threshold 15). Of this number, 22 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.
deeplinkRisk.classifyEndpoint (cyclomatic 25) REDACTED:140— deeplinkRisk.classifyEndpoint 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.
routingReason.getRoutingReason (cyclomatic 25) src/utils/routingReason.ts:16— routingReason.getRoutingReason 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.
tomlUtils.normalizeServerConfig (cyclomatic 25) src/utils/tomlUtils.ts:101— tomlUtils.normalizeServerConfig 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.
ProxyError::into_response (cyclomatic 24) src-tauri/src/proxy/error.rs:83— ProxyError::into_response has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
McpConfirmation.McpConfirmation (cyclomatic 24) src/components/deeplink/McpConfirmation.tsx:14— McpConfirmation.McpConfirmation 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 6 function items inside it that branch (a function literal at line 37, a function literal at line 21, Row, …). 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.
KimiAccountLogin.KimiAccountLogin (cyclomatic 24) src/components/providers/KimiAccountLogin.tsx:23— KimiAccountLogin.KimiAccountLogin has cyclomatic complexity 24 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProviderPresetSelector.PresetPicker (cyclomatic 24) src/components/providers/forms/ProviderPresetSelector.tsx:544— ProviderPresetSelector.PresetPicker 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.
useCodexConfigState.mapCodexCatalogModelForForm (cyclomatic 24) src/components/providers/forms/hooks/useCodexConfigState.ts:38— useCodexConfigState.mapCodexCatalogModelForForm 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.
OpenClawFormFields.OpenClawFormFields (cyclomatic 24) src/components/providers/forms/OpenClawFormFields.tsx:59— OpenClawFormFields.OpenClawFormFields 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 13 function items inside it that branch (a function literal at line 196, a function literal at line 355, a function literal at line 83, …). 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.
SessionMarkdown.collectVisibleTextPieces (cyclomatic 24) src/components/sessions/reader/SessionMarkdown.tsx:366— SessionMarkdown.collectVisibleTextPieces 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.
SessionStepDetails.SessionStepDetails (cyclomatic 24) src/components/sessions/reader/SessionStepDetails.tsx:350— SessionStepDetails.SessionStepDetails 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.
frontendLogger.normalizeForSerialization (cyclomatic 24) src/lib/frontendLogger.ts:106— frontendLogger.normalizeForSerialization 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.
ProviderType::from_app_type_and_config (cyclomatic 23) src-tauri/src/proxy/providers/mod.rs:139— ProviderType::from_app_type_and_config 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.
McpService::upsert_server (cyclomatic 23) src-tauri/src/services/mcp.rs:29— McpService::upsert_server 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.
SessionReaderHeader.SessionReaderHeader (cyclomatic 23) src/components/sessions/reader/SessionReaderHeader.tsx:88— SessionReaderHeader.SessionReaderHeader has cyclomatic complexity 23 (threshold 15). Of this number, 20 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.
UsageTrendChart.UsageTrendChart (cyclomatic 23) src/components/usage/UsageTrendChart.tsx:258— UsageTrendChart.UsageTrendChart 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageHeatmap.UsageHeatmap (cyclomatic 23) src/components/usage/UsageHeatmap.tsx:247— UsageHeatmap.UsageHeatmap has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 7 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.
StreamedTextState::missing_suffix (cyclomatic 22) src-tauri/src/proxy/providers/streaming_responses.rs:567— StreamedTextState::missing_suffix 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.
ProfileService::apply (cyclomatic 22) src-tauri/src/services/profile.rs:334— ProfileService::apply 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.
FullScreenPanel.FullScreenPanel (cyclomatic 22) src/components/common/FullScreenPanel.tsx:73— FullScreenPanel.FullScreenPanel has cyclomatic complexity 22 (threshold 15). Of this number, 15 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.
AppMatrix.MatrixColumnHeader (cyclomatic 22) src/components/mcp/AppMatrix.tsx:212— AppMatrix.MatrixColumnHeader has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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.
useBaseUrlState.useBaseUrlState (cyclomatic 22) src/components/providers/forms/hooks/useBaseUrlState.ts:22— useBaseUrlState.useBaseUrlState has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 36, 67, 55, …). 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.
SessionOutline.SessionOutline (cyclomatic 22) src/components/sessions/reader/SessionOutline.tsx:46— SessionOutline.SessionOutline has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 108, 78, 61, …). 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.
SessionReaderHeader.SessionReaderToolbar (cyclomatic 22) src/components/sessions/reader/SessionReaderHeader.tsx:553— SessionReaderHeader.SessionReaderToolbar has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong 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.
UsageDisplaySection.UsageDisplaySection (cyclomatic 22) src/components/usage/UsageDisplaySection.tsx:49— UsageDisplaySection.UsageDisplaySection has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 10 function items inside it that branch (commitRate, toggleTodayItem, a function literal at line 152, …). 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.
useDirectorySettings.useDirectorySettings (cyclomatic 22) src/hooks/useDirectorySettings.ts:136— useDirectorySettings.useDirectorySettings has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 187, 288, 318, …). 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.
providerConfigUtils.setCodexBaseUrl (cyclomatic 22) REDACTED:1294— providerConfigUtils.setCodexBaseUrl 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.
UsageFooter.UsageFooter (cyclomatic 21) src/components/UsageFooter.tsx:100— UsageFooter.UsageFooter has cyclomatic complexity 21 (threshold 15). Of this number, 19 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.
SessionFinalReply.SessionFinalReply (cyclomatic 21) src/components/sessions/reader/SessionFinalReply.tsx:55— SessionFinalReply.SessionFinalReply has cyclomatic complexity 21 (threshold 15). Of this number, 17 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.
Sidebar.MainDirectory (cyclomatic 21) src/components/shell/Sidebar.tsx:210— Sidebar.MainDirectory has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (todayValue, isGlobalSelected, a function literal at line 312). 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.
UsageTab.UsageTab (cyclomatic 21) src/tray-panel/UsageTab.tsx:195— UsageTab.UsageTab has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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.
ProviderIcon.ProviderIcon (cyclomatic 20) REDACTED:22— ProviderIcon.ProviderIcon has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 66, 32, 41, …). 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.
ToolUninstallConfirmDialog.ToolUninstallConfirmDialog (cyclomatic 20) src/components/apps/ToolUninstallConfirmDialog.tsx:28— ToolUninstallConfirmDialog.ToolUninstallConfirmDialog has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 4 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.
ManualUninstallDialog.ManualUninstallDialog (cyclomatic 20) src/components/apps/ManualUninstallDialog.tsx:36— ManualUninstallDialog.ManualUninstallDialog has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 167, environmentForTool, environmentLabelForTool, …). 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.
PiNativePromptResources.PiPromptTemplates (cyclomatic 20) src/components/prompts/PiNativePromptResources.tsx:763— PiNativePromptResources.PiPromptTemplates has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 894, 826, 810, …). 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.
ManagedAccountsGroup.AccountRow (cyclomatic 20) src/components/settings/auth/ManagedAccountsGroup.tsx:551— ManagedAccountsGroup.AccountRow 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, 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.
useProviderActions.useProviderActions.switchProvider (cyclomatic 20) src/hooks/useProviderActions.ts:171— useProviderActions.useProviderActions.switchProvider 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.
CodexChatHistoryStore::enrich_request (cyclomatic 19) src-tauri/src/proxy/providers/codex_chat_history.rs:89— CodexChatHistoryStore::enrich_request 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.
UsageScriptModal.isOfficialSubscriptionProvider (cyclomatic 19) src/components/UsageScriptModal.tsx:202— UsageScriptModal.isOfficialSubscriptionProvider has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PiNativePromptResources.PiSystemPromptFiles (cyclomatic 19) src/components/prompts/PiNativePromptResources.tsx:334— PiNativePromptResources.PiSystemPromptFiles 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 2 function literals inside it that branch (lines 400, 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.
useGeminiConfigState.useGeminiConfigState (cyclomatic 19) src/components/providers/forms/hooks/useGeminiConfigState.ts:14— useGeminiConfigState.useGeminiConfigState 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 2 function literals inside it that branch (lines 106, 79). 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.
useOmoModelSource.useOmoModelSource (cyclomatic 19) src/components/providers/forms/hooks/useOmoModelSource.ts:47— useOmoModelSource.useOmoModelSource 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 4 function literals inside it that branch (lines 264, 302, 94, …). 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.
QuotaLines.SplitQuotaColumn (cyclomatic 19) src/components/quota/QuotaLines.tsx:478— QuotaLines.SplitQuotaColumn 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 3 function literals inside it that branch (lines 537, 505, 518). 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.
BackupStorageSection.BackupStorageSection (cyclomatic 19) src/components/settings/BackupStorageSection.tsx:33— BackupStorageSection.BackupStorageSection 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 (handleDelete, a function literal at line 108, handleReveal, …). 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.
GlobalProxySettings.GlobalProxySettings (cyclomatic 19) src/components/settings/GlobalProxySettings.tsx:73— GlobalProxySettings.GlobalProxySettings has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 3 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.
Sidebar.AppNavItem (cyclomatic 19) src/components/shell/Sidebar.tsx:410— Sidebar.AppNavItem 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.
SkillImportDialog.SkillImportDialog (cyclomatic 19) src/components/skills/SkillImportDialog.tsx:32— SkillImportDialog.SkillImportDialog 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 items inside it that branch (a function literal at line 48, foundLabel, a function literal at line 89, …). 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.
UnifiedSkillsPanel.InstalledRow (cyclomatic 19) src/components/skills/UnifiedSkillsPanel.tsx:1785— UnifiedSkillsPanel.InstalledRow has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong 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.
ModelsDevAutoSyncPanel.ModelsDevAutoSyncPanel (cyclomatic 19) src/components/usage/ModelsDevAutoSyncPanel.tsx:447— ModelsDevAutoSyncPanel.ModelsDevAutoSyncPanel has cyclomatic complexity 19 (threshold 15). Of this number, 12 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.
deepLinkConfigPreview.parseDeepLinkConfigPreview (cyclomatic 19) src/utils/deepLinkConfigPreview.ts:44— deepLinkConfigPreview.parseDeepLinkConfigPreview 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.
providerConfigUtils.extractProviderBaseUrl (cyclomatic 19) REDACTED:1165— providerConfigUtils.extractProviderBaseUrl 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, 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.
RequestIndex::observe (cyclomatic 18) src-tauri/src/kimi_session.rs:62— RequestIndex::observe 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.
DotenvPatch::apply (cyclomatic 18) src-tauri/src/live/patch/dotenv.rs:29— DotenvPatch::apply 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.
PromptCopyDialog.PromptCopyDialog (cyclomatic 18) src/components/prompts/PromptCopyDialog.tsx:30— PromptCopyDialog.PromptCopyDialog has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 98, 55, 76, …). 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.
ProviderCard.isOfficialProvider (cyclomatic 18) src/components/providers/ProviderCard.tsx:120— ProviderCard.isOfficialProvider has cyclomatic complexity 18 (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.
ProviderEmptyState.ProviderEmptyState (cyclomatic 18) src/components/providers/ProviderEmptyState.tsx:17— ProviderEmptyState.ProviderEmptyState has cyclomatic complexity 18 (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.
ManagedAccountRemoveDialog.ManagedAccountRemoveDialog (cyclomatic 18) src/components/providers/forms/ManagedAccountRemoveDialog.tsx:38— ManagedAccountRemoveDialog.ManagedAccountRemoveDialog has cyclomatic complexity 18 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useModelState.parseModelsFromConfig (cyclomatic 18) src/components/providers/forms/hooks/useModelState.ts:41— useModelState.parseModelsFromConfig 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.
useCodexConfigState.useCodexConfigState (cyclomatic 18) src/components/providers/forms/hooks/useCodexConfigState.ts:103— useCodexConfigState.useCodexConfigState 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 7 function literals inside it that branch (lines 120, 162, 171, …). 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.
GeminiFormFields.GeminiFormFields (cyclomatic 18) src/components/providers/forms/GeminiFormFields.tsx:54— GeminiFormFields.GeminiFormFields has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 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.
StackSubagentFields.StackSubagentFields (cyclomatic 18) src/components/providers/mode/StackSubagentFields.tsx:69— StackSubagentFields.StackSubagentFields has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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.
UsageHero.UsageHero (cyclomatic 18) src/components/usage/UsageHero.tsx:207— UsageHero.UsageHero has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
usePromptActions.usePromptActions.toggleEnabled (cyclomatic 18) src/hooks/usePromptActions.ts:190— usePromptActions.usePromptActions.toggleEnabled 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.
useSettings.useSettings.autoSaveSettings (cyclomatic 18) src/hooks/useSettings.ts:204— useSettings.useSettings.autoSaveSettings 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.
providerCapabilities.providerNeedsRouting (cyclomatic 18) src/utils/providerCapabilities.ts:148— providerCapabilities.providerNeedsRouting has cyclomatic complexity 18 (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.
providerConfigUtils.getTomlMultilineStringLines (cyclomatic 18) REDACTED:339— providerConfigUtils.getTomlMultilineStringLines 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 one function literal inside it that branches (line 341). 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.
SubscriptionQuotaFooter.SubscriptionQuotaView (cyclomatic 17) src/components/SubscriptionQuotaFooter.tsx:225— SubscriptionQuotaFooter.SubscriptionQuotaView 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.
ProviderForm.normalizeCodexCatalogModelsForSave (cyclomatic 17) src/components/providers/forms/ProviderForm.tsx:168— ProviderForm.normalizeCodexCatalogModelsForSave has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
toolSummary.formatStepTitle (cyclomatic 17) src/components/sessions/reader/toolSummary.ts:231— toolSummary.formatStepTitle 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.
SessionEventRow.describeEvent (cyclomatic 17) src/components/sessions/reader/SessionEventRow.tsx:34— SessionEventRow.describeEvent has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AccountQuota.AccountQuotaColumn (cyclomatic 17) src/components/settings/auth/AccountQuota.tsx:68— AccountQuota.AccountQuotaColumn has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 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.
theme-provider.ThemeProvider (cyclomatic 17) src/components/theme-provider.tsx:51— theme-provider.ThemeProvider 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 8 function items inside it that branch (getInitialTheme, a function literal at line 79, a function literal at line 92, …). 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.
TablePagination.TablePagination (cyclomatic 17) src/components/usage/TablePagination.tsx:35— TablePagination.TablePagination has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 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.
modelsDevPricing.flattenModels (cyclomatic 17) src/lib/modelsDevPricing.ts:64— modelsDevPricing.flattenModels 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.
providerConfigUtils.extractCodexExperimentalBearerToken (cyclomatic 17) REDACTED:1021— providerConfigUtils.extractCodexExperimentalBearerToken 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.
MultiAppConfig::migrate_mcp_to_unified (cyclomatic 16) src-tauri/src/app_config.rs:965— MultiAppConfig::migrate_mcp_to_unified has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
JsonPatch::apply_to (cyclomatic 16) src-tauri/src/live/patch/json.rs:41— JsonPatch::apply_to 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.
TomlPatch::apply_to (cyclomatic 16) src-tauri/src/live/patch/toml.rs:33— TomlPatch::apply_to 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.
DeepLinkImportDialog.DeepLinkImportDialog::handleImport (cyclomatic 16) src/components/DeepLinkImportDialog.tsx:245— DeepLinkImportDialog.DeepLinkImportDialog::handleImport 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: one other method here (DeepLinkImportDialog.DeepLinkImportDialog) 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.
WhatsNewDialog.WhatsNewNotice (cyclomatic 16) src/components/WhatsNewDialog.tsx:158— WhatsNewDialog.WhatsNewNotice has cyclomatic complexity 16 (threshold 15). Of this number, 8 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.
AppCountBar.AppCountBar (cyclomatic 16) src/components/common/AppCountBar.tsx:19— AppCountBar.AppCountBar has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 43). 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.
HermesMemoryPanel.MemoryTabPane (cyclomatic 16) src/components/hermes/HermesMemoryPanel.tsx:111— HermesMemoryPanel.MemoryTabPane has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
useOpencodeFormState.useOpencodeFormState (cyclomatic 16) src/components/providers/forms/hooks/useOpencodeFormState.ts:40— useOpencodeFormState.useOpencodeFormState has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 77, 53, 63, …). 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.
PiProviderForm.fillPiModelDraft (cyclomatic 16) REDACTED:353— PiProviderForm.fillPiModelDraft 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.
GrokBuildProviderForm.GrokBuildProviderForm::handleSubmit (cyclomatic 16) src/components/providers/forms/GrokBuildProviderForm.tsx:328— GrokBuildProviderForm.GrokBuildProviderForm::handleSubmit 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.
SessionDiff.SessionDiff (cyclomatic 16) src/components/sessions/reader/SessionDiff.tsx:195— SessionDiff.SessionDiff 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 217, 203). 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.
PricingEditModal.PricingEditModal (cyclomatic 16) src/components/usage/PricingEditModal.tsx:23— PricingEditModal.PricingEditModal has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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.
kimiProviderPresets.toKimiModel (cyclomatic 16) src/config/kimiProviderPresets.ts:103— kimiProviderPresets.toKimiModel has cyclomatic complexity 16 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useProxyStatus.useProxyStatus (cyclomatic 16) src/hooks/useProxyStatus.ts:20— useProxyStatus.useProxyStatus 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 7 function literals inside it that branch (lines 128, 168, 46, …). 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-fetch.showFetchModelsError (cyclomatic 16) src/lib/api/model-fetch.ts:113— model-fetch.showFetchModelsError 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.
version.comparePre (cyclomatic 16) src/lib/version.ts:60— version.comparePre 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.
TrayPanel.QuotaBlock (cyclomatic 16) src/tray-panel/TrayPanel.tsx:157— TrayPanel.QuotaBlock has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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.
providerCapabilities.resolveCodexOfficialIdentity (cyclomatic 16) src/utils/providerCapabilities.ts:46— providerCapabilities.resolveCodexOfficialIdentity 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.
providerConfigUtils.getApiKeyFromConfig (cyclomatic 16) REDACTED:32— providerConfigUtils.getApiKeyFromConfig 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.
providerConfigUtils.setApiKeyInConfig (cyclomatic 16) REDACTED:171— providerConfigUtils.setApiKeyInConfig 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.
TodoComment src-tauri/src/session_manager/providers/blocks.rs:327— /// todo:条目数。 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
CodexFormFields.CodexFormFields (cognitive 177) src/components/providers/forms/CodexFormFields.tsx:535— CodexFormFields.CodexFormFields has cognitive complexity 177 (threshold 15). Drivers by points: boolean chains 84, if/else 42 (53 pts), ternaries 28 (34 pts), loops 6 (nesting depth added 17). Of this number, 82 points are the body's own statements and 95 belong to 34 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.
ProviderForm.ProviderFormFull (cognitive 174) src/components/providers/forms/ProviderForm.tsx:346— ProviderForm.ProviderFormFull has cognitive complexity 174 (threshold 15). Drivers by points: ternaries 92 (199 pts), if/else 131 (196 pts), boolean chains 184, error handling 7 (10 pts) (nesting depth added 175). To reduce it, split the body into named stages: move each independent 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: 3 other methods here (ProviderForm.ProviderFormFull::handleSubmit, ProviderForm.ProviderFormFull::performSubmit, ProviderForm.ProviderFormFull::handlePresetChange) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
AddProviderDialog.AddProviderDialog (cognitive 155) src/components/providers/AddProviderDialog.tsx:58— AddProviderDialog.AddProviderDialog has cognitive complexity 155 (threshold 15). Drivers by points: if/else 46 (99 pts), boolean chains 34, ternaries 18 (20 pts), error handling 2 (nesting depth added 55). Of this number, 23 points are the body's own statements and 132 belong to 13 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.
UnifiedMcpPanel.UnifiedMcpPanel (cognitive 145) src/components/mcp/UnifiedMcpPanel.tsx:128— UnifiedMcpPanel.UnifiedMcpPanel has cognitive complexity 145 (threshold 15). Drivers by points: if/else 37 (47 pts), ternaries 17 (37 pts), boolean chains 35, loops 11 (16 pts), error handling 8 (10 pts) (nesting depth added 37). Of this number, 29 points are the body's own statements and 116 belong to 27 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.
deplink.html.generateLink (cognitive 116) deplink.html:1468— deplink.html.generateLink has cognitive complexity 116 (threshold 15). Drivers by points: if/else 48 (91 pts), error handling 6 (17 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebdavSyncSection.WebdavSyncSection (cognitive 115) src/components/settings/WebdavSyncSection.tsx:234— WebdavSyncSection.WebdavSyncSection has cognitive complexity 115 (threshold 15). Drivers by points: if/else 49 (50 pts), boolean chains 44, error handling 15, ternaries 6 (nesting depth added 1). Of this number, 36 points are the body's own statements and 79 belong to 33 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.
ProviderCard.ProviderCard (cognitive 113) src/components/providers/ProviderCard.tsx:178— ProviderCard.ProviderCard has cognitive complexity 113 (threshold 15). Drivers by points: ternaries 31 (78 pts), boolean chains 31, if/else 4 (nesting depth added 47). Of this number, 108 points are the body's own statements and 5 belong to 4 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.
SkillsPage.SkillsPage (cognitive 110) src/components/skills/SkillsPage.tsx:157— SkillsPage.SkillsPage has cognitive complexity 110 (threshold 15). Drivers by points: ternaries 23 (58 pts), boolean chains 27, if/else 19 (22 pts), loops 2, error handling 1 (nesting depth added 38). Of this number, 26 points are the body's own statements and 84 belong to 14 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.
TrayPanel.TrayPanel (cognitive 110) src/tray-panel/TrayPanel.tsx:515— TrayPanel.TrayPanel has cognitive complexity 110 (threshold 15). Drivers by points: if/else 42 (46 pts), ternaries 24 (35 pts), boolean chains 27, error handling 2 (nesting depth added 15). Most of this is not in the body itself: 11 of the 110 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 649, a function literal at line 873, switchTo, …). 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.
useOmoModelSource.useOmoModelSource.omoModelBuild (cognitive 104) src/components/providers/forms/hooks/useOmoModelSource.ts:117— useOmoModelSource.useOmoModelSource.omoModelBuild has cognitive complexity 104 (threshold 15). Drivers by points: if/else 17 (69 pts), boolean chains 12, loops 4 (10 pts), ternaries 3 (10 pts), error handling 1 (3 pts) (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.
TokenUsage::from_claude_stream_events (cognitive 102) src-tauri/src/proxy/usage/parser.rs:147— TokenUsage::from_claude_stream_events has cognitive complexity 102 (threshold 15). Drivers by points: if/else 20 (95 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 77). 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.
PiPromptPanel.PiPromptPanel (cognitive 102) src/components/prompts/PiPromptPanel.tsx:54— PiPromptPanel.PiPromptPanel has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 28 (45 pts), if/else 21 (33 pts), boolean chains 17, error handling 3 (4 pts), loops 2 (3 pts) (nesting depth added 31). Of this number, 48 points are the body's own statements and 54 belong to 19 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.
presentation.buildAdditiveSections (cognitive 100) src/components/providers/presentation.ts:711— presentation.buildAdditiveSections has cognitive complexity 100 (threshold 15). Drivers by points: if/else 20 (47 pts), ternaries 14 (43 pts), boolean chains 9, loops 1 (nesting depth added 56). Of this number, 92 points are the body's own statements and 8 belong 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.
deplink.html.parseDeepLink (cognitive 94) deplink.html:1973— deplink.html.parseDeepLink has cognitive complexity 94 (threshold 15). Drivers by points: if/else 40 (57 pts), boolean chains 15, ternaries 5 (9 pts), error handling 4 (8 pts), loops 2 (5 pts) (nesting depth added 28). Of this number, 67 points are the body's own statements and 27 belong to 7 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.
PromptPanel.StandardPromptPanel (cognitive 93) src/components/prompts/PromptPanel.tsx:37— PromptPanel.StandardPromptPanel has cognitive complexity 93 (threshold 15). Drivers by points: if/else 38 (40 pts), ternaries 16 (23 pts), boolean chains 21, error handling 5 (6 pts), loops 2 (3 pts) (nesting depth added 11). Of this number, 25 points are the body's own statements and 68 belong to 24 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.
ClaudeFormFields.ClaudeFormFields (cognitive 92) src/components/providers/forms/ClaudeFormFields.tsx:184— ClaudeFormFields.ClaudeFormFields has cognitive complexity 92 (threshold 15). Drivers by points: boolean chains 39, ternaries 14 (29 pts), if/else 24 (nesting depth added 15). Of this number, 61 points are the body's own statements and 31 belong to 22 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.
SessionReader.SessionReader (cognitive 90) src/components/sessions/reader/SessionReader.tsx:155— SessionReader.SessionReader has cognitive complexity 90 (threshold 15). Drivers by points: boolean chains 33, ternaries 21 (28 pts), if/else 21 (23 pts), error handling 4, loops 1, match/switch 1 (nesting depth added 9). Of this number, 36 points are the body's own statements and 54 belong to 24 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.
ProviderList.ProviderList (cognitive 81) src/components/providers/ProviderList.tsx:103— ProviderList.ProviderList has cognitive complexity 81 (threshold 15). Drivers by points: boolean chains 30, if/else 27 (30 pts), ternaries 15 (20 pts), match/switch 1 (nesting depth added 8). Of this number, 33 points are the body's own statements and 48 belong to 17 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.
turns.buildTurn (cognitive 80) src/components/sessions/reader/turns.ts:298— turns.buildTurn has cognitive complexity 80 (threshold 15). Drivers by points: if/else 24 (58 pts), ternaries 3 (9 pts), boolean chains 8, loops 3, match/switch 1 (2 pts) (nesting depth added 41). Most of this is not in the body itself: 13 of the 80 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 368, a function literal at line 344, blocksOf, …). 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.
KimiProviderForm.KimiProviderForm (cognitive 77) src/components/providers/forms/KimiProviderForm.tsx:103— KimiProviderForm.KimiProviderForm has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 31, if/else 18 (23 pts), ternaries 14 (17 pts), loops 4, error handling 2 (nesting depth added 8). Of this number, 29 points are the body's own statements and 48 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.
EditProviderDialog.EditProviderDialog (cognitive 76) src/components/providers/EditProviderDialog.tsx:67— EditProviderDialog.EditProviderDialog has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (39 pts), boolean chains 17, ternaries 12 (14 pts), error handling 3 (6 pts) (nesting depth added 19). Most of this is not in the body itself: 15 of the 76 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 139, 289, 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.
presentation.buildSwitchSectionsByView (cognitive 74) src/components/providers/presentation.ts:189— presentation.buildSwitchSectionsByView has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 19 (35 pts), if/else 17 (34 pts), boolean chains 5 (nesting depth added 33). Of this number, 20 points are the body's own statements and 54 belong to 14 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.
SwitchModePanel.SwitchModePanel (cognitive 68) src/components/providers/mode/SwitchModePanel.tsx:101— SwitchModePanel.SwitchModePanel has cognitive complexity 68 (threshold 15). Drivers by points: boolean chains 26, ternaries 16 (25 pts), if/else 12, error handling 4, loops 1 (nesting depth added 9). Of this number, 44 points are the body's own statements and 24 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.
OpenCodeFormFields.OpenCodeFormFields (cognitive 67) src/components/providers/forms/OpenCodeFormFields.tsx:205— OpenCodeFormFields.OpenCodeFormFields has cognitive complexity 67 (threshold 15). Drivers by points: if/else 30 (35 pts), boolean chains 17, loops 7 (8 pts), ternaries 5, error handling 2 (nesting depth added 6). Most of this is not in the body itself: 3 of the 67 points are its own statements and the rest belongs to 19 function items inside it that branch (handleModelExtraFieldKeyChange, handleModelLimitChange, handleExtraOptionKeyChange, …). 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.
UniversalProviderFormModal.UniversalProviderFormModal (cognitive 67) src/components/universal/UniversalProviderFormModal.tsx:30— UniversalProviderFormModal.UniversalProviderFormModal has cognitive complexity 67 (threshold 15). Drivers by points: boolean chains 48, if/else 12, ternaries 7. Of this number, 24 points are the body's own statements and 43 belong to 11 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.
DeepLinkImportDialog.DeepLinkImportDialog (cognitive 57) src/components/DeepLinkImportDialog.tsx:86— DeepLinkImportDialog.DeepLinkImportDialog has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 59, if/else 26 (30 pts), ternaries 10 (14 pts), error handling 4 (5 pts), match/switch 2, loops 1 (nesting depth added 9). 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. This shape REPEATS in the file: one other method here (DeepLinkImportDialog.DeepLinkImportDialog::handleImport) 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.
ProfileService::apply (cognitive 56) src-tauri/src/services/profile.rs:334— ProfileService::apply has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 5 (13 pts), match/switch 2 (8 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.
UsageDashboard.UsageDashboard (cognitive 53) src/components/usage/UsageDashboard.tsx:250— UsageDashboard.UsageDashboard has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 19 (21 pts), boolean chains 17, if/else 11, error handling 3, loops 1 (nesting depth added 2). Of this number, 26 points are the body's own statements and 27 belong to 13 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.
DailyMemoryPanel.DailyMemoryPanel (cognitive 53) src/components/workspace/DailyMemoryPanel.tsx:43— DailyMemoryPanel.DailyMemoryPanel has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (21 pts), ternaries 7 (14 pts), boolean chains 13, error handling 5 (nesting depth added 9). Of this number, 18 points are the body's own statements and 35 belong to 16 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.
useToolManagement.useToolManagement.executeRun (cognitive 52) src/components/apps/useToolManagement.ts:643— useToolManagement.useToolManagement.executeRun has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 12, ternaries 6 (11 pts), error handling 1 (nesting depth added 14). Of this number, 23 points are the body's own statements and 29 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.
McpFormModal.McpFormModal (cognitive 52) src/components/mcp/McpFormModal.tsx:117— McpFormModal.McpFormModal has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 41 (75 pts), if/else 26 (29 pts), boolean chains 26, error handling 2 (3 pts), loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (McpFormModal.McpFormModal::submitSingle) 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.
ModelsDevAutoSyncPanel.AutoSyncDialog (cognitive 52) src/components/usage/ModelsDevAutoSyncPanel.tsx:70— ModelsDevAutoSyncPanel.AutoSyncDialog has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 10 (15 pts), boolean chains 12, loops 6 (8 pts), error handling 1 (nesting depth added 16). Most of this is not in the body itself: 10 of the 52 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 92, a function literal at line 336, a function literal at line 107, …). 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.
AppsPage.ToolRow (cognitive 51) src/components/apps/AppsPage.tsx:700— AppsPage.ToolRow has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 18 (27 pts), boolean chains 24 (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.
CodexOAuthSection.CodexOAuthSection (cognitive 51) src/components/providers/forms/CodexOAuthSection.tsx:77— CodexOAuthSection.CodexOAuthSection has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 31, ternaries 10 (13 pts), if/else 7 (nesting depth added 3). Of this number, 38 points are the body's own statements and 13 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.
CommonConfigEditor.CommonConfigEditor (cognitive 51) src/components/providers/forms/CommonConfigEditor.tsx:48— CommonConfigEditor.CommonConfigEditor has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 8, error handling 3, loops 1, match/switch 1 (nesting depth added 18). None of this is in the body itself: all 51 points belong to 5 function literals inside it that branch (lines 120, 87, 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.
RequestLogTable.RequestLogTable::renderRow (cognitive 51) src/components/usage/RequestLogTable.tsx:368— RequestLogTable.RequestLogTable::renderRow has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 23 (34 pts), boolean chains 17 (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.
UnifiedSkillsPanel.UnifiedSkillsPanel (cognitive 49) src/components/skills/UnifiedSkillsPanel.tsx:120— UnifiedSkillsPanel.UnifiedSkillsPanel has cognitive complexity 49 (threshold 15). Drivers by points: if/else 79 (91 pts), ternaries 43 (67 pts), boolean chains 52, error handling 15 (17 pts), loops 10 (11 pts) (nesting depth added 39). 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: 2 other methods here (UnifiedSkillsPanel.UnifiedSkillsPanel::uninstallIds, UnifiedSkillsPanel.UnifiedSkillsPanel::renderInstalledBody) 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.
SessionItem.SessionItem (cognitive 46) src/components/sessions/SessionItem.tsx:56— SessionItem.SessionItem has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 24, ternaries 13 (20 pts), if/else 1 (2 pts) (nesting depth added 8). Of this number, 44 points are the body's own statements and 2 belong 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.
SessionMarkdown.collectVisibleTextPieces (cognitive 46) src/components/sessions/reader/SessionMarkdown.tsx:366— SessionMarkdown.collectVisibleTextPieces has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (29 pts), ternaries 2 (9 pts), boolean chains 5, loops 2 (3 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.
CodexChatHistoryStore::enrich_request (cognitive 45) src-tauri/src/proxy/providers/codex_chat_history.rs:89— CodexChatHistoryStore::enrich_request has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (6 pts), match/switch 2 (3 pts), boolean chains 2 (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.
UsageScriptModal.UsageScriptModal (cognitive 45) src/components/UsageScriptModal.tsx:248— UsageScriptModal.UsageScriptModal has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 87, if/else 55 (63 pts), ternaries 22 (50 pts), error handling 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (UsageScriptModal.UsageScriptModal::handleTest, UsageScriptModal.UsageScriptModal::handleUsePreset) 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.
AboutSection.AboutSection (cognitive 45) src/components/settings/AboutSection.tsx:48— AboutSection.AboutSection has cognitive complexity 45 (threshold 15). Drivers by points: error handling 7 (12 pts), ternaries 8 (12 pts), if/else 8 (11 pts), boolean chains 10 (nesting depth added 12). Of this number, 16 points are the body's own statements and 29 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.
ModeDialog.EnterBody (cognitive 44) src/components/providers/mode/ModeDialog.tsx:131— ModeDialog.EnterBody has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 15 (29 pts), boolean chains 12, if/else 2, error handling 1 (nesting depth added 14). Of this number, 38 points are the body's own statements and 6 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.
ProviderType::from_app_type_and_config (cognitive 43) src-tauri/src/proxy/providers/mod.rs:139— ProviderType::from_app_type_and_config has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (39 pts), match/switch 2 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
useManagedAuth.useManagedAuth (cognitive 43) src/components/providers/forms/hooks/useManagedAuth.ts:22— useManagedAuth.useManagedAuth has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (23 pts), ternaries 9 (12 pts), boolean chains 4, error handling 3 (4 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 43 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 169, 132, 316, …). 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.
UsageDateRangePicker.UsageDateRangePicker (cognitive 43) src/components/usage/UsageDateRangePicker.tsx:114— UsageDateRangePicker.UsageDateRangePicker has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 15, ternaries 9 (10 pts) (nesting depth added 3). Most of this is not in the body itself: 3 of the 43 points are its own statements and the rest belongs to 13 function items inside it that branch (handleDatePick, renderField, a function literal at line 495, …). 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.
PromptFormPanel.PromptFormPanel (cognitive 42) src/components/prompts/PromptFormPanel.tsx:53— PromptFormPanel.PromptFormPanel has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 19 (24 pts), boolean chains 10, if/else 7, error handling 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 17 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.
AppsPage.AppsPage (cognitive 41) src/components/apps/AppsPage.tsx:175— AppsPage.AppsPage has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 16, ternaries 9 (14 pts), if/else 10, loops 1 (nesting depth added 5). Most of this is not in the body itself: 13 of the 41 points are its own statements and the rest belongs to 10 function items inside it that branch (renderRow, rowInstalled, handleDragEnd, …). 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.
tomlUtils.normalizeServerConfig (cognitive 41) src/utils/tomlUtils.ts:101— tomlUtils.normalizeServerConfig has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (10 pts), boolean chains 9 (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.
AgentsDefaultsPanel.AgentsDefaultsPanel (cognitive 40) src/components/openclaw/AgentsDefaultsPanel.tsx:28— AgentsDefaultsPanel.AgentsDefaultsPanel has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18, boolean chains 12, ternaries 8 (9 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 40 points are its own statements and the rest belongs to 9 function items inside it that branch (handleSave, a function literal at line 45, getFallbackOptions, …). 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.
RoutingSection.RoutingSection (cognitive 40) src/components/settings/sections/RoutingSection.tsx:93— RoutingSection.RoutingSection has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 16 (17 pts), boolean chains 13, if/else 7, error handling 3 (nesting depth added 1). Of this number, 19 points are the body's own statements and 21 belong to 8 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.
XaiOAuthSection.XaiOAuthSection (cognitive 39) src/components/providers/forms/XaiOAuthSection.tsx:54— XaiOAuthSection.XaiOAuthSection has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 12 (22 pts), boolean chains 12, if/else 5 (nesting depth added 10). Of this number, 28 points are the body's own statements and 11 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.
providerConfigUtils.setCodexBaseUrl (cognitive 39) REDACTED:1294— providerConfigUtils.setCodexBaseUrl has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (9 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamedTextState::missing_suffix (cognitive 38) src-tauri/src/proxy/providers/streaming_responses.rs:567— StreamedTextState::missing_suffix has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (35 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CopilotAuthSection.CopilotAuthSection (cognitive 38) src/components/providers/forms/CopilotAuthSection.tsx:65— CopilotAuthSection.CopilotAuthSection has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 16, ternaries 10 (13 pts), if/else 9 (nesting depth added 3). Of this number, 24 points are the body's own statements and 14 belong to 8 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.
BackupListSection.BackupListSection (cognitive 38) src/components/settings/BackupListSection.tsx:63— BackupListSection.BackupListSection has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (11 pts), ternaries 7 (10 pts), error handling 4 (nesting depth added 9). Most of this is not in the body itself: 7 of the 38 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 310, handleRestore, handleConfirmRename, …). 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.
ModelsDevPickerDialog.ModelsDevPickerDialog (cognitive 37) src/components/usage/ModelsDevPickerDialog.tsx:46— ModelsDevPickerDialog.ModelsDevPickerDialog has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (21 pts), boolean chains 8, if/else 5 (6 pts), error handling 1, loops 1 (nesting depth added 12). 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 items inside it that branch (a function literal at line 75, a function literal at line 92, a function literal at line 246, …). 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.
RequestIndex::observe (cognitive 36) src-tauri/src/kimi_session.rs:62— RequestIndex::observe has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useProviderCategory.useProviderCategory (cognitive 36) src/components/providers/forms/hooks/useProviderCategory.ts:22— useProviderCategory.useProviderCategory has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 13, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to one function literal inside it that branches (line 33). 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.
RequestDetailPanel.useDetailSections (cognitive 36) src/components/usage/RequestDetailPanel.tsx:86— RequestDetailPanel.useDetailSections has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 7 (13 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.
JsonEditor.JsonEditor (cognitive 35) src/components/JsonEditor.tsx:85— JsonEditor.JsonEditor has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 12 (15 pts), if/else 12 (13 pts), boolean chains 5, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 110, a function literal at line 147, handleFormat, …). 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.
PiProviderForm.PiProviderForm::submit (cognitive 35) REDACTED:1311— PiProviderForm.PiProviderForm::submit has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 8, ternaries 4 (6 pts), 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 (PiProviderForm.PiProviderForm) 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.
QuotaLines.QuotaLines (cognitive 34) src/components/quota/QuotaLines.tsx:211— QuotaLines.QuotaLines has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12 (23 pts), boolean chains 6, if/else 5 (nesting depth added 11). Of this number, 30 points are the body's own statements and 4 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.
usePromptActions.usePromptActions.toggleEnabled (cognitive 34) src/hooks/usePromptActions.ts:190— usePromptActions.usePromptActions.toggleEnabled has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 5 (11 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modelsDevPricing.flattenModels (cognitive 34) src/lib/modelsDevPricing.ts:64— modelsDevPricing.flattenModels has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 4 (11 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 18). Of this number, 33 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.
GrokBuildProviderForm.GrokBuildProviderForm (cognitive 33) src/components/providers/forms/GrokBuildProviderForm.tsx:73— GrokBuildProviderForm.GrokBuildProviderForm has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 13, if/else 13, ternaries 7. Most of this is not in the body itself: 8 of the 33 points are its own statements and the rest belongs to 7 function items inside it that branch (handleSubmit, handlePresetChange, handleRawConfigChange, …). 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.
SessionDiff.parseDiff (cognitive 33) src/components/sessions/reader/SessionDiff.tsx:26— SessionDiff.parseDiff has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 5 of the 33 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 41, pushFile). 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.
UsageTab.UsageTab (cognitive 33) src/tray-panel/UsageTab.tsx:195— UsageTab.UsageTab has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 13 (25 pts), boolean chains 4, if/else 2 (4 pts) (nesting depth added 14). Of this number, 21 points are the body's own statements and 12 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.
IconPicker.IconPicker (cognitive 31) src/components/IconPicker.tsx:60— IconPicker.IconPicker has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, ternaries 4 (5 pts), error handling 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 7 function items inside it that branch (handleFileChange, handleNameConfirm, handleDeleteConfirm, …). 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.
FetchedModelPicker.FetchedModelPickerBody (cognitive 31) src/components/providers/forms/FetchedModelPicker.tsx:130— FetchedModelPicker.FetchedModelPickerBody has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 11, ternaries 2 (3 pts), loops 2 (nesting depth added 7). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 174, a function literal at line 201, matches, …). 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.
SessionManagerPage.SessionManagerPage (cognitive 31) src/components/sessions/SessionManagerPage.tsx:136— SessionManagerPage.SessionManagerPage has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 40, ternaries 34 (39 pts), if/else 35 (38 pts), error handling 7 (9 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (SessionManagerPage.SessionManagerPage::handleDeleteConfirm) 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.
frontendLogger.normalizeForSerialization (cognitive 31) src/lib/frontendLogger.ts:106— frontendLogger.normalizeForSerialization has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useCodexConfigState.mapCodexCatalogModelForForm (cognitive 30) src/components/providers/forms/hooks/useCodexConfigState.ts:38— useCodexConfigState.mapCodexCatalogModelForForm has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 20 (27 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.
App.App (cognitive 29) src/App.tsx:161— App.App has cognitive complexity 29 (threshold 15). Drivers by points: if/else 81 (89 pts), boolean chains 66, ternaries 44 (63 pts), error handling 19 (24 pts), loops 4, match/switch 2 (nesting depth added 32). 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 (App.App::handleDuplicateProvider) 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.
McodeProviderForm.McodeProviderForm (cognitive 29) src/components/providers/forms/McodeProviderForm.tsx:71— McodeProviderForm.McodeProviderForm has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, ternaries 8 (11 pts), if/else 3, error handling 2 (nesting depth added 3). Of this number, 21 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SettingsPage.SettingsPage (cognitive 29) src/components/settings/SettingsPage.tsx:82— SettingsPage.SettingsPage has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 10, if/else 10, error handling 4, ternaries 2 (3 pts), loops 1, match/switch 1 (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 14 function items inside it that branch (a function literal at line 145, renderSection, a function literal at line 275, …). 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.
useSettings.useSettings.saveSettings (cognitive 28) src/hooks/useSettings.ts:343— useSettings.useSettings.saveSettings has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 5 (7 pts), boolean chains 4, 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, 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.
mutations.useAddProviderMutation (cognitive 28) src/lib/query/mutations.ts:24— mutations.useAddProviderMutation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (nesting depth added 7). None of this is in the body itself: all 28 points belong to 4 function literals inside it that branch (lines 29, 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.
providerConfigUtils.getTomlMultilineStringLines (cognitive 28) REDACTED:339— providerConfigUtils.getTomlMultilineStringLines has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 14). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 341). 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.
DatabaseUpgrade.DatabaseUpgrade (cognitive 27) src/components/DatabaseUpgrade.tsx:49— DatabaseUpgrade.DatabaseUpgrade has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (6 pts), ternaries 3 (4 pts), error handling 2 (nesting depth added 2). Of this number, 17 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.
McpConfirmation.McpConfirmation (cognitive 27) src/components/deeplink/McpConfirmation.tsx:14— McpConfirmation.McpConfirmation has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (11 pts), loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 37, a function literal at line 21, Row, …). 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.
PiNativePromptResources.PiSystemPromptFiles (cognitive 27) src/components/prompts/PiNativePromptResources.tsx:334— PiNativePromptResources.PiSystemPromptFiles has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (23 pts), boolean chains 4 (nesting depth added 9). None of this is in the body itself: all 27 points belong to 2 function literals inside it that branch (lines 400, 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.
PiNativePromptResources.PiPromptTemplateEditor (cognitive 27) src/components/prompts/PiNativePromptResources.tsx:513— PiNativePromptResources.PiPromptTemplateEditor has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 8, if/else 2 (nesting depth added 5). Of this number, 24 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.
HermesFormFields.HermesFormFields (cognitive 27) src/components/providers/forms/HermesFormFields.tsx:85— HermesFormFields.HermesFormFields has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 9, boolean chains 7, loops 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 210, 332, 498, …). 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.NavItem (cognitive 27) src/components/shell/Sidebar.tsx:531— Sidebar.NavItem has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (18 pts), boolean chains 8, if/else 1 (nesting depth added 4). Of this number, 21 points are the body's own statements and 6 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.
UsageTrendChart.UsageTrendChart (cognitive 27) src/components/usage/UsageTrendChart.tsx:258— UsageTrendChart.UsageTrendChart has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 5, boolean chains 3 (nesting depth added 7). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KimiAccountLogin.KimiAccountLogin (cognitive 26) src/components/providers/KimiAccountLogin.tsx:23— KimiAccountLogin.KimiAccountLogin has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 14 (17 pts), if/else 5, boolean chains 4 (nesting depth added 3). Of this number, 14 points are the body's own statements and 12 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.
ProviderPresetSelector.PresetPicker (cognitive 26) src/components/providers/forms/ProviderPresetSelector.tsx:544— ProviderPresetSelector.PresetPicker has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (10 pts), if/else 4, loops 1 (nesting depth added 4). 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.
PiProviderForm.PiProviderForm (cognitive 26) REDACTED:499— PiProviderForm.PiProviderForm has cognitive complexity 26 (threshold 15). Drivers by points: if/else 75 (83 pts), boolean chains 68, ternaries 38 (45 pts), error handling 2 (3 pts), loops 1 (nesting depth added 16). 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 (PiProviderForm.PiProviderForm::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.
SessionStepDetails.BlockText (cognitive 26) src/components/sessions/reader/SessionStepDetails.tsx:73— SessionStepDetails.BlockText has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 17, ternaries 5, 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.
ManagedAccountsGroup.ManagedAccountsGroup (cognitive 26) src/components/settings/auth/ManagedAccountsGroup.tsx:111— ManagedAccountsGroup.ManagedAccountsGroup has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 15, if/else 5, ternaries 4 (5 pts), error handling 1 (nesting depth added 1). Of this number, 18 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.
SkillsStorageSheet.SkillsStorageSheet (cognitive 26) src/components/skills/SkillsStorageSheet.tsx:59— SkillsStorageSheet.SkillsStorageSheet has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10, boolean chains 9, ternaries 4, error handling 3. Most of this is not in the body itself: 6 of the 26 points are its own statements and the rest belongs to 9 function items inside it that branch (doMigrate, handleMove, handleResync, …). 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.
DotenvPatch::apply (cognitive 25) src-tauri/src/live/patch/dotenv.rs:29— DotenvPatch::apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 2, 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.
OmoFormFields.mergeCustomModelsIntoStore (cognitive 25) src/components/providers/forms/OmoFormFields.tsx:259— OmoFormFields.mergeCustomModelsIntoStore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, ternaries 1 (3 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderForm.normalizeCodexCatalogModelsForSave (cognitive 25) src/components/providers/forms/ProviderForm.tsx:168— ProviderForm.normalizeCodexCatalogModelsForSave has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 6, if/else 1 (2 pts), loops 1 (nesting depth added 9). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionMarkdown.renderNode (cognitive 25) src/components/sessions/reader/SessionMarkdown.tsx:932— SessionMarkdown.renderNode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (10 pts), boolean chains 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.
Sidebar.AppNavItem (cognitive 25) src/components/shell/Sidebar.tsx:410— Sidebar.AppNavItem has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (20 pts), boolean chains 4, if/else 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.
useDirectorySettings.useDirectorySettings (cognitive 25) src/hooks/useDirectorySettings.ts:136— useDirectorySettings.useDirectorySettings has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (9 pts), loops 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 4). None of this is in the body itself: all 25 points belong to 4 function literals inside it that branch (lines 187, 288, 318, …). 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.
routingReason.getRoutingReason (cognitive 25) src/utils/routingReason.ts:16— routingReason.getRoutingReason has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 10 (11 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.
JsonPatch::apply_to (cognitive 24) src-tauri/src/live/patch/json.rs:41— JsonPatch::apply_to has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TomlPatch::apply_to (cognitive 24) src-tauri/src/live/patch/toml.rs:33— TomlPatch::apply_to has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderRouter::select_providers_with_current (cognitive 24) src-tauri/src/proxy/provider_router.rs:59— ProviderRouter::select_providers_with_current has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillImportDialog.SkillImportDialog (cognitive 24) src/components/skills/SkillImportDialog.tsx:32— SkillImportDialog.SkillImportDialog has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 4). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 48, a function literal at line 89, foundLabel, …). 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.
useSettings.useSettings.autoSaveSettings (cognitive 24) src/hooks/useSettings.ts:204— useSettings.useSettings.autoSaveSettings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 5 (7 pts), ternaries 2 (4 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.
GrokConfigPatch::apply_to (cognitive 23) src-tauri/src/live/project/grok.rs:229— GrokConfigPatch::apply_to has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (5 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.
AnthropicToResponsesState::close_block (cognitive 23) src-tauri/src/proxy/providers/streaming_codex_anthropic.rs:338— AnthropicToResponsesState::close_block has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OutputInfo::from_contents (cognitive 23) src-tauri/src/session_manager/providers/codex.rs:525— OutputInfo::from_contents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
App.App::handleDuplicateProvider (cognitive 23) src/App.tsx:1066— App.App::handleDuplicateProvider has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (5 pts), ternaries 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. This shape REPEATS in the file: one other method here (App.App) 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.
useGeminiConfigState.useGeminiConfigState (cognitive 23) src/components/providers/forms/hooks/useGeminiConfigState.ts:14— useGeminiConfigState.useGeminiConfigState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 5). None of this is in the body itself: all 23 points belong to 2 function literals inside it that branch (lines 106, 79). 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.
ClaudeDesktopProviderForm.ClaudeDesktopProviderForm (cognitive 23) src/components/providers/forms/ClaudeDesktopProviderForm.tsx:249— ClaudeDesktopProviderForm.ClaudeDesktopProviderForm has cognitive complexity 23 (threshold 15). Drivers by points: if/else 36 (53 pts), boolean chains 44, ternaries 22 (30 pts), error handling 2, loops 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleFetchManagedModels, ClaudeDesktopProviderForm.ClaudeDesktopProviderForm::handleSubmit) 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.
version.comparePre (cognitive 23) src/lib/version.ts:60— version.comparePre has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (8 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.
PromptService::enable_prompt (cognitive 22) src-tauri/src/services/prompt.rs:150— PromptService::enable_prompt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 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.
UsageFooter.UsageFooter (cognitive 22) src/components/UsageFooter.tsx:100— UsageFooter.UsageFooter has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), ternaries 4 (5 pts) (nesting depth added 2). 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, 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.
ManualUninstallDialog.ManualUninstallDialog (cognitive 22) src/components/apps/ManualUninstallDialog.tsx:36— ManualUninstallDialog.ManualUninstallDialog has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 6, if/else 3, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (environmentLabelForTool, environmentForTool, a function literal at line 167, …). 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.
AppMatrix.MatrixColumnHeader (cognitive 22) src/components/mcp/AppMatrix.tsx:212— AppMatrix.MatrixColumnHeader has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, ternaries 8 (9 pts), if/else 2 (nesting depth added 1). Of this number, 19 points are the body's own statements and 3 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.
OpenClawFormFields.OpenClawFormFields (cognitive 22) src/components/providers/forms/OpenClawFormFields.tsx:59— OpenClawFormFields.OpenClawFormFields has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, ternaries 6 (7 pts), boolean chains 5, loops 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 196, a function literal at line 355, a function literal at line 83, …). 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.
deepLinkConfigPreview.parseDeepLinkConfigPreview (cognitive 22) src/utils/deepLinkConfigPreview.ts:44— deepLinkConfigPreview.parseDeepLinkConfigPreview has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (8 pts), boolean chains 4, 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.
useOpenClawModelOptions.useOpenClawModelOptions.options (cognitive 21) src/components/openclaw/hooks/useOpenClawModelOptions.ts:16— useOpenClawModelOptions.useOpenClawModelOptions.options has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2, error handling 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.
useBaseUrlState.useBaseUrlState (cognitive 21) src/components/providers/forms/hooks/useBaseUrlState.ts:22— useBaseUrlState.useBaseUrlState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 4, ternaries 3, error handling 2. None of this is in the body itself: all 21 points belong to 4 function literals inside it that branch (lines 36, 67, 55, …). 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.
useCodexConfigState.useCodexConfigState (cognitive 21) src/components/providers/forms/hooks/useCodexConfigState.ts:103— useCodexConfigState.useCodexConfigState has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5 (6 pts), boolean chains 5, error handling 1 (nesting depth added 4). None of this is in the body itself: all 21 points belong to 7 function literals inside it that branch (lines 120, 162, 171, …). 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.MainDirectory (cognitive 21) src/components/shell/Sidebar.tsx:210— Sidebar.MainDirectory has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (todayValue, isGlobalSelected, a function literal at line 312). 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.
useProviderActions.useProviderActions.switchProvider (cognitive 21) src/hooks/useProviderActions.ts:171— useProviderActions.useProviderActions.switchProvider has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 2 (3 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.
providerConfigUtils.setApiKeyInConfig (cognitive 21) REDACTED:171— providerConfigUtils.setApiKeyInConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 1, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ModelMapping::map_model (cognitive 20) src-tauri/src/proxy/model_mapper.rs:69— ModelMapping::map_model has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (20 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.
DeepLinkImportDialog.DeepLinkImportDialog::handleImport (cognitive 20) src/components/DeepLinkImportDialog.tsx:245— DeepLinkImportDialog.DeepLinkImportDialog::handleImport has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 2 (3 pts), boolean chains 2, 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, 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 (DeepLinkImportDialog.DeepLinkImportDialog) 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.
SubscriptionQuotaFooter.SubscriptionQuotaView (cognitive 20) src/components/SubscriptionQuotaFooter.tsx:225— SubscriptionQuotaFooter.SubscriptionQuotaView has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ToolUninstallConfirmDialog.ToolUninstallConfirmDialog (cognitive 20) src/components/apps/ToolUninstallConfirmDialog.tsx:28— ToolUninstallConfirmDialog.ToolUninstallConfirmDialog has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 3, ternaries 2 (3 pts) (nesting depth added 1). Of this number, 13 points are the body's own statements and 7 belong to 4 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.
OpenTerminalDialog.OpenTerminalDialog (cognitive 20) src/components/providers/OpenTerminalDialog.tsx:113— OpenTerminalDialog.OpenTerminalDialog has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 3, error handling 2. Of this number, 11 points are the body's own statements and 9 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.
UsageHeatmap.UsageHeatmap (cognitive 20) src/components/usage/UsageHeatmap.tsx:247— UsageHeatmap.UsageHeatmap has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 6, if/else 1, loops 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 383, showTooltip, a function literal at line 280, …). 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.
modelMetadata.indexModelsDev (cognitive 20) src/lib/modelMetadata.ts:174— modelMetadata.indexModelsDev has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
providerConfigUtils.setCodexAgentsString (cognitive 20) REDACTED:1546— providerConfigUtils.setCodexAgentsString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 2, 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.
PiTranscript::tool_result_message (cognitive 19) src-tauri/src/session_manager/providers/pi_blocks.rs:203— PiTranscript::tool_result_message has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UsageScriptModal.isOfficialSubscriptionProvider (cognitive 19) src/components/UsageScriptModal.tsx:202— UsageScriptModal.isOfficialSubscriptionProvider has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5, ternaries 1 (2 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.
useOmoModelSource.useOmoModelSource (cognitive 19) src/components/providers/forms/hooks/useOmoModelSource.ts:47— useOmoModelSource.useOmoModelSource has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 4 function literals inside it that branch (lines 264, 302, 94, …). 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.
modelMetadataFill.piCompletionsThinking (cognitive 19) src/components/providers/forms/modelMetadataFill.ts:193— modelMetadataFill.piCompletionsThinking has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (17 pts), boolean chains 2 (nesting depth added 10). 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, 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.
QuotaLines.SplitQuotaColumn (cognitive 19) src/components/quota/QuotaLines.tsx:478— QuotaLines.SplitQuotaColumn has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 3 function literals inside it that branch (lines 537, 505, 518). 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.
ProviderIcon.ProviderIcon (cognitive 18) REDACTED:22— ProviderIcon.ProviderIcon has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 2). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 66, 41, 32, …). 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.
PromptCopyDialog.PromptCopyDialog (cognitive 18) src/components/prompts/PromptCopyDialog.tsx:30— PromptCopyDialog.PromptCopyDialog has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 7, if/else 3 (nesting depth added 1). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 98, 55, 76, …). 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.
ProviderCard.isOfficialProvider (cognitive 18) src/components/providers/ProviderCard.tsx:120— ProviderCard.isOfficialProvider has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 5, ternaries 1 (2 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.
ClaudeStackModelsField.normalizeClaudeStackModels (cognitive 18) src/components/providers/forms/ClaudeStackModelsField.tsx:38— ClaudeStackModelsField.normalizeClaudeStackModels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 2 (4 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.
SessionStepDetails.SessionStepDetails (cognitive 18) src/components/sessions/reader/SessionStepDetails.tsx:350— SessionStepDetails.SessionStepDetails has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, ternaries 4 (5 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.
BackupStorageSection.BackupStorageSection (cognitive 18) src/components/settings/BackupStorageSection.tsx:33— BackupStorageSection.BackupStorageSection has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (5 pts), error handling 2, if/else 1 (nesting depth added 1). Of this number, 9 points are the body's own statements and 9 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.
UnifiedSkillsPanel.InstalledRow (cognitive 18) src/components/skills/UnifiedSkillsPanel.tsx:1785— UnifiedSkillsPanel.InstalledRow has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, ternaries 5 (6 pts) (nesting depth added 1). Of this number, 15 points are the body's own statements and 3 belong 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.
ModelsDevAutoSyncPanel.ModelsDevAutoSyncPanel (cognitive 18) src/components/usage/ModelsDevAutoSyncPanel.tsx:447— ModelsDevAutoSyncPanel.ModelsDevAutoSyncPanel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5, ternaries 5, boolean chains 4, error handling 4. 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: 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.
errorUtils.extractErrorMessage (cognitive 18) src/utils/errorUtils.ts:6— errorUtils.extractErrorMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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.
piPromptTemplate.findFrontmatterField (cognitive 18) src/lib/piPromptTemplate.ts:55— piPromptTemplate.findFrontmatterField has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 5, ternaries 2 (5 pts), if/else 2 (4 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
providerConfigUtils.getApiKeyFromConfig (cognitive 18) REDACTED:32— providerConfigUtils.getApiKeyFromConfig has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6, boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
textNormalization.scanTomlQuotes (cognitive 18) src/utils/textNormalization.ts:41— textNormalization.scanTomlQuotes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 4 (9 pts), boolean chains 8, loops 3 (6 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. This shape REPEATS in the file: one other method here (textNormalization.scanTomlQuotes::scan) 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.
UsageLogger::log_request (cognitive 17) src-tauri/src/proxy/usage/logger.rs:100— UsageLogger::log_request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HermesMemoryPanel.MemoryTabPane (cognitive 17) src/components/hermes/HermesMemoryPanel.tsx:111— HermesMemoryPanel.MemoryTabPane has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 3, if/else 1 (nesting depth added 2). Of this number, 15 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.
mcpDraft.specOf (cognitive 17) src/components/mcp/mcpDraft.ts:102— mcpDraft.specOf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiNativePromptResources.PiPromptTemplates (cognitive 17) src/components/prompts/PiNativePromptResources.tsx:763— PiNativePromptResources.PiPromptTemplates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 5, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 826, 894, 977, …). 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.
useModelState.parseModelsFromConfig (cognitive 17) src/components/providers/forms/hooks/useModelState.ts:41— useModelState.parseModelsFromConfig has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 12, boolean chains 4, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StructuredOptionsEditor.StructuredOptionsEditor (cognitive 17) src/components/providers/forms/StructuredOptionsEditor.tsx:89— StructuredOptionsEditor.StructuredOptionsEditor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 2, loops 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 6 function items inside it that branch (renameOption, commitDraft, a function literal at line 236, …). 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.
ManagedAccountsGroup.AccountRow (cognitive 17) src/components/settings/auth/ManagedAccountsGroup.tsx:551— ManagedAccountsGroup.AccountRow has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 16, ternaries 1. 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, 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.
UsageHero.UsageHero (cognitive 17) src/components/usage/UsageHero.tsx:207— UsageHero.UsageHero has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
UsageDisplaySection.UsageDisplaySection (cognitive 17) src/components/usage/UsageDisplaySection.tsx:49— UsageDisplaySection.UsageDisplaySection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 3. Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 10 function items inside it that branch (commitRate, toggleTodayItem, a function literal at line 152, …). 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.
requestOverrides.parseHeaderOverrideJson (cognitive 17) src/lib/requestOverrides.ts:112— requestOverrides.parseHeaderOverrideJson has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (2 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.
providerMetaUtils.mergeProviderMeta (cognitive 17) src/utils/providerMetaUtils.ts:10— providerMetaUtils.mergeProviderMeta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
textNormalization.scanTomlQuotes::scan (cognitive 17) src/utils/textNormalization.ts:74— textNormalization.scanTomlQuotes::scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (textNormalization.scanTomlQuotes) 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.
ClaudeProjection::of (cognitive 16) src-tauri/src/live/project/claude.rs:34— ClaudeProjection::of has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CopilotAuthManager::load_from_disk_sync (cognitive 16) src-tauri/src/proxy/providers/copilot_auth.rs:1574— CopilotAuthManager::load_from_disk_sync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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.
OmoService::delete_config_file (cognitive 16) src-tauri/src/services/omo.rs:424— OmoService::delete_config_file has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 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.
FullScreenPanel.FullScreenPanel (cognitive 16) src/components/common/FullScreenPanel.tsx:73— FullScreenPanel.FullScreenPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 1 (nesting depth added 3). 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 literals inside it that branch (lines 116, 96, 110, …). 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.
EnvWarningBanner.EnvWarningBanner (cognitive 16) src/components/env/EnvWarningBanner.tsx:25— EnvWarningBanner.EnvWarningBanner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, error handling 1, ternaries 1 (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 4 function items inside it that branch (getSourceDescription, toggleSelection, toggleSelectAll, …). 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.
McpFormModal.McpFormModal::submitSingle (cognitive 16) src/components/mcp/McpFormModal.tsx:411— McpFormModal.McpFormModal::submitSingle has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (6 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. This shape REPEATS in the file: one other method here (McpFormModal.McpFormModal) 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.
opencodeFormUtils.mergeOpencodeExtraOptionRows (cognitive 16) src/components/providers/forms/helpers/opencodeFormUtils.ts:280— opencodeFormUtils.mergeOpencodeExtraOptionRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, loops 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiProviderForm.fillPiModelDraft (cognitive 16) REDACTED:353— PiProviderForm.fillPiModelDraft has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6 (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.
StackSubagentFields.StackSubagentFields (cognitive 16) src/components/providers/mode/StackSubagentFields.tsx:69— StackSubagentFields.StackSubagentFields has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 3. Of this number, 10 points are the body's own statements and 6 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.
toolSummary.formatStepTitle (cognitive 16) src/components/sessions/reader/toolSummary.ts:231— toolSummary.formatStepTitle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SessionFinalReply.SessionFinalReply (cognitive 16) src/components/sessions/reader/SessionFinalReply.tsx:55— SessionFinalReply.SessionFinalReply has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 2, ternaries 2. Of this number, 12 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.
SessionOutline.SessionOutline (cognitive 16) src/components/sessions/reader/SessionOutline.tsx:46— SessionOutline.SessionOutline has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 3, ternaries 3. None of this is in the body itself: all 16 points belong to 4 function literals inside it that branch (lines 108, 78, 67, …). 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.
SessionManagerPage.SessionManagerPage::handleDeleteConfirm (cognitive 16) src/components/sessions/SessionManagerPage.tsx:462— SessionManagerPage.SessionManagerPage::handleDeleteConfirm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (SessionManagerPage.SessionManagerPage) 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.
GlobalProxySettings.GlobalProxySettings (cognitive 16) src/components/settings/GlobalProxySettings.tsx:73— GlobalProxySettings.GlobalProxySettings has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4, ternaries 4. Of this number, 11 points are the body's own statements and 5 belong to 3 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.
RepoManagerPanel.RepoManagerPanel (cognitive 16) src/components/skills/RepoManagerPanel.tsx:56— RepoManagerPanel.RepoManagerPanel has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 4 (6 pts), error handling 2, if/else 2 (nesting depth added 2). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (handleAdd, a function literal at line 186, handleOpenRepo, …). 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.
theme-provider.ThemeProvider (cognitive 16) src/components/theme-provider.tsx:51— theme-provider.ThemeProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, error handling 1, ternaries 1. None of this is in the body itself: all 16 points belong to 8 function items inside it that branch (getInitialTheme, a function literal at line 79, a function literal at line 115, …). 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.
format.formatTokensShort (cognitive 16) src/components/usage/format.ts:438— format.formatTokensShort has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PricingEditModal.PricingEditModal (cognitive 16) src/components/usage/PricingEditModal.tsx:23— PricingEditModal.PricingEditModal has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 4, if/else 2 (3 pts), error handling 1, loops 1 (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 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.
kimiProviderPresets.toKimiModel (cognitive 16) src/config/kimiProviderPresets.ts:103— kimiProviderPresets.toKimiModel has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), ternaries 5 (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, 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.
managedAccountUsage.findManagedAccountUsers (cognitive 16) src/lib/managedAccountUsage.ts:73— managedAccountUsage.findManagedAccountUsers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrayPanel.QuotaBlock (cognitive 16) src/tray-panel/TrayPanel.tsx:157— TrayPanel.QuotaBlock has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 4, if/else 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 188, 171). 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.
providerCapabilities.providerNeedsRouting (cognitive 16) src/utils/providerCapabilities.ts:148— providerCapabilities.providerNeedsRouting has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
providerConfigUtils.setCodexWireApi (cognitive 16) REDACTED:795— providerConfigUtils.setCodexWireApi has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (3 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.
providerConfigUtils.extractCodexExperimentalBearerToken (cognitive 16) REDACTED:1021— providerConfigUtils.extractCodexExperimentalBearerToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4, error handling 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tomlUtils.extractIdFromToml (cognitive 16) src/utils/tomlUtils.ts:189— tomlUtils.extractIdFromToml has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (5 members, 16 shared lines) · ×1
Near-duplicate member family (5 members, 16 shared lines) src-tauri/src/mcp/agy.rs:111— src-tauri/src/mcp/agy.rs:111-161 | src-tauri/src/mcp/kimi.rs:88-137 | src-tauri/src/mcp/mcode.rs:73-122 | src-tauri/src/mcp/omp.rs:206-250 | src-tauri/src/mcp/pi.rs:199-248 — These 5 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 33 shared lines) · ×1
Near-duplicate member family (3 members, 33 shared lines) src-tauri/src/session_manager/providers/claude.rs:138— src-tauri/src/session_manager/providers/claude.rs:138-277 | src-tauri/src/session_manager/providers/codex.rs:1967-2088 | src-tauri/src/session_manager/providers/openclaw.rs:149-263 — These 3 members are variants of one another: a block of 33 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) src-tauri/src/proxy/providers/streaming_responses.rs:377— src-tauri/src/proxy/providers/streaming_responses.rs:377-393 | src-tauri/src/proxy/providers/streaming_responses.rs:801-817 — 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.
Duplicated block (54 lines × 2) src-tauri/src/proxy/handlers.rs:1078— src-tauri/src/proxy/handlers.rs:1078-1131 | src-tauri/src/proxy/handlers.rs:1407-1460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41–46 lines × 2) src-tauri/src/proxy/handlers.rs:3271— src-tauri/src/proxy/handlers.rs:3271-3311 | src-tauri/src/proxy/response_processor.rs:683-728 — before extracting anything, compare `src-tauri/src/proxy/handlers.rs` and `src-tauri/src/proxy/response_processor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (41–42 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:2714— src-tauri/src/proxy/providers/streaming_responses.rs:2714-2754 | src-tauri/src/proxy/providers/streaming_responses.rs:2770-2811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41 lines × 2) src-tauri/src/proxy/providers/codex_oauth_auth.rs:2018— src-tauri/src/proxy/providers/codex_oauth_auth.rs:2018-2058 | src-tauri/src/proxy/providers/copilot_auth.rs:1444-1484 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_oauth_auth.rs` and `src-tauri/src/proxy/providers/copilot_auth.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (40 lines × 3) src-tauri/src/proxy/handlers.rs:1619— src-tauri/src/proxy/handlers.rs:1619-1658 | src-tauri/src/proxy/handlers.rs:1853-1892 | src-tauri/src/proxy/handlers.rs:2018-2057 — 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 (40 lines × 2) src-tauri/src/proxy/handlers.rs:1753— src-tauri/src/proxy/handlers.rs:1753-1792 | src-tauri/src/proxy/handlers.rs:2126-2165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38–40 lines × 2) src-tauri/src/proxy/providers/transform_codex_chat.rs:1045— src-tauri/src/proxy/providers/transform_codex_chat.rs:1045-1084 | src-tauri/src/proxy/providers/transform_codex_chat.rs:1086-1123 — both copies are in the same file, so extract the block into 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–38 lines × 2) src-tauri/src/proxy/handlers.rs:1141— src-tauri/src/proxy/handlers.rs:1141-1178 | src-tauri/src/proxy/handlers.rs:1458-1493 — both copies are in the same file, so extract the block into 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 lines × 2) src-tauri/src/app_config.rs:75— src-tauri/src/app_config.rs:75-110 | src-tauri/src/app_config.rs:196-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34–35 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3712— src-tauri/src/proxy/providers/streaming_responses.rs:3712-3745 | src-tauri/src/proxy/providers/streaming_responses.rs:4316-4350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31–32 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3080— src-tauri/src/proxy/providers/streaming_responses.rs:3080-3110 | src-tauri/src/proxy/providers/streaming_responses.rs:4354-4385 — both copies are in the same file, so extract the block into 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–28 lines × 2) src-tauri/src/config.rs:169— src-tauri/src/config.rs:169-196 | src-tauri/src/config.rs:216-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–26 lines × 2) src-tauri/src/lib.rs:2210— src-tauri/src/lib.rs:2210-2235 | src-tauri/src/lib.rs:2277-2300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) REDACTED:1307— REDACTED:1307-1332 | REDACTED:1421-1446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–24 lines × 2) src-tauri/src/commands/misc.rs:5354— src-tauri/src/commands/misc.rs:5354-5377 | src-tauri/src/commands/misc.rs:6049-6070 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) src-tauri/src/proxy/providers/streaming.rs:449— src-tauri/src/proxy/providers/streaming.rs:449-471 | src-tauri/src/proxy/providers/streaming.rs:636-658 — both copies are in the same file, so extract the block into 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–22 lines × 2) src-tauri/src/proxy/forwarder.rs:1128— src-tauri/src/proxy/forwarder.rs:1128-1149 | src-tauri/src/proxy/forwarder.rs:1228-1248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–22 lines × 2) src-tauri/src/proxy/handlers.rs:1715— src-tauri/src/proxy/handlers.rs:1715-1736 | src-tauri/src/proxy/handlers.rs:2095-2109 — both copies are in the same file, so extract the block into 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 × 6) src-tauri/src/services/balance.rs:82— src-tauri/src/services/balance.rs:82-102 | src-tauri/src/services/balance.rs:164-184 | src-tauri/src/services/balance.rs:229-249 | src-tauri/src/services/balance.rs:300-320 | src-tauri/src/services/balance.rs:376-396 | src-tauri/src/services/balance.rs:465-485 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–21 lines × 3) src-tauri/src/proxy/providers/streaming_responses.rs:3016— src-tauri/src/proxy/providers/streaming_responses.rs:3016-3032 | src-tauri/src/proxy/providers/streaming_responses.rs:3668-3688 | src-tauri/src/proxy/providers/streaming_responses.rs:4259-4275 — 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 (21 lines × 2) src-tauri/src/jsonc_document.rs:218— src-tauri/src/jsonc_document.rs:218-238 | src-tauri/src/jsonc_document.rs:257-277 — both copies are in the same file, so extract the block into 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–21 lines × 2) src-tauri/src/session_manager/providers/hermes.rs:34— src-tauri/src/session_manager/providers/hermes.rs:34-53 | src-tauri/src/session_manager/providers/opencode.rs:87-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20 lines × 3) src-tauri/src/mcp/claude.rs:19— src-tauri/src/mcp/claude.rs:19-38 | src-tauri/src/mcp/codex.rs:24-43 | src-tauri/src/mcp/gemini.rs:19-38 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/codex.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3033— src-tauri/src/proxy/providers/streaming_responses.rs:3033-3052 | src-tauri/src/proxy/providers/streaming_responses.rs:3700-3719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 5) REDACTED:1006— REDACTED:1006-1024 | REDACTED:1154-1171 | REDACTED:1508-1526 | REDACTED:1670-1687 | REDACTED:1961-1978 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–19 lines × 5) REDACTED:1001— REDACTED:1001-1019 | REDACTED:1503-1521 | REDACTED:1666-1682 | REDACTED:1758-1775 | REDACTED:1956-1973 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18–19 lines × 3) REDACTED:971— REDACTED:971-989 | REDACTED:1633-1650 | REDACTED:1929-1946 — 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 (18 lines × 3) src-tauri/src/mcp/claude.rs:95— src-tauri/src/mcp/claude.rs:95-112 | src-tauri/src/mcp/codex.rs:255-272 | src-tauri/src/mcp/gemini.rs:91-108 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/codex.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) src-tauri/src/commands/misc.rs:5731— src-tauri/src/commands/misc.rs:5731-5748 | src-tauri/src/commands/misc.rs:6100-6116 — both copies are in the same file, so extract the block into 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–18 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:186— src-tauri/src/proxy/providers/streaming_responses.rs:186-200 | src-tauri/src/proxy/providers/streaming_responses.rs:215-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 (14–18 lines × 2) src-tauri/src/proxy/providers/streaming_responses.rs:3407— src-tauri/src/proxy/providers/streaming_responses.rs:3407-3424 | src-tauri/src/proxy/providers/streaming_responses.rs:3472-3485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 4) REDACTED:968— REDACTED:968-984 | REDACTED:1630-1645 | REDACTED:1733-1748 | REDACTED:1926-1941 — 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 (16–17 lines × 3) src-tauri/src/proxy/handlers.rs:326— src-tauri/src/proxy/handlers.rs:326-341 | src-tauri/src/proxy/handlers.rs:1051-1066 | src-tauri/src/proxy/handlers.rs:1383-1399 — 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 (17 lines × 3) src-tauri/src/proxy/providers/streaming_responses.rs:3042— src-tauri/src/proxy/providers/streaming_responses.rs:3042-3058 | src-tauri/src/proxy/providers/streaming_responses.rs:3709-3725 | src-tauri/src/proxy/providers/streaming_responses.rs:4313-4329 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–17 lines × 3) src-tauri/src/services/session_usage_codex.rs:2357— src-tauri/src/services/session_usage_codex.rs:2357-2371 | src-tauri/src/services/session_usage_gemini.rs:296-310 | REDACTED:495-511 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (16–17 lines × 2) src-tauri/src/claude_mcp.rs:337— src-tauri/src/claude_mcp.rs:337-352 | src-tauri/src/gemini_mcp.rs:87-103 — before extracting anything, compare `src-tauri/src/claude_mcp.rs` and `src-tauri/src/gemini_mcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–16 lines × 4) REDACTED:951— REDACTED:951-966 | REDACTED:1116-1129 | REDACTED:1718-1731 | REDACTED:1911-1924 — 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 (16 lines × 3) src-tauri/src/proxy/providers/streaming_responses.rs:2622— src-tauri/src/proxy/providers/streaming_responses.rs:2622-2637 | src-tauri/src/proxy/providers/streaming_responses.rs:2897-2912 | src-tauri/src/proxy/providers/streaming_responses.rs:3112-3127 — 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–15 lines × 11) src-tauri/src/services/balance.rs:95— src-tauri/src/services/balance.rs:95-109 | src-tauri/src/services/balance.rs:177-191 | src-tauri/src/services/balance.rs:242-256 | src-tauri/src/services/balance.rs:313-327 | src-tauri/src/services/balance.rs:389-403 | src-tauri/src/services/balance.rs:478-492 | src-tauri/src/services/coding_plan.rs:195-209 | src-tauri/src/services/coding_plan.rs:579-593 | src-tauri/src/services/coding_plan.rs:661-675 | src-tauri/src/services/coding_plan.rs:924-936 | src-tauri/src/services/coding_plan.rs:1791-1805 — before extracting anything, compare `src-tauri/src/services/balance.rs` and `src-tauri/src/services/coding_plan.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–15 lines × 6) src-tauri/src/proxy/providers/streaming.rs:287— src-tauri/src/proxy/providers/streaming.rs:287-301 | src-tauri/src/proxy/providers/streaming.rs:421-435 | src-tauri/src/proxy/providers/streaming.rs:446-460 | src-tauri/src/proxy/providers/streaming.rs:633-647 | src-tauri/src/proxy/providers/streaming.rs:753-765 | src-tauri/src/proxy/providers/streaming.rs:784-796 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 4) src-tauri/src/proxy/handlers.rs:959— src-tauri/src/proxy/handlers.rs:959-972 | src-tauri/src/proxy/handlers.rs:1084-1097 | src-tauri/src/proxy/handlers.rs:1316-1329 | src-tauri/src/proxy/handlers.rs:1413-1426 — 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 (13 lines × 6) src-tauri/src/proxy/providers/streaming_responses.rs:2561— src-tauri/src/proxy/providers/streaming_responses.rs:2561-2573 | src-tauri/src/proxy/providers/streaming_responses.rs:2973-2985 | src-tauri/src/proxy/providers/streaming_responses.rs:3586-3598 | src-tauri/src/proxy/providers/streaming_responses.rs:4218-4230 | src-tauri/src/proxy/providers/streaming_responses.rs:4521-4533 | src-tauri/src/proxy/providers/streaming_responses.rs:4676-4688 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–13 lines × 3) src-tauri/src/proxy/handlers.rs:1714— src-tauri/src/proxy/handlers.rs:1714-1722 | src-tauri/src/proxy/handlers.rs:2094-2101 | src-tauri/src/proxy/response_processor.rs:512-524 — before extracting anything, compare `src-tauri/src/proxy/handlers.rs` and `src-tauri/src/proxy/response_processor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) src-tauri/src/proxy/providers/claude.rs:657— src-tauri/src/proxy/providers/claude.rs:657-669 | src-tauri/src/proxy/providers/codex.rs:970-982 | src-tauri/src/proxy/providers/gemini.rs:134-146 — before extracting anything, compare `src-tauri/src/proxy/providers/claude.rs` and `src-tauri/src/proxy/providers/codex.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 6) REDACTED:967— REDACTED:967-978 | REDACTED:1306-1317 | REDACTED:1420-1431 | REDACTED:1629-1640 | REDACTED:1732-1743 | REDACTED:1925-1936 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–12 lines × 4) src-tauri/src/proxy/providers/streaming_responses.rs:3408— src-tauri/src/proxy/providers/streaming_responses.rs:3408-3419 | src-tauri/src/proxy/providers/streaming_responses.rs:3473-3481 | src-tauri/src/proxy/providers/streaming_responses.rs:4414-4422 | src-tauri/src/proxy/providers/streaming_responses.rs:4473-4481 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–12 lines × 3) src-tauri/src/proxy/forwarder.rs:2851— src-tauri/src/proxy/forwarder.rs:2851-2862 | src-tauri/src/proxy/forwarder.rs:2917-2926 | src-tauri/src/proxy/forwarder.rs:2944-2953 — 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–11 lines × 13) src-tauri/src/services/balance.rs:83— src-tauri/src/services/balance.rs:83-92 | src-tauri/src/services/balance.rs:165-174 | src-tauri/src/services/balance.rs:230-239 | src-tauri/src/services/balance.rs:301-310 | src-tauri/src/services/balance.rs:377-386 | src-tauri/src/services/balance.rs:466-475 | src-tauri/src/services/coding_plan.rs:171-180 | src-tauri/src/services/coding_plan.rs:400-409 | src-tauri/src/services/coding_plan.rs:555-564 | src-tauri/src/services/coding_plan.rs:637-646 | src-tauri/src/services/coding_plan.rs:1778-1787 | REDACTED:418-428 | src-tauri/src/services/subscription_grok.rs:590-600 — before extracting anything, compare `src-tauri/src/services/balance.rs` and `src-tauri/src/services/coding_plan.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) src-tauri/src/proxy/handlers.rs:920— src-tauri/src/proxy/handlers.rs:920-930 | src-tauri/src/proxy/handlers.rs:1039-1049 | src-tauri/src/proxy/handlers.rs:1286-1296 | src-tauri/src/proxy/handlers.rs:1371-1381 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–11 lines × 3) src-tauri/src/commands/config.rs:242— src-tauri/src/commands/config.rs:242-252 | src-tauri/src/commands/config.rs:295-305 | src-tauri/src/commands/skill.rs:197-205 — 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 (11 lines × 3) src-tauri/src/mcp/kimi.rs:94— src-tauri/src/mcp/kimi.rs:94-104 | src-tauri/src/mcp/mcode.rs:79-89 | src-tauri/src/mcp/pi.rs:205-215 — before extracting anything, compare `src-tauri/src/mcp/kimi.rs` and `src-tauri/src/mcp/mcode.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (3–11 lines × 3) src-tauri/src/commands/misc.rs:1762— src-tauri/src/commands/misc.rs:1762-1772 | src-tauri/src/commands/misc.rs:2822-2830 | src-tauri/src/commands/misc.rs:2882-2884 — 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–11 lines × 2) src-tauri/src/proxy/providers/transform.rs:433— src-tauri/src/proxy/providers/transform.rs:433-440 | src-tauri/src/proxy/providers/transform_gemini.rs:594-604 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 × 8) src-tauri/src/services/coding_plan.rs:170— src-tauri/src/services/coding_plan.rs:170-179 | src-tauri/src/services/coding_plan.rs:399-408 | src-tauri/src/services/coding_plan.rs:554-563 | src-tauri/src/services/coding_plan.rs:636-645 | src-tauri/src/services/coding_plan.rs:893-902 | src-tauri/src/services/coding_plan.rs:1777-1786 | REDACTED:417-426 | src-tauri/src/services/subscription_grok.rs:589-598 — before extracting anything, compare `src-tauri/src/services/coding_plan.rs` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 4) src-tauri/src/proxy/handlers.rs:840— src-tauri/src/proxy/handlers.rs:840-849 | src-tauri/src/proxy/handlers.rs:1900-1908 | src-tauri/src/proxy/handlers.rs:2064-2072 | src-tauri/src/proxy/handlers.rs:2230-2238 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) src-tauri/src/proxy/handlers.rs:1671— src-tauri/src/proxy/handlers.rs:1671-1680 | src-tauri/src/proxy/handlers.rs:1897-1906 | src-tauri/src/proxy/handlers.rs:2061-2070 | src-tauri/src/proxy/handlers.rs:2227-2236 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 3) src-tauri/src/proxy/handlers.rs:609— src-tauri/src/proxy/handlers.rs:609-618 | src-tauri/src/proxy/handlers.rs:1712-1720 | src-tauri/src/proxy/handlers.rs:2092-2099 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 14) src-tauri/src/services/balance.rs:83— src-tauri/src/services/balance.rs:83-91 | src-tauri/src/services/balance.rs:165-173 | src-tauri/src/services/balance.rs:230-238 | src-tauri/src/services/balance.rs:301-309 | src-tauri/src/services/balance.rs:377-385 | src-tauri/src/services/balance.rs:466-474 | src-tauri/src/services/coding_plan.rs:171-179 | src-tauri/src/services/coding_plan.rs:400-408 | src-tauri/src/services/coding_plan.rs:555-563 | src-tauri/src/services/coding_plan.rs:637-645 | src-tauri/src/services/coding_plan.rs:894-902 | src-tauri/src/services/coding_plan.rs:1778-1786 | REDACTED:418-426 | src-tauri/src/services/subscription_grok.rs:590-598 — before extracting anything, compare `src-tauri/src/services/balance.rs` and `src-tauri/src/services/coding_plan.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 4) src-tauri/src/proxy/providers/codex_compaction.rs:347— src-tauri/src/proxy/providers/codex_compaction.rs:347-354 | src-tauri/src/proxy/providers/responses_late_arguments.rs:208-215 | src-tauri/src/proxy/providers/streaming_gemini.rs:261-269 | src-tauri/src/proxy/providers/transform_codex_responses_xai_sanitize.rs:1076-1083 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_compaction.rs` and `src-tauri/src/proxy/providers/responses_late_arguments.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–9 lines × 3) src-tauri/src/proxy/providers/transform.rs:435— src-tauri/src/proxy/providers/transform.rs:435-440 | src-tauri/src/proxy/providers/transform_gemini.rs:596-604 | src-tauri/src/proxy/providers/transform_responses.rs:2336-2341 — before extracting anything, compare `src-tauri/src/proxy/providers/transform.rs` and `src-tauri/src/proxy/providers/transform_responses.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 (8 lines × 4) src-tauri/src/proxy/handlers.rs:1597— src-tauri/src/proxy/handlers.rs:1597-1604 | src-tauri/src/proxy/handlers.rs:1799-1806 | src-tauri/src/proxy/handlers.rs:1959-1966 | src-tauri/src/proxy/handlers.rs:2184-2191 — 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 (2–8 lines × 4) src-tauri/src/mcp/hermes.rs:91— src-tauri/src/mcp/hermes.rs:91-97 | src-tauri/src/mcp/hermes.rs:148-149 | src-tauri/src/mcp/opencode.rs:89-91 | src-tauri/src/mcp/opencode.rs:164-171 — before extracting anything, compare `src-tauri/src/mcp/hermes.rs` and `src-tauri/src/mcp/opencode.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) src-tauri/src/proxy/providers/codex_chat_history.rs:381— src-tauri/src/proxy/providers/codex_chat_history.rs:381-387 | src-tauri/src/proxy/providers/codex_compaction.rs:345-351 | src-tauri/src/proxy/providers/responses_late_arguments.rs:206-212 | src-tauri/src/proxy/providers/streaming_gemini.rs:259-266 | src-tauri/src/proxy/providers/transform_codex_responses_xai_sanitize.rs:1074-1080 — before extracting anything, compare `src-tauri/src/proxy/providers/codex_compaction.rs` and `src-tauri/src/proxy/providers/responses_late_arguments.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5–7 lines × 2) src-tauri/src/proxy/providers/transform_codex_anthropic.rs:539— src-tauri/src/proxy/providers/transform_codex_anthropic.rs:539-543 | src-tauri/src/proxy/providers/transform_codex_anthropic.rs:575-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 12) src-tauri/src/services/balance.rs:102— src-tauri/src/services/balance.rs:102-107 | src-tauri/src/services/balance.rs:184-189 | src-tauri/src/services/balance.rs:249-254 | src-tauri/src/services/balance.rs:320-325 | src-tauri/src/services/balance.rs:396-401 | src-tauri/src/services/balance.rs:485-490 | src-tauri/src/services/coding_plan.rs:202-207 | src-tauri/src/services/coding_plan.rs:422-427 | src-tauri/src/services/coding_plan.rs:586-591 | src-tauri/src/services/coding_plan.rs:668-673 | src-tauri/src/services/coding_plan.rs:929-934 | src-tauri/src/services/coding_plan.rs:1798-1803 — before extracting anything, compare `src-tauri/src/services/balance.rs` and `src-tauri/src/services/coding_plan.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) src-tauri/src/services/mcp.rs:577— src-tauri/src/services/mcp.rs:577-583 | src-tauri/src/services/mcp.rs:615-621 | src-tauri/src/services/mcp.rs:653-659 | src-tauri/src/services/mcp.rs:687-692 | src-tauri/src/services/mcp.rs:717-723 | src-tauri/src/services/mcp.rs:755-761 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–5 lines × 3) src-tauri/src/commands/misc.rs:5318— src-tauri/src/commands/misc.rs:5318-5320 | src-tauri/src/commands/misc.rs:6042-6046 | src-tauri/src/commands/misc.rs:6078-6082 — 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 (48 lines × 2) REDACTED:1783— REDACTED:1783-1838 | REDACTED:1991-2038 — both copies are in the same file, so extract the block into 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 × 4) src-tauri/src/proxy/forwarder.rs:942— src-tauri/src/proxy/forwarder.rs:942-963 | src-tauri/src/proxy/forwarder.rs:1033-1052 | src-tauri/src/proxy/forwarder.rs:1139-1158 | src-tauri/src/proxy/forwarder.rs:1238-1257 — 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 (16 lines × 4) src-tauri/src/mcp/claude.rs:97— src-tauri/src/mcp/claude.rs:97-112 | src-tauri/src/mcp/codex.rs:257-272 | src-tauri/src/mcp/gemini.rs:93-108 | src-tauri/src/mcp/opencode.rs:265-280 — before extracting anything, compare `src-tauri/src/mcp/claude.rs` and `src-tauri/src/mcp/codex.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 5) src-tauri/src/mcp/agy.rs:148— src-tauri/src/mcp/agy.rs:148-161 | src-tauri/src/mcp/kimi.rs:124-137 | src-tauri/src/mcp/mcode.rs:109-122 | src-tauri/src/mcp/omp.rs:240-250 | src-tauri/src/mcp/pi.rs:235-248 — before extracting anything, compare `src-tauri/src/mcp/agy.rs` and `src-tauri/src/mcp/kimi.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) src-tauri/src/proxy/providers/claude.rs:607— src-tauri/src/proxy/providers/claude.rs:607-614 | src-tauri/src/proxy/providers/claude.rs:616-624 | src-tauri/src/proxy/providers/claude.rs:626-634 | src-tauri/src/proxy/providers/claude.rs:636-644 | src-tauri/src/proxy/providers/claude.rs:646-655 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 13) src-tauri/src/services/balance.rs:102— src-tauri/src/services/balance.rs:102-106 | src-tauri/src/services/balance.rs:184-188 | src-tauri/src/services/balance.rs:249-253 | src-tauri/src/services/balance.rs:320-324 | src-tauri/src/services/balance.rs:396-400 | src-tauri/src/services/balance.rs:485-489 | src-tauri/src/services/coding_plan.rs:202-206 | src-tauri/src/services/coding_plan.rs:422-426 | src-tauri/src/services/coding_plan.rs:586-590 | src-tauri/src/services/coding_plan.rs:668-672 | src-tauri/src/services/coding_plan.rs:929-933 | src-tauri/src/services/coding_plan.rs:1798-1802 | REDACTED:442-451 — before extracting anything, compare `src-tauri/src/services/balance.rs` and `src-tauri/src/services/coding_plan.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 5) src-tauri/src/mcp/agy.rs:128— src-tauri/src/mcp/agy.rs:128-132 | src-tauri/src/mcp/kimi.rs:104-108 | src-tauri/src/mcp/mcode.rs:89-93 | src-tauri/src/mcp/omp.rs:220-224 | src-tauri/src/mcp/pi.rs:215-219 — before extracting anything, compare `src-tauri/src/mcp/agy.rs` and `src-tauri/src/mcp/kimi.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
End-of-life runtime: Rust 1.95 rust-toolchain.toml:1— rust-toolchain.toml declares Rust 1.95 as this project's toolchain file, and Rust 1.95, superseded by 1.96 on 2026-05-28 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-05-28 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Low cohesion: MultiAppConfig (LCOM4 4) src-tauri/src/app_config.rs:627— MultiAppConfig's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
Duplication concentrated across 15 sibling directories (64 clone groups) src/components/mcp/UnifiedMcpPanel.tsx:420— 64 duplicated blocks under src/components/ have copies in at least two of the sibling directories apps, hermes, mcp, openclaw, profiles, prompts (+9 more sibling(s) not listed) — 34 of them are reported below, and 30 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 64 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 64 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 64 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 5 sibling directories (14 clone groups) src/hooks/useHermes.ts:94— 14 duplicated blocks under src/ have copies in at least two of the sibling directories components, hooks, lib, tray-panel, utils — 9 of them are reported below, and 5 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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 (331 matched lines × 2 locations) · ×1
Duplicated block with local edits (331 matched lines × 2 locations) src/components/providers/forms/HermesFormFields.tsx:36— src/components/providers/forms/HermesFormFields.tsx:36 · src/components/providers/forms/OpenClawFormFields.tsx:32 — the two spans are one implementation copied and then locally edited — 1753 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 (178 matched lines × 2 locations) · ×1
Duplicated block with local edits (178 matched lines × 2 locations) src/components/usage/ModelsDevAutoSyncPanel.tsx:105— src/components/usage/ModelsDevAutoSyncPanel.tsx:105 · src/components/usage/ModelsDevPickerDialog.tsx:73 — the two spans are one implementation copied and then locally edited — 990 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 (177 matched lines × 2 locations) · ×1
Duplicated block with local edits (177 matched lines × 2 locations) src/components/providers/forms/CodexOAuthSection.tsx:133— src/components/providers/forms/CodexOAuthSection.tsx:133 · src/components/providers/forms/CopilotAuthSection.tsx:117 — the two spans are one implementation copied and then locally edited — 775 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/settings/WebdavSyncSection.tsx:1061— src/components/settings/WebdavSyncSection.tsx:1061 · src/components/settings/WebdavSyncSection.tsx:1244 — the two spans are one implementation copied and then locally edited — 657 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 (120 matched lines × 2 locations) · ×1
Duplicated block with local edits (120 matched lines × 2 locations) src/components/prompts/PiPromptPanel.tsx:171— src/components/prompts/PiPromptPanel.tsx:171 · src/components/prompts/PromptPanel.tsx:244 — the two spans are one implementation copied and then locally edited — 729 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 (85 matched lines × 2 locations) · ×1
Duplicated block with local edits (85 matched lines × 2 locations) src/hooks/useSettings.ts:225— src/hooks/useSettings.ts:225 · src/hooks/useSettings.ts:371 — the two spans are one implementation copied and then locally edited — 351 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 (82 matched lines × 2 locations) · ×1
Duplicated block with local edits (82 matched lines × 2 locations) src/components/providers/forms/hooks/useHermesFormState.ts:77— src/components/providers/forms/hooks/useHermesFormState.ts:77 · src/components/providers/forms/hooks/useOpenclawFormState.ts:61 — the two spans are one implementation copied and then locally edited — 531 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 (80 identical lines × 2 files) src/components/usage/ModelStatsTable.tsx:1— src/components/usage/ModelStatsTable.tsx:1 · src/components/usage/ProviderStatsTable.tsx:1 — these 2 files are line-for-line copies of one another — 80 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 (58 lines × 2 locations) src/config/piProviderPresets.ts:3028— src/config/piProviderPresets.ts:3028 · src/config/piProviderPresets.ts:3124 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
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/providers/forms/ClaudeFormFields.tsx:919— src/components/providers/forms/ClaudeFormFields.tsx:919 · src/components/providers/forms/CodexFormFields.tsx:1451 — the two spans are one implementation copied and then locally edited — 233 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 (55 lines × 2 locations) src/config/piProviderPresets.ts:2844— src/config/piProviderPresets.ts:2844 · src/config/piProviderPresets.ts:2922 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
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/providers/forms/RequestHeadersEditor.tsx:36— src/components/providers/forms/RequestHeadersEditor.tsx:36 · src/components/providers/forms/StructuredOptionsEditor.tsx:63 — the two spans are one implementation copied and then locally edited — 284 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 (51 matched lines × 2 locations) · ×1
Duplicated block with local edits (51 matched lines × 2 locations) src/components/sessions/reader/SessionFinalReply.tsx:62— src/components/sessions/reader/SessionFinalReply.tsx:62 · src/components/sessions/reader/SessionQuestion.tsx:74 — the two spans are one implementation copied and then locally edited — 244 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 (48 matched lines × 2 locations) · ×1
Duplicated block with local edits (48 matched lines × 2 locations) src/components/workspace/DailyMemoryPanel.tsx:439— src/components/workspace/DailyMemoryPanel.tsx:439 · src/components/workspace/DailyMemoryPanel.tsx:497 — the two spans are one implementation copied and then locally edited — 242 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 (46 lines × 2 locations) REDACTED:747— REDACTED:747 · REDACTED:973 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (44 lines × 2 locations) src/lib/query/mutations.ts:102— src/lib/query/mutations.ts:102 · src/lib/query/mutations.ts:257 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (41 lines × 2 locations) src/components/openclaw/ToolsPanel.tsx:181— src/components/openclaw/ToolsPanel.tsx:181 · src/components/openclaw/ToolsPanel.tsx:223 — 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 (41 matched lines × 2 locations) · ×1
Duplicated block with local edits (41 matched lines × 2 locations) src/components/prompts/PiNativePromptResources.tsx:662— src/components/prompts/PiNativePromptResources.tsx:662 · src/components/prompts/PromptFormPanel.tsx:187 — the two spans are one implementation copied and then locally edited — 214 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 (40 lines × 2 locations) src/components/UsageScriptModal.tsx:1358— src/components/UsageScriptModal.tsx:1358 · src/components/UsageScriptModal.tsx:1449 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (37 lines × 2 locations) src/components/mcp/UnifiedMcpPanel.tsx:420— src/components/mcp/UnifiedMcpPanel.tsx:420 · src/components/skills/UnifiedSkillsPanel.tsx:459 — 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 (37 lines × 3 locations) src/components/providers/forms/AgyOAuthSection.tsx:131— src/components/providers/forms/AgyOAuthSection.tsx:131 · src/components/providers/forms/CodexOAuthSection.tsx:496 · src/components/providers/forms/CopilotAuthSection.tsx:440 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (30 matched lines × 2 locations) · ×1
Duplicated block with local edits (30 matched lines × 2 locations) src/components/settings/sections/RoutingSection.tsx:285— src/components/settings/sections/RoutingSection.tsx:285 · src/components/settings/sections/RoutingSection.tsx:349 — the two spans are one implementation copied and then locally edited — 123 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 (30 lines × 4 locations) src/config/hermesProviderPresets.ts:473— src/config/hermesProviderPresets.ts:473 · src/config/hermesProviderPresets.ts:503 · src/config/hermesProviderPresets.ts:533 · src/config/hermesProviderPresets.ts:563 — all 4 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
Complex function ProviderFormFull (cyclomatic 178, cognitive 155) src/components/providers/forms/ProviderForm.tsx:346— ProviderFormFull has cyclomatic complexity 178 and cognitive complexity 155; 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 performSubmit (cyclomatic 143, cognitive 157) src/components/providers/forms/ProviderForm.tsx:1671— performSubmit has cyclomatic complexity 143 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 CodexFormFields (cyclomatic 122, cognitive 95) src/components/providers/forms/CodexFormFields.tsx:535— CodexFormFields has cyclomatic complexity 122 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 handleSubmit (cyclomatic 85, cognitive 120) src/components/providers/forms/ProviderForm.tsx:1276— handleSubmit has cyclomatic complexity 85 and cognitive complexity 120; 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 DeepLinkImportDialog (cyclomatic 85, cognitive 66) src/components/DeepLinkImportDialog.tsx:86— DeepLinkImportDialog has cyclomatic complexity 85 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 ClaudeFormFields (cyclomatic 85, cognitive 59) src/components/providers/forms/ClaudeFormFields.tsx:184— ClaudeFormFields has cyclomatic complexity 85 and cognitive complexity 59; 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 ProviderCard (cyclomatic 83, cognitive 70) src/components/providers/ProviderCard.tsx:178— ProviderCard has cyclomatic complexity 83 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 (anonymous) (cyclomatic 71, cognitive 113) src/components/providers/AddProviderDialog.tsx:251— (anonymous) has cyclomatic complexity 71 and cognitive complexity 113; 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 UsageScriptModal (cyclomatic 70, cognitive 62) src/components/UsageScriptModal.tsx:248— UsageScriptModal has cyclomatic complexity 70 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 handlePresetChange (cyclomatic 58, cognitive 71) src/components/providers/forms/ProviderForm.tsx:2165— handlePresetChange has cyclomatic complexity 58 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SwitchModePanel (cyclomatic 58, cognitive 54) src/components/providers/mode/SwitchModePanel.tsx:101— SwitchModePanel has cyclomatic complexity 58 and cognitive complexity 54; 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 ToolRow (cyclomatic 57, cognitive 51) src/components/apps/AppsPage.tsx:700— ToolRow has cyclomatic complexity 57 and cognitive complexity 51; 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 UnifiedSkillsPanel (cyclomatic 57, cognitive 44) src/components/skills/UnifiedSkillsPanel.tsx:120— UnifiedSkillsPanel has cyclomatic complexity 57 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 WebdavSyncSection (cyclomatic 55, cognitive 47) src/components/settings/WebdavSyncSection.tsx:234— WebdavSyncSection has cyclomatic complexity 55 and cognitive complexity 47; 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 CodexOAuthSection (cyclomatic 54, cognitive 45) src/components/providers/forms/CodexOAuthSection.tsx:77— CodexOAuthSection has cyclomatic complexity 54 and cognitive complexity 45; 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 KimiProviderForm (cyclomatic 52, cognitive 43) src/components/providers/forms/KimiProviderForm.tsx:103— KimiProviderForm has cyclomatic complexity 52 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 renderRow (cyclomatic 47, cognitive 45) src/components/usage/RequestLogTable.tsx:368— renderRow has cyclomatic complexity 47 and cognitive complexity 45; 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 buildAdditiveSections (cyclomatic 46, cognitive 102) src/components/providers/presentation.ts:711— buildAdditiveSections has cyclomatic complexity 46 and cognitive complexity 102; 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 SessionItem (cyclomatic 45, cognitive 39) src/components/sessions/SessionItem.tsx:56— SessionItem has cyclomatic complexity 45 and cognitive complexity 39; 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 PiPromptPanel (cyclomatic 45, cognitive 38) src/components/prompts/PiPromptPanel.tsx:54— PiPromptPanel has cyclomatic complexity 45 and cognitive complexity 38; 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/config/openclawProviderPresets.ts · ×1
src/config/openclawProviderPresets.ts: 7258 lines of code src/config/openclawProviderPresets.ts:1— src/config/openclawProviderPresets.ts has 7258 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/config/codexProviderPresets.ts · ×1
src/config/codexProviderPresets.ts: 5044 lines of code src/config/codexProviderPresets.ts:1— src/config/codexProviderPresets.ts has 5044 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/config/opencodeProviderPresets.ts · ×1
src/config/opencodeProviderPresets.ts: 4758 lines of code src/config/opencodeProviderPresets.ts:1— src/config/opencodeProviderPresets.ts has 4758 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/config/hermesProviderPresets.ts · ×1
src/config/hermesProviderPresets.ts: 4014 lines of code src/config/hermesProviderPresets.ts:1— src/config/hermesProviderPresets.ts has 4014 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/config/piProviderPresets.ts · ×1
src/config/piProviderPresets.ts: 3476 lines of code src/config/piProviderPresets.ts:1— src/config/piProviderPresets.ts has 3476 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/config/claudeProviderPresets.ts · ×1
src/config/claudeProviderPresets.ts: 3061 lines of code src/config/claudeProviderPresets.ts:1— src/config/claudeProviderPresets.ts has 3061 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/providers/forms/ProviderForm.tsx · ×1
src/components/providers/forms/ProviderForm.tsx: 2956 lines of code src/components/providers/forms/ProviderForm.tsx:1— src/components/providers/forms/ProviderForm.tsx has 2956 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/config/claudeDesktopProviderPresets.ts · ×1
src/config/claudeDesktopProviderPresets.ts: 2516 lines of code src/config/claudeDesktopProviderPresets.ts:1— src/config/claudeDesktopProviderPresets.ts has 2516 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: 2224 lines of code REDACTED:1— REDACTED has 2224 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/providers/forms/CodexFormFields.tsx · ×1
src/components/providers/forms/CodexFormFields.tsx: 2214 lines of code src/components/providers/forms/CodexFormFields.tsx:1— src/components/providers/forms/CodexFormFields.tsx has 2214 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/skills/UnifiedSkillsPanel.tsx · ×1
src/components/skills/UnifiedSkillsPanel.tsx: 2021 lines of code src/components/skills/UnifiedSkillsPanel.tsx:1— src/components/skills/UnifiedSkillsPanel.tsx has 2021 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.tsx: 1793 lines of code src/App.tsx:1— src/App.tsx has 1793 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/WebdavSyncSection.tsx · ×1
src/components/settings/WebdavSyncSection.tsx: 1742 lines of code src/components/settings/WebdavSyncSection.tsx:1— src/components/settings/WebdavSyncSection.tsx has 1742 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/UsageScriptModal.tsx · ×1
src/components/UsageScriptModal.tsx: 1616 lines of code src/components/UsageScriptModal.tsx:1— src/components/UsageScriptModal.tsx has 1616 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: 1501 lines of code REDACTED:1— REDACTED has 1501 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/sessions/SessionManagerPage.tsx · ×1
src/components/sessions/SessionManagerPage.tsx: 1392 lines of code src/components/sessions/SessionManagerPage.tsx:1— src/components/sessions/SessionManagerPage.tsx has 1392 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/providers/forms/ClaudeDesktopProviderForm.tsx · ×1
src/components/providers/forms/ClaudeDesktopProviderForm.tsx: 1365 lines of code src/components/providers/forms/ClaudeDesktopProviderForm.tsx:1— src/components/providers/forms/ClaudeDesktopProviderForm.tsx has 1365 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/mcp/McpFormModal.tsx · ×1
src/components/mcp/McpFormModal.tsx: 1325 lines of code src/components/mcp/McpFormModal.tsx:1— src/components/mcp/McpFormModal.tsx has 1325 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/providers/forms/ClaudeFormFields.tsx · ×1
src/components/providers/forms/ClaudeFormFields.tsx: 1270 lines of code src/components/providers/forms/ClaudeFormFields.tsx:1— src/components/providers/forms/ClaudeFormFields.tsx has 1270 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/providers/forms/OmoFormFields.tsx · ×1
src/components/providers/forms/OmoFormFields.tsx: 1259 lines of code src/components/providers/forms/OmoFormFields.tsx:1— src/components/providers/forms/OmoFormFields.tsx has 1259 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/icons/extracted/metadata.ts · ×1
src/icons/extracted/metadata.ts: 1201 lines of code src/icons/extracted/metadata.ts:1— src/icons/extracted/metadata.ts has 1201 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/mcp/UnifiedMcpPanel.tsx · ×1
src/components/mcp/UnifiedMcpPanel.tsx: 1122 lines of code src/components/mcp/UnifiedMcpPanel.tsx:1— src/components/mcp/UnifiedMcpPanel.tsx has 1122 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/tray-panel/TrayPanel.tsx · ×1
src/tray-panel/TrayPanel.tsx: 1106 lines of code src/tray-panel/TrayPanel.tsx:1— src/tray-panel/TrayPanel.tsx has 1106 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/providers/forms/OpenCodeFormFields.tsx · ×1
src/components/providers/forms/OpenCodeFormFields.tsx: 1045 lines of code src/components/providers/forms/OpenCodeFormFields.tsx:1— src/components/providers/forms/OpenCodeFormFields.tsx has 1045 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/sessions/reader/SessionMarkdown.tsx · ×1
src/components/sessions/reader/SessionMarkdown.tsx: 1036 lines of code src/components/sessions/reader/SessionMarkdown.tsx:1— src/components/sessions/reader/SessionMarkdown.tsx has 1036 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/prompts/PiNativePromptResources.tsx · ×1
src/components/prompts/PiNativePromptResources.tsx: 999 lines of code src/components/prompts/PiNativePromptResources.tsx:1— src/components/prompts/PiNativePromptResources.tsx has 999 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/apps/useToolManagement.ts · ×1
src/components/apps/useToolManagement.ts: 991 lines of code src/components/apps/useToolManagement.ts:1— src/components/apps/useToolManagement.ts has 991 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/skills/SkillsPage.tsx · ×1
src/components/skills/SkillsPage.tsx: 987 lines of code src/components/skills/SkillsPage.tsx:1— src/components/skills/SkillsPage.tsx has 987 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/usage/UsageDashboard.tsx · ×1
src/components/usage/UsageDashboard.tsx: 980 lines of code src/components/usage/UsageDashboard.tsx:1— src/components/usage/UsageDashboard.tsx has 980 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/DeepLinkImportDialog.tsx · ×1
src/components/DeepLinkImportDialog.tsx: 979 lines of code src/components/DeepLinkImportDialog.tsx:1— src/components/DeepLinkImportDialog.tsx has 979 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/apps/AppsPage.tsx · ×1
src/components/apps/AppsPage.tsx: 967 lines of code src/components/apps/AppsPage.tsx:1— src/components/apps/AppsPage.tsx has 967 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/sessions/reader/turns.ts · ×1
src/components/sessions/reader/turns.ts: 958 lines of code src/components/sessions/reader/turns.ts:1— src/components/sessions/reader/turns.ts has 958 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/providers/presentation.ts · ×1
src/components/providers/presentation.ts: 927 lines of code src/components/providers/presentation.ts:1— src/components/providers/presentation.ts has 927 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/types.ts: 926 lines of code src/types.ts:1— src/types.ts has 926 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/config/piModelCatalog.ts · ×1
src/config/piModelCatalog.ts: 920 lines of code src/config/piModelCatalog.ts:1— src/config/piModelCatalog.ts has 920 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/providers/forms/ProviderPresetSelector.tsx · ×1
src/components/providers/forms/ProviderPresetSelector.tsx: 875 lines of code src/components/providers/forms/ProviderPresetSelector.tsx:1— src/components/providers/forms/ProviderPresetSelector.tsx has 875 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/providers/forms/KimiProviderForm.tsx · ×1
src/components/providers/forms/KimiProviderForm.tsx: 869 lines of code src/components/providers/forms/KimiProviderForm.tsx:1— src/components/providers/forms/KimiProviderForm.tsx has 869 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/config/grokBuildProviderPresets.ts · ×1
src/config/grokBuildProviderPresets.ts: 845 lines of code src/config/grokBuildProviderPresets.ts:1— src/config/grokBuildProviderPresets.ts has 845 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/config/geminiProviderPresets.ts · ×1
src/config/geminiProviderPresets.ts: 842 lines of code src/config/geminiProviderPresets.ts:1— src/config/geminiProviderPresets.ts has 842 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/sessions/reader/SessionReaderHeader.tsx · ×1
src/components/sessions/reader/SessionReaderHeader.tsx: 826 lines of code src/components/sessions/reader/SessionReaderHeader.tsx:1— src/components/sessions/reader/SessionReaderHeader.tsx has 826 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 (~121 LoC) src/components/ui/table.tsx— no import path from any entry point (43 application, 9 tooling, 265 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 (~82 LoC) src/components/ui/card.tsx— no import path from any entry point (43 application, 9 tooling, 265 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 (~56 LoC) src/components/ui/accordion.tsx— no import path from any entry point (43 application, 9 tooling, 265 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 (~52 LoC) src/components/ui/tabs.tsx— no import path from any entry point (43 application, 9 tooling, 265 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 (~48 LoC) src/components/ui/scroll-area.tsx— no import path from any entry point (43 application, 9 tooling, 265 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 (~41 LoC) src/components/ui/toggle-row.tsx— no import path from any entry point (43 application, 9 tooling, 265 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 (~21 LoC) src/components/common/ListItemRow.tsx— no import path from any entry point (43 application, 9 tooling, 265 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 (~16 LoC) src/hooks/useDebouncedValue.ts— no import path from any entry point (43 application, 9 tooling, 265 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 '@radix-ui/react-checkbox' — 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.
Blocking `thread::sleep` inside an `async` body src-tauri/src/services/kimi_oauth/lock.rs:196— This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`.
X14 · Bypassable address classification· IP classification is bypassable through an IPv4-in-IPv6 embedding · ×1
IP classification is bypassable through an IPv4-in-IPv6 embedding REDACTED:159— This function unwraps IPv4-MAPPED IPv6 (`::ffff: (in `extractIpv4Octets`)`, line 123) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 159 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright.
X2 · Cancellation propagation· Async function without AbortSignal · ×1
Async function without AbortSignal: copyImage src/components/sessions/reader/SessionImageLightbox.tsx:30— `copyImage` 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 })`.
Swallowed exception (caught, then discarded) src/components/sessions/SessionManagerPage.tsx:477— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Mock-dominated test: 连续切换预设时只认最后一次投影 tests/hooks/useDraftEditorProjection.test.tsx:44— 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: 投影失败时提示并保持没有底 tests/hooks/useDraftEditorProjection.test.tsx:96— This test sets up 4 test doubles (for example `vi.fn`) 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: 作废后迟到的投影不再生效 tests/hooks/useDraftEditorProjection.test.tsx:119— This test sets up 3 test doubles (for example `vi.fn`) 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: discards a pending Copilot projection after a form lifecycle %s tests/hooks/useDraftEditorProjection.test.tsx:149— 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: should call API and invalidate query cache after successful drag tests/hooks/useDragSort.test.tsx:89— This test sets up 4 test doubles (for example `vi.spyOn`) 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: should show error toast when drag operation fails tests/hooks/useDragSort.test.tsx:121— This test sets up 4 test doubles (for example `a double assigned in a shared setup`) 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: propagates export success message to toast with saved path tests/hooks/useImportExport.extra.test.tsx:108— 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: should export successfully with default filename and show path in toast tests/hooks/useImportExport.test.tsx:160— 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 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: should show error message when export fails tests/hooks/useImportExport.test.tsx:181— 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 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: should catch and show error when export throws exception tests/hooks/useImportExport.test.tsx:199— 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 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: should show error and return when user cancels save dialog during export tests/hooks/useImportExport.test.tsx:214— 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: should not request plugin sync when switching non-Claude provider tests/hooks/useProviderActions.test.tsx:185— This test sets up 4 test doubles (for example `a double assigned in a shared setup`) 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: should sync plugin config when switching Claude provider with integration enabled tests/hooks/useProviderActions.test.tsx:583— 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 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: should not call applyClaudePluginConfig when integration is disabled tests/hooks/useProviderActions.test.tsx:605— 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: should show error toast when plugin sync fails with error message tests/hooks/useProviderActions.test.tsx:625— This test sets up 4 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: should use default error message when plugin sync fails without error message tests/hooks/useProviderActions.test.tsx:662— This test sets up 4 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: should update provider and refresh cache when saveUsageScript succeeds tests/hooks/useProviderActions.test.tsx:714— 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: handles switch mutation errors silently tests/hooks/useProviderActions.test.tsx:868— 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: auto-saves and applies Claude onboarding skip when toggled on tests/hooks/useSettings.test.tsx:204— This test sets up 4 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: auto-saves and clears Claude onboarding skip when toggled off tests/hooks/useSettings.test.tsx:232— This test sets up 4 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: shows toast when Claude plugin sync fails but continues flow tests/hooks/useSettings.test.tsx:417— This test sets up 5 test doubles (for example `a double assigned in a shared setup`) 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: detects plugin toggle via live cache even when closure data is stale tests/hooks/useSettings.test.tsx:454— This test sets up 6 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: resets form, language and directories using server data tests/hooks/useSettings.test.tsx:495— 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 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 automatic invalidation separately from a user choice tests/components/CodexOAuthSection.test.tsx:683— This test sets up 4 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: keeps an unbound Codex Official provider ID unchanged tests/components/EditProviderDialog.test.tsx:478— This test sets up 3 test doubles (for example `vi.fn`) 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.
Duplicated predicate src/components/prompts/PiPromptPanel.tsx:193— `!(key in before) && key.startsWith("backup-")` appears character-identically in 2 files — src/components/prompts/PiPromptPanel.tsx, src/components/prompts/PromptPanel.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/UsageScriptModal.tsx:210— `!baseUrl || (typeof baseUrl === "string" && baseUrl.trim() === "")` appears character-identically in 2 files — src/components/UsageScriptModal.tsx, src/components/providers/ProviderCard.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/UsageScriptModal.tsx:219— `!bearerToken && (!apiKey || (typeof apiKey === "string" && apiKey.trim() === ""))` appears character-identically in 2 files — src/components/UsageScriptModal.tsx, src/components/providers/ProviderCard.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/openclaw/utils.ts:29— `!parsed || typeof parsed !== "object" || Array.isArray(parsed)` appears character-identically in 5 files — src/components/openclaw/utils.ts, src/components/providers/forms/hooks/useCodexConfigState.ts, src/components/providers/forms/hooks/useOpenclawFormState.ts, REDACTED. 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/modelMetadata.ts:187— `!provider || typeof provider !== "object"` appears character-identically in 2 files — src/lib/modelMetadata.ts, src/lib/modelsDevPricing.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/config/hermesProviderPresets.ts:23— `!settingsConfig || typeof settingsConfig !== "object"` appears character-identically in 2 files — src/config/hermesProviderPresets.ts, REDACTED. 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/providers/forms/ClaudeDesktopProviderForm.tsx:134— `!value || typeof value !== "object" || Array.isArray(value)` appears character-identically in 2 files — src/components/providers/forms/ClaudeDesktopProviderForm.tsx, src/config/piThinkingProfiles.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/UsageScriptModal.tsx:228— `(!apiKey || (typeof apiKey === "string" && apiKey.trim() === "")) && (!baseUrl || (typeof baseUrl === "string" && baseUrl.trim() === ""))` appears character-identically in 2 files — src/components/UsageScriptModal.tsx, src/components/providers/ProviderCard.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/usage/ModelsDevAutoSyncPanel.tsx:124— `(providerFilter === "all" || entry.providerId === providerFilter) && (!query || entry.modelId.toLowerCase().includes(query) || entry.normali…` appears character-identically in 2 files — src/components/usage/ModelsDevAutoSyncPanel.tsx, src/components/usage/ModelsDevPickerDialog.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/providers/forms/KimiProviderForm.tsx:277— `Boolean(apiKey) || Object.keys(requestHeaders).length > 0` appears character-identically in 3 files — src/components/providers/forms/KimiProviderForm.tsx, src/components/providers/forms/OpenCodeFormFields.tsx, REDACTED. 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/usage/RequestLogTable.tsx:74— `a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()` appears character-identically in 2 files — src/components/usage/RequestLogTable.tsx, src/components/usage/UsageDateRangePicker.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/providers/forms/ClaudeDesktopProviderForm.tsx:736— `account.id === accountId && !account.requires_reauth` appears character-identically in 2 files — src/components/providers/forms/ClaudeDesktopProviderForm.tsx, src/components/providers/forms/ProviderForm.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/providers/forms/ClaudeDesktopProviderForm.tsx:729— `account.id === effectiveAccountId && !account.reauth_required` appears character-identically in 2 files — src/components/providers/forms/ClaudeDesktopProviderForm.tsx, src/components/providers/forms/ProviderForm.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/providers/forms/ClaudeFormFields.tsx:947— `category !== "official" && category !== "cloud_provider"` appears character-identically in 3 files — src/components/providers/forms/ClaudeFormFields.tsx, src/components/providers/forms/ProviderForm.tsx, src/components/providers/forms/hooks/useApiKeyState.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/App.tsx:922— `event.key !== "Escape" || event.defaultPrevented` appears character-identically in 3 files — src/App.tsx, src/components/sessions/SessionManagerPage.tsx, src/components/skills/UnifiedSkillsPanel.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/apps/useToolManagement.ts:774— `extractErrorMessage(error) || String(error)` appears character-identically in 4 files — src/components/apps/useToolManagement.ts, src/components/mcp/UnifiedMcpPanel.tsx, src/components/skills/SkillsStorageSheet.tsx, src/components/usage/RequestDetailPanel.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/App.tsx:388— `extractErrorMessage(error) || t("common.unknown")` appears character-identically in 6 files — src/App.tsx, src/components/prompts/promptUtils.tsx, src/components/providers/mode/SwitchModePanel.tsx, src/lib/query/failover.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/mcp/UnifiedMcpPanel.tsx:720— `extractErrorMessage(loadError) || String(loadError)` appears character-identically in 2 files — src/components/mcp/UnifiedMcpPanel.tsx, src/components/skills/UnifiedSkillsPanel.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/usage/RequestLogTable.tsx:329— `i18n.resolvedLanguage || i18n.language || "en"` appears character-identically in 9 files — src/components/usage/RequestLogTable.tsx, src/components/usage/TablePagination.tsx, src/components/usage/UsageDashboard.tsx, src/components/usage/UsageDateRangePicker.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/providers/forms/ClaudeFormFields.tsx:285— `isFullUrl || !!customUserAgent || hasRequestOverrides` appears character-identically in 2 files — src/components/providers/forms/ClaudeFormFields.tsx, src/components/providers/forms/CodexFormFields.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/providers/forms/ClaudeFormFields.tsx:255— `localProxyHeadersOverride.trim() || localProxyBodyOverride.trim()` appears character-identically in 2 files — src/components/providers/forms/ClaudeFormFields.tsx, src/components/providers/forms/CodexFormFields.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/providers/forms/CodexOAuthSection.tsx:142— `mode !== "select" || !selectedAccountId || !onAccountSelect || !isStatusSuccess` appears character-identically in 2 files — src/components/providers/forms/CodexOAuthSection.tsx, src/components/providers/forms/CopilotAuthSection.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/JsonEditor.tsx:120— `parsed && typeof parsed === "object" && !Array.isArray(parsed)` appears character-identically in 4 files — src/components/JsonEditor.tsx, src/components/providers/forms/GeminiConfigEditor.tsx, REDACTED, src/components/providers/forms/hooks/useGeminiConfigState.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/UsageFooter.tsx:118— `provider.meta?.usage_script?.autoQueryInterval || 0` appears character-identically in 2 files — src/components/UsageFooter.tsx, src/components/providers/ProviderCard.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/CopilotQuotaFooter.tsx:41— `quota.error || t("subscription.queryFailed")` appears character-identically in 3 files — src/components/CopilotQuotaFooter.tsx, src/components/SubscriptionQuotaFooter.tsx, src/components/settings/auth/AccountQuota.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.
Silent fallback default on Err src-tauri/src/codex_history_migration.rs:906— `trusted_legacy_codex_model_provider_ids_from_config` turns every `Err` into `BTreeSet::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src-tauri/src/mode/stack.rs:397— `desktop_models` 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/proxy/providers/transform_codex_chat.rs:2480— `chat_error_to_response_error` turns every `Err` into `"Upstream error".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/proxy/tool_media.rs:348— `strip_media_from_tool_value_at_depth` 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/services/backup_storage.rs:155— `matched_files` 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/services/provider/codex_editor.rs:254— `inactive_fields` 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/services/provider/codex_official_models.rs:221— `split` (in `compare_versions`) 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/services/provider/grok_editor.rs:129— `inactive_fields` 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/services/provider/icon.rs:147— `strip_invalid_universal_icons` turns every `Err` into `Ok(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/services/provider/icon.rs:193— `strip_invalid_library_icons` turns every `Err` into `Ok(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 REDACTED:921— `parse_codex_reset_credits` turns every `Err` into `Some(None)` — 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/session_manager/providers/gemini.rs:31— `scan_sessions` 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/session_manager/providers/hermes.rs:216— `edge_messages` turns every `Err` into `HashMap::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/session_manager/providers/hermes.rs:306— `get_table_columns` 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/session_manager/providers/hermes.rs:648— `scan_sessions_jsonl` 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/session_manager/providers/opencode.rs:152— `scan_sessions_sqlite` 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/session_manager/providers/opencode.rs:202— `scan_sessions_sqlite_v1` 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/session_manager/providers/opencode.rs:226— `scan_sessions_sqlite_v2` 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.
Subsumed condition operand src-tauri/tests/import_export_sync.rs:771— `context.contains("原子写入失败")` can never decide this `||` — every value satisfying `context.contains("原子写入失败")` also satisfies `context.contains("写入失败")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/services/coding_plan.rs:36— `url.contains("open.bigmodel.cn")` can never decide this `||` — every value satisfying `url.contains("open.bigmodel.cn")` also satisfies `url.contains("bigmodel.cn")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/services/coding_plan.rs:1301— `c.contains("accessdenied")` can never decide this `||` — every value satisfying `c.contains("accessdenied")` also satisfies `c.contains("denied")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:94— `path.ends_with("/v1beta/openai/chat/completions")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/openai/chat/completions")` also satisfies `path.ends_with("/openai/chat/completions")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:95— `path.ends_with("/v1beta/openai/responses")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/openai/responses")` also satisfies `path.ends_with("/openai/responses")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:98— `path.ends_with("/v1/openai/chat/completions")` can never decide this `||` — every value satisfying `path.ends_with("/v1/openai/chat/completions")` also satisfies `path.ends_with("/openai/chat/completions")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:99— `path.ends_with("/v1/openai/responses")` can never decide this `||` — every value satisfying `path.ends_with("/v1/openai/responses")` also satisfies `path.ends_with("/openai/responses")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:112— `path.ends_with("/v1beta/models")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/models")` also satisfies `path.ends_with("/models")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:113— `path.ends_with("/v1beta/openai")` can never decide this `||` — every value satisfying `path.ends_with("/v1beta/openai")` also satisfies `path.ends_with("/openai")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:115— `path.ends_with("/v1/models")` can never decide this `||` — every value satisfying `path.ends_with("/v1/models")` also satisfies `path.ends_with("/models")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/gemini_url.rs:117— `path.ends_with("/v1/openai")` can never decide this `||` — every value satisfying `path.ends_with("/v1/openai")` also satisfies `path.ends_with("/openai")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/thinking_rectifier.rs:73— `lower.contains("redacted_thinking")` can never decide this `||` — every value satisfying `lower.contains("redacted_thinking")` also satisfies `lower.contains("thinking")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src-tauri/src/proxy/thinking_rectifier.rs:94— `lower.contains("redacted_thinking")` can never decide this `||` — every value satisfying `lower.contains("redacted_thinking")` also satisfies `lower.contains("thinking")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Silent fallback default in catch src/components/providers/OpenTerminalDialog.tsx:33— `readRecent` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/components/providers/forms/presetGroups.ts:71— `presetDomain` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/components/providers/forms/hooks/useCodexConfigState.ts:184— `useCodexConfigState.getCodexAuthApiKey` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/lib/updater.ts:20— `getCurrentVersion` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/lib/navigation.ts:107— `readStoredView` swallows every exception into `return "providers"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:84— `getApiKeyFromConfig` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Silent fallback default in catch tests/msw/handlers.ts:42— `withJson` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
Orphaned file src-tauri/src/commands/copilot.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/lib/api/copilot.ts: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/lib/requestOverrides.ts: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/database/dao/universal_providers.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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 42 significant file(s) lose their only recent owner: src-tauri/src/codex_history_migration.rs, src/config/claudeDesktopProviderPresets.ts, src-tauri/src/services/subscription_grok.rs, src/config/grokBuildProviderPresets.ts, src-tauri/src/services/profile.rs, src-tauri/src/pi_config/mod.rs, src/config/geminiProviderPresets.ts, src/components/settings/BackupListSection.tsx (+34 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (44 single-owned of 613 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 613 of the 775 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src-tauri/src/proxy/providers/transform_codex_chat_moonshot_schema.rs, src/components/ui/ime-safe-input.tsx.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `src-tauri` (272211 LoC, 712 module-visible types across 25 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 4 of 613 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; 613 of the 775 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/commands/copilot.rs, src/lib/requestOverrides.ts, src/lib/api/copilot.ts, src-tauri/src/database/dao/universal_providers.rs. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Unused export 'McpIcon' src/components/BrandIcons.tsx:89— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PiNativePromptResources' · ×1
Unused export 'PiNativePromptResources' src/components/prompts/PiNativePromptResources.tsx:1032— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CLAUDE_DESKTOP_DEFAULT_CONFIG' · ×1
Unused export 'CLAUDE_DESKTOP_DEFAULT_CONFIG' src/components/providers/forms/helpers/opencodeFormUtils.ts:7— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'TABLE_PAGE_SIZE' · ×1
Unused export 'TABLE_PAGE_SIZE' src/components/usage/TablePagination.tsx:143— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'useUpstreamProxyStatus' · ×1
Unused export 'useUpstreamProxyStatus' src/hooks/useGlobalProxy.ts:86— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'HERMES_WEB_OFFLINE_ERROR' · ×1
Unused export 'HERMES_WEB_OFFLINE_ERROR' src/hooks/useHermes.ts:21— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'McpImportResult' · ×1
Unused export 'McpImportResult' src/lib/api/deeplink.ts:69— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'restoreEnvBackup' · ×1
Unused export 'restoreEnvBackup' src/lib/api/env.ts:34— Nothing imports this binding — it is safe to review for removal.
Security headers incomplete — Set: Referrer-Policy. Missing: Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — 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.(−2.0 on this card.) The server: `.serve_connection(` (src-tauri/src/proxy/server.rs:204).
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 1/2 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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.
Null assertions (`!`) reduce the strict null checking score — ~0.3 `!` null assertions per 1k TypeScript source lines — 43 assertion(s) across the 152082 source line(s) of the 456 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: src/lib/query/sessions.ts (10), src/components/quota/QuotaLines.tsx (4), src/components/usage/TablePagination.tsx (4). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
Outdated: arboard — `arboard` is locked at 3.6.1 but 3.7.0 is the current stable release on crates.io, and it already satisfies the `"3.6"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arboard` and commit the updated REDACTED.
Outdated: bytes — `bytes` is locked at 1.11.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1.5"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.44 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: flate2 — `flate2` is locked at 1.1.9 but 1.1.10 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: futures — `futures` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` 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: http-body-util — `http-body-util` is locked at 0.1.3 but 0.1.5 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 http-body-util` and commit the updated REDACTED.
Outdated: hyper — `hyper` is locked at 1.8.1 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper` and commit the updated REDACTED.
Outdated: hyper-rustls — `hyper-rustls` is locked at 0.27.7 but 0.27.10 is the current stable release on crates.io, and it already satisfies the `"0.27"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper-rustls` 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: indexmap — `indexmap` is locked at 2.13.0 but 2.14.2 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 indexmap` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.183 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: log — `log` is locked at 0.4.29 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 log` and commit the updated REDACTED.
Outdated: once_cell — `once_cell` is locked at 1.21.3 but 1.21.4 is the current stable release on crates.io, and it already satisfies the `"1.21.3"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p once_cell` 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.10"` 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: rust_decimal — `rust_decimal` is locked at 1.40.0 but 1.43.0 is the current stable release on crates.io, and it already satisfies the `"1.33"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rust_decimal` and commit the updated REDACTED.
Outdated: rustls — `rustls` is locked at 0.23.37 but 0.23.46 is the current stable release on crates.io, and it already satisfies the `"0.23"` requirement declared in src-tauri/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls` and commit the updated REDACTED.
Outdated: rustls-native-certs — `rustls-native-certs` is locked at 0.8.3 but 0.8.5 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 rustls-native-certs` 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.0"` 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.149 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1.0"` 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: tauri — `tauri` is locked at 2.10.3 but 2.12.5 is the current stable release on crates.io, and it already satisfies the `"2.8.2"` 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.5.6 but 2.7.4 is the current stable release on crates.io, and it already satisfies the `"2.4.0"` 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.4.7 but 2.6.2 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.
+ 12 more in this group — see findings.md.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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 10 file(s) — `REDACTED`, `src/components/providers/forms/ProviderForm.tsx`, `src/components/providers/presentation.ts`, `src/components/sessions/utils.ts`, `src/components/usage/requestLogColumns.ts`, … (+5 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a174cf-1807-7f93-9227-a28ecf1528b8 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 151 · Warnings: 1966 · Recommendations: 151 · Info: 37 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 25-10-2026 @ 20:44 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.