Public report of musistudio/claude-code-router, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 12:04 UTC · Survey ID cd_9e78024ca46f4191af98477a704acfde
musistudio/claude-code-router
Measured 14 November 2026, 12:01 UTC, at code version 057abaa
CAI scoreAt riskNo change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 177,130 lines of product code in 7 projects, tests not counted · Estimated rebuild effort: about 1.4 person-years · Weakest lens: Code Health, 42
Findings by how serious they are
78 critical1200 serious208 minor
9 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 12:01 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
81of 81 dimensions measured by tools.
1452of 1486 findings point to an exact file and line, so you can open each one in the code. The other 34 concern the repository as a whole, such as missing documentation.
81dimensions across 7 lenses, read from 177,130 lines of product code in 7 projects.
musistudio/claude-code-router is rated At risk because critical security findings are open. It scores 47 out of 100, which the At risk rating leaves unchanged.
Code Health, at 42, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the package under a licence on your banned list, worth about 3 points. Splitting the oversized files would lift Code Health itself, worth about 4 points. Raising Code Health to 70 would lift the score to about 52.
Thirty-two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Thirty known security holes in the packages the code depends on can be used by attackers, and four weaknesses in the code could be used by an attacker. Pinning each tool to an exact version, updating the vulnerable packages and fixing the weaknesses the scanner points to would close these risks. Limiting each secret to its own step would fix the two secrets exposed to more of the pipeline than needed, and setting a waiting period for automatic updates would deal with the automatic dependency update that takes a new release at once. The three loops of files that import each other need breaking.
The product code is 177,130 lines, about €210,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.
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 927 findings
These 927 critical or serious findings were in the previous survey, on 26 October 2026, and are gone from this one. The first 100 are listed here.
Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
Rebuild cost: about €210,000 · Estimate
Cost to rebuild
€69,000 to €340,000, for 1,142 to 3,622 hours of work, about 1.4 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 47. 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: 177,130 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Banned license finding(s) in License Compliance — start with package.json.
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 4 points · Medium effort · Large Files
3
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
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 €210,000 to build again, about 1.4 person-years of work. Its weakest lens is Code Health, at 42 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 3 points for low effort, because it clears the 1 License Compliance findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 195,410 lines over the last 90 days, which is about 792,496 lines a year. At that pace, the extra work comes to an estimated 86.5 to 519.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 our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · 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.
165 modules, with 105 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 125 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.
docs.src uses docs.src.components.interactive.demoRuntime, so a change to docs.src.components.interactive.demoRuntime can break docs.src, while a change to docs.src can't break docs.src.components.interactive.demoRuntime.
Position
Below the diagonal: docs.src uses a module listed above it, which is the healthy direction.
packages.core.src.agents.claude-app uses packages.core.src.agents.cdp-client, so a change to packages.core.src.agents.cdp-client can break packages.core.src.agents.claude-app, while a change to packages.core.src.agents.claude-app can't break packages.core.src.agents.cdp-client.
Position
Below the diagonal: packages.core.src.agents.claude-app uses a module listed above it, which is the healthy direction.
packages.core.src.agents.codex uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.agents.codex, while a change to packages.core.src.agents.codex can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.agents.codex uses a module listed above it, which is the healthy direction.
packages.core.src.agents.local-providers uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.agents.local-providers, while a change to packages.core.src.agents.local-providers can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.agents.local-providers uses a module listed above it, which is the healthy direction.
packages.core.src.config uses packages.core.src.config.config-repository, so a change to packages.core.src.config.config-repository can break packages.core.src.config, while a change to packages.core.src.config can't break packages.core.src.config.config-repository.
Position
Below the diagonal: packages.core.src.config uses a module listed above it, which is the healthy direction.
packages.core.src.config uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.config, while a change to packages.core.src.config can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.config uses a module listed above it, which is the healthy direction.
packages.core.src.contracts uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.contracts, while a change to packages.core.src.contracts can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.contracts uses a module listed above it, which is the healthy direction.
packages.core.src.gateway.context-archive uses packages.core.src.config.config-repository, so a change to packages.core.src.config.config-repository can break packages.core.src.gateway.context-archive, while a change to packages.core.src.gateway.context-archive can't break packages.core.src.config.config-repository.
Position
Below the diagonal: packages.core.src.gateway.context-archive uses a module listed above it, which is the healthy direction.
packages.core.src.gateway.context-archive uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.gateway.context-archive, while a change to packages.core.src.gateway.context-archive can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.gateway.context-archive uses a module listed above it, which is the healthy direction.
packages.core.src.gateway.context-archive uses packages.core.src.gateway.context-archive.protocol, so a change to packages.core.src.gateway.context-archive.protocol can break packages.core.src.gateway.context-archive, while a change to packages.core.src.gateway.context-archive can't break packages.core.src.gateway.context-archive.protocol.
Position
Below the diagonal: packages.core.src.gateway.context-archive uses a module listed above it, which is the healthy direction.
packages.core.src.gateway.core-runtime uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.gateway.core-runtime, while a change to packages.core.src.gateway.core-runtime can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.gateway.core-runtime uses a module listed above it, which is the healthy direction.
packages.core.src.gateway.core-runtime uses packages.core.src.gateway.claude-code-router-plugin, so a change to packages.core.src.gateway.claude-code-router-plugin can break packages.core.src.gateway.core-runtime, while a change to packages.core.src.gateway.core-runtime can't break packages.core.src.gateway.claude-code-router-plugin.
Position
Below the diagonal: packages.core.src.gateway.core-runtime uses a module listed above it, which is the healthy direction.
packages.core.src.gateway.features.hosted-web-search uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.gateway.features.hosted-web-search, while a change to packages.core.src.gateway.features.hosted-web-search can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.gateway.features.hosted-web-search uses a module listed above it, which is the healthy direction.
packages.core.src.gateway.features.hosted-web-search uses packages.core.src.gateway.internal.shared, so a change to packages.core.src.gateway.internal.shared can break packages.core.src.gateway.features.hosted-web-search, while a change to packages.core.src.gateway.features.hosted-web-search can't break packages.core.src.gateway.internal.shared.
Position
Below the diagonal: packages.core.src.gateway.features.hosted-web-search uses a module listed above it, which is the healthy direction.
packages.core.src.mcp.toolhub-mcp uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.mcp.toolhub-mcp, while a change to packages.core.src.mcp.toolhub-mcp can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.mcp.toolhub-mcp uses a module listed above it, which is the healthy direction.
packages.core.src.media uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.media, while a change to packages.core.src.media can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.media uses a module listed above it, which is the healthy direction.
packages.core.src.media uses packages.core.src.media.contracts, so a change to packages.core.src.media.contracts can break packages.core.src.media, while a change to packages.core.src.media can't break packages.core.src.media.contracts.
Position
Below the diagonal: packages.core.src.media uses a module listed above it, which is the healthy direction.
packages.core.src.media.service uses packages.core.src.media.contracts, so a change to packages.core.src.media.contracts can break packages.core.src.media.service, while a change to packages.core.src.media.service can't break packages.core.src.media.contracts.
Position
Below the diagonal: packages.core.src.media.service uses a module listed above it, which is the healthy direction.
packages.core.src.observability uses packages.core.src.config.config-repository, so a change to packages.core.src.config.config-repository can break packages.core.src.observability, while a change to packages.core.src.observability can't break packages.core.src.config.config-repository.
Position
Below the diagonal: packages.core.src.observability uses a module listed above it, which is the healthy direction.
packages.core.src.observability uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.observability, while a change to packages.core.src.observability can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.observability uses a module listed above it, which is the healthy direction.
packages.core.src.observability uses packages.core.src.observability.request-log-runtime, so a change to packages.core.src.observability.request-log-runtime can break packages.core.src.observability, while a change to packages.core.src.observability can't break packages.core.src.observability.request-log-runtime.
Position
Below the diagonal: packages.core.src.observability uses a module listed above it, which is the healthy direction.
packages.core.src.plugins.backend-service uses packages.core.src.config.config-repository, so a change to packages.core.src.config.config-repository can break packages.core.src.plugins.backend-service, while a change to packages.core.src.plugins.backend-service can't break packages.core.src.config.config-repository.
Position
Below the diagonal: packages.core.src.plugins.backend-service uses a module listed above it, which is the healthy direction.
packages.core.src.profiles uses packages.core.src.agents.claude-code.auth-mode, so a change to packages.core.src.agents.claude-code.auth-mode can break packages.core.src.profiles, while a change to packages.core.src.profiles can't break packages.core.src.agents.claude-code.auth-mode.
Position
Below the diagonal: packages.core.src.profiles uses a module listed above it, which is the healthy direction.
packages.core.src.profiles uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.profiles, while a change to packages.core.src.profiles can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.profiles uses a module listed above it, which is the healthy direction.
packages.core.src.routing uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.routing, while a change to packages.core.src.routing can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.routing uses a module listed above it, which is the healthy direction.
packages.core.src.routing uses packages.core.src.routing.model-registry, so a change to packages.core.src.routing.model-registry can break packages.core.src.routing, while a change to packages.core.src.routing can't break packages.core.src.routing.model-registry.
Position
Below the diagonal: packages.core.src.routing uses a module listed above it, which is the healthy direction.
packages.core.src.usage uses packages.core.src.config.config-repository, so a change to packages.core.src.config.config-repository can break packages.core.src.usage, while a change to packages.core.src.usage can't break packages.core.src.config.config-repository.
Position
Below the diagonal: packages.core.src.usage uses a module listed above it, which is the healthy direction.
packages.core.src.usage uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.usage, while a change to packages.core.src.usage can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.usage uses a module listed above it, which is the healthy direction.
packages.core.src.usage.store uses packages.core.src.config.config-repository, so a change to packages.core.src.config.config-repository can break packages.core.src.usage.store, while a change to packages.core.src.usage.store can't break packages.core.src.config.config-repository.
Position
Below the diagonal: packages.core.src.usage.store uses a module listed above it, which is the healthy direction.
packages.ui.src.pages.home.components uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.ui.src.pages.home.components, while a change to packages.ui.src.pages.home.components can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.ui.src.pages.home.components uses a module listed above it, which is the healthy direction.
packages.ui.src.pages.home.components uses packages.ui.src.pages.home.shared.controls, so a change to packages.ui.src.pages.home.shared.controls can break packages.ui.src.pages.home.components, while a change to packages.ui.src.pages.home.components can't break packages.ui.src.pages.home.shared.controls.
Position
Below the diagonal: packages.ui.src.pages.home.components uses a module listed above it, which is the healthy direction.
packages.ui.src.pages.home.shared uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.ui.src.pages.home.shared, while a change to packages.ui.src.pages.home.shared can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.ui.src.pages.home.shared uses a module listed above it, which is the healthy direction.
packages.ui.src.pages.home.shared uses packages.ui.src.pages.home.shared.controls, so a change to packages.ui.src.pages.home.shared.controls can break packages.ui.src.pages.home.shared, while a change to packages.ui.src.pages.home.shared can't break packages.ui.src.pages.home.shared.controls.
Position
Below the diagonal: packages.ui.src.pages.home.shared uses a module listed above it, which is the healthy direction.
packages.ui.src.pages.tray uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.ui.src.pages.tray, while a change to packages.ui.src.pages.tray can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.ui.src.pages.tray uses a module listed above it, which is the healthy direction.
packages.core.src.gateway uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.gateway, while a change to packages.core.src.gateway can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.gateway uses a module listed above it, which is the healthy direction.
packages.core.src.gateway uses packages.core.src.gateway.claude-code-router-plugin, so a change to packages.core.src.gateway.claude-code-router-plugin can break packages.core.src.gateway, while a change to packages.core.src.gateway can't break packages.core.src.gateway.claude-code-router-plugin.
Position
Below the diagonal: packages.core.src.gateway uses a module listed above it, which is the healthy direction.
packages.core.src.gateway uses packages.core.src.gateway.context-archive.protocol, so a change to packages.core.src.gateway.context-archive.protocol can break packages.core.src.gateway, while a change to packages.core.src.gateway can't break packages.core.src.gateway.context-archive.protocol.
Position
Below the diagonal: packages.core.src.gateway uses a module listed above it, which is the healthy direction.
packages.core.src.gateway uses packages.core.src.routing.model-registry, so a change to packages.core.src.routing.model-registry can break packages.core.src.gateway, while a change to packages.core.src.gateway can't break packages.core.src.routing.model-registry.
Position
Below the diagonal: packages.core.src.gateway uses a module listed above it, which is the healthy direction.
packages.core.src.gateway uses packages.core.src.gateway.context-archive, so a change to packages.core.src.gateway.context-archive can break packages.core.src.gateway, while a change to packages.core.src.gateway can't break packages.core.src.gateway.context-archive.
Position
Below the diagonal: packages.core.src.gateway uses a module listed above it, which is the healthy direction.
packages.core.src.mcp uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.core.src.mcp, while a change to packages.core.src.mcp can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.core.src.mcp uses a module listed above it, which is the healthy direction.
packages.core.src.mcp uses packages.core.src.gateway.context-archive, so a change to packages.core.src.gateway.context-archive can break packages.core.src.mcp, while a change to packages.core.src.mcp can't break packages.core.src.gateway.context-archive.
Position
Below the diagonal: packages.core.src.mcp uses a module listed above it, which is the healthy direction.
packages.core.src.mcp uses packages.core.src.mcp.toolhub-mcp, so a change to packages.core.src.mcp.toolhub-mcp can break packages.core.src.mcp, while a change to packages.core.src.mcp can't break packages.core.src.mcp.toolhub-mcp.
Position
Below the diagonal: packages.core.src.mcp uses a module listed above it, which is the healthy direction.
packages.core.src.mcp uses packages.core.src.media.service, so a change to packages.core.src.media.service can break packages.core.src.mcp, while a change to packages.core.src.mcp can't break packages.core.src.media.service.
Position
Below the diagonal: packages.core.src.mcp uses a module listed above it, which is the healthy direction.
packages.core.src.plugins uses packages.core.src.config.config-repository, so a change to packages.core.src.config.config-repository can break packages.core.src.plugins, while a change to packages.core.src.plugins can't break packages.core.src.config.config-repository.
Position
Below the diagonal: packages.core.src.plugins uses a module listed above it, which is the healthy direction.
packages.core.src.plugins uses packages.core.src.plugins.backend-service, so a change to packages.core.src.plugins.backend-service can break packages.core.src.plugins, while a change to packages.core.src.plugins can't break packages.core.src.plugins.backend-service.
Position
Below the diagonal: packages.core.src.plugins uses a module listed above it, which is the healthy direction.
packages.electron.src.main.electron-web-search-mcp uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.electron.src.main.electron-web-search-mcp, while a change to packages.electron.src.main.electron-web-search-mcp can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.electron.src.main.electron-web-search-mcp uses a module listed above it, which is the healthy direction.
packages.electron.src.main.electron-web-search-mcp uses packages.core.src.gateway.context-archive, so a change to packages.core.src.gateway.context-archive can break packages.electron.src.main.electron-web-search-mcp, while a change to packages.electron.src.main.electron-web-search-mcp can't break packages.core.src.gateway.context-archive.
Position
Below the diagonal: packages.electron.src.main.electron-web-search-mcp uses a module listed above it, which is the healthy direction.
packages.electron.src.main uses packages.core.src.contracts.app, so a change to packages.core.src.contracts.app can break packages.electron.src.main, while a change to packages.electron.src.main can't break packages.core.src.contracts.app.
Position
Below the diagonal: packages.electron.src.main uses a module listed above it, which is the healthy direction.
packages.electron.src.main uses packages.core.src.gateway.context-archive, so a change to packages.core.src.gateway.context-archive can break packages.electron.src.main, while a change to packages.electron.src.main can't break packages.core.src.gateway.context-archive.
Position
Below the diagonal: packages.electron.src.main uses a module listed above it, which is the healthy direction.
packages.electron.src.main uses packages.electron.src.main.electron-web-search-mcp, so a change to packages.electron.src.main.electron-web-search-mcp can break packages.electron.src.main, while a change to packages.electron.src.main can't break packages.electron.src.main.electron-web-search-mcp.
Position
Below the diagonal: packages.electron.src.main uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 42% · Weak · gated by 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
93
High / Critical
A03:2025 — Software Supply Chain Failures
47
High / Critical
A02:2025 — Security Misconfiguration
4
High / Critical
A07:2025 — Authentication Failures
1
Medium
Roadmap
Top priorities: Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing; Resolve the 1 Banned license finding(s) in License Compliance — start with package.json.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Banned license finding(s) in License Compliance — start with package.json.
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 78
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 — 1200
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 — 208
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 9
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 81 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 81 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, 1452 of 1486 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the JavaScript/TypeScript suite(s) run through a browser-driven runner the coverage collector does not drive — the repository root (@playwright/test) — a gap in the analyzer, not something this repository is missing. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.ts, .tsx, .mjs) and the reliability runner does support this ecosystem — it drives jest, vitest, mocha and egg-bin — but every JavaScript/TypeScript test package this repository declares runs its suite in a real browser, which the re-runner has no way to launch. the root package declares `@playwright/test` and its `scripts.test` is `npm run test:packages && npm run test:architecture`. So flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's browser-driven test support, not a missing .ts/.tsx/.mjs runner and not a finding about this repository.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (packages/cli/package.json), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `packages/core/src/contracts/app.ts`, `REDACTED`, `packages/core/src/plugins/service.ts`, `REDACTED`, `packages/electron/src/main/ipc.ts`, … (+1 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. User interface: 125 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. Boot: crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:3458: page.addScriptTag: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe ran the repo's playwright suite against the booted app but captured no surfaces (suite failed to install/run, or visited no pages) — see runtime diagnostics.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (packages/core/src/storage/sqlite-native.ts:2), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (packages/core/src/storage/sqlite-native.ts:2), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (packages/core/src/storage/sqlite-native.ts:2), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (packages/core/src/storage/sqlite-native.ts:2), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P1 CI/CD gates — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
P2 Observability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 103 further occurrence(s) are not listed individually; the score already reflects all 143.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 669 further occurrence(s) are not listed individually; the score already reflects all 709.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 577 further occurrence(s) are not listed individually; the score already reflects all 617.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 57 further occurrence(s) are not listed individually; the score already reflects all 97.
R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 46 further occurrence(s) are not listed individually; the score already reflects all 86.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 178 further occurrence(s) are not listed individually; the score already reflects all 218.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 60 further occurrence(s) are not listed individually; the score already reflects all 100.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, 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.
X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 25 further occurrence(s) are not listed individually; the score already reflects all 65.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
306 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was GatewayRequestPipeline.proxyRequest at 142. A further 17 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 marketplace.pluginPermissionAlias at 40 — they are counted neither in the figure above nor in this dimension's score.
+ 266 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with GatewayRequestPipeline.proxyRequest (cyclomatic 142). — Refactoring it lifts Cyclomatic Complexity from 4.7 to about 5.0/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 309 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with GatewayRequestPipeline.proxyRequest (cognitive 153), profiles.AddProfileForm (cognitive 144), profiles.normalizeUnknownProfileItem (cognitive 135). — 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 3 together lifts Cognitive Complexity from 4.0 to about 4.5/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 70 FileTooLong finding(s) in God Classes — start with REDACTED (4), model-catalog.ts (2), REDACTED. — One of this dimension's main actionable groups (70 warning-level).
Resolve the 63 FunctionTooLong finding(s) in God Classes — start with providers.tsx (14), profiles.tsx (6), dashboard.tsx (5). — One of this dimension's main actionable groups (63 warning-level).
Resolve the 8 ClassTooLong finding(s) in God Classes — start with App.tsx, pipeline.ts, request-log-runtime.ts. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
6 production modules (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, with abstractness counted on 5 of the 6 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
D10 · Test Quality10.0 / 10Stronggated by 2 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
14 skipped (13 with a documented reason), 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1404 tests.
No assertions: generated Codex CLI middleware runtime is valid JavaScriptpackages/core/test/integration/agents/codex-cli-middleware-runtime.test.mjs:11
Skipped (documented): Fusion vision MCP sends the core API key and retries a body-free lightweight usage event · ×13packages/core/test/integration/mcp/fusion-vision-mcp.test.mjs:11
What to do
Resolve the 1 Skipped test finding(s) in Test Quality — start with electron-cdp.spec.ts. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No assertions finding(s) in Test Quality — start with codex-cli-middleware-runtime.test.mjs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
17 outdated direct production npm dependency(ies) of 25 graded, 0 pinning defect(s), across 6 package.json (5 of them the product) and 3 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 0 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.
Deprecated: glob · ×10REDACTED:226
Outdated (npm): @astrojs/react · ×17
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
1 of 520 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 520 package(s) this repository's committed lockfile installs for a consumer — its 25 production, optional and peer dependency(ies), across 5 product package.json manifest(s), and everything those install in turn. Its 32 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. 3 of them publish no licence this pass can read on registry.npmjs.org — an absent field, `UNLICENSED`, or a `SEE LICENSE IN <file>` pointer into a tarball this pass does not download; that is missing data, not a violation, and none of them is charged. This repository publishes itself under MIT, which is its own choice and is not judged here.
Banned license: pm2package.json:86
What to do
Resolve the 1 Banned license finding(s) in License Compliance — start with package.json. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
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: packages/ui/src/pages/home/App.tsx (35×524=18340); REDACTED (44×84=3696); packages/core/src/gateway/request/pipeline.ts (24×142=3408) Repeated repair below the complexity floor: REDACTED (5 of 7 changes were fixes); packages/core/src/gateway/http/io.ts (3 of 4 changes were fixes); packages/core/src/agents/local-providers/claude-code.ts (3 of 4 changes were fixes)
Resolve the 49 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (3), config-compiler.ts (2), model-catalog.ts (2). — One of this dimension's main actionable groups (49 warning-level).
Resolve the 4 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED, io.ts, claude-code.ts. — One of this dimension's main actionable groups (4 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 Factor5.1 / 10Adequate✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
107 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is REDACTED. Counted over 223 of the 318 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)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 156504 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.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 108 document(s) read across 7 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with package.json. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.
Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.
Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
2 of 7 build units (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: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
1 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: 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.
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).
93 finding(s): 0 critical, 40 high, 53 medium, 0 low. 30 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 13 file(s) — `docker/entrypoint.sh` (lines 176–177), `REDACTED`, `packages/core/src/contracts/app.ts` (line 1461, line 1462), `REDACTED` (line 894), `packages/core/src/observability/request-log-store.ts`, … (+8 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 1 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
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) charged to Static Analysis (SAST) — the other 30 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (32 issue-level, 2 of them charged here).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 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).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 29 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (15), REDACTED (14). — One of this dimension's main actionable groups (29 issue-level).
Resolve the 10 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5), REDACTED (5). — One of this dimension's main actionable groups (10 warning-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 223 of the 318 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 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with preload.ts. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 12 Change coupling finding(s) in Change Coupling — start with launch-core.ts (2), REDACTED (2), probe.ts (2). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with ipc-channels.ts, REDACTED, i18n.tsx. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
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. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 8 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text 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 & labels7.0 / 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 UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×4) — packages/ui/src/pages/home/components/profiles.tsx:2177, packages/ui/src/pages/home/components/settings.tsx:2569, packages/ui/src/pages/home/shared/controls.tsx:116, …
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. — packages/ui/src/pages/home/components/settings.tsx:1758
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.2 / 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.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — docs/src/components/Redirect.astro:16
With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled. — docs/src/layouts/DocsLayout.astro:141
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".
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. — packages/ui/src/pages/home/components/network-logs.tsx:1456
This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — packages/ui/src/pages/home/components/network-logs.tsx:2264
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.
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. — packages/ui/src/pages/home/components/api-keys.tsx:236
<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). (×4) — packages/ui/src/pages/home/components/dashboard.tsx:4916, packages/ui/src/pages/home/components/network-logs.tsx:158, packages/ui/src/pages/home/components/network-logs.tsx:516, …
<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). (×7) — packages/ui/src/pages/home/components/model-selector.tsx:190, packages/ui/src/pages/home/components/network-logs.tsx:232, packages/ui/src/pages/home/components/network-logs.tsx:319, …
`.overview-status-icon[data-tone="ok"]` sets color: #fff on background-color: #34c759 — 2.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/ui/src/styles/globals.css:577
`.overview-status-icon[data-tone="error"]` sets color: #fff on background-color: #ff3b30 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/ui/src/styles/globals.css:587
`.cta-button` sets color: #ffffff on background-color: #16a34a — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/src/styles/global.css:629
`.search input` 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. — docs/src/styles/global.css:517
`.overview-status-segment` moves (`transition: filter 140ms ease, transform 140ms ease`) 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. — packages/ui/src/styles/globals.css:599
`.overview-activity-cell` moves (`transition: filter 120ms ease, transform 120ms ease`) 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. — packages/ui/src/styles/globals.css:785
`.onboarding-step-panel` moves (`transition: opacity 180ms ease-out,
transform 240ms cubic-bezier(.22, 1, .36, 1),
visibility 0ms linear 180ms`) 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. — packages/ui/src/styles/globals.css:1456
`.onboarding-step-panel-active` moves (`transition: opacity 180ms ease-out 40ms,
transform 260ms cubic-bezier(.22, 1, .36, 1) 40ms,
visibility 0ms`) 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. — packages/ui/src/styles/globals.css:1470
`.onboarding-mascot-sprite-provider` moves (`animation: onboarding-mascot-sprite-run-provider 680ms steps(7, end) both,
onboarding-mascot-provider-motion 680ms cubic-bezier(.22, 1, .36, 1) both`) 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. — packages/ui/src/styles/globals.css:1478
`.onboarding-mascot-sprite-profile` moves (`animation: onboarding-mascot-sprite-run-profile 820ms steps(7, end) both,
onboarding-mascot-profile-motion 820ms cubic-bezier(.16, 1, .3, 1) both`) 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. — packages/ui/src/styles/globals.css:1484
`.onboarding-mascot-sprite-enter` moves (`animation: onboarding-mascot-sprite-run-enter 620ms steps(7, end) both,
onboarding-mascot-enter-motion 620ms cubic-bezier(.2, 1.1, .3, 1) both`) 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. — packages/ui/src/styles/globals.css:1490
`.cta-button` moves (`transition: background 140ms ease,
box-shadow 140ms ease,
transform 140ms ease`) 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. — docs/src/styles/global.css:640
`.code-copy .copy-icon` moves (`transition: opacity 160ms ease,
transform 160ms ease,
color 160ms ease`) 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. — docs/src/styles/global.css:1726
`.toc-inline summary svg:last-child` moves (`transition: transform 160ms ease`) 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. — docs/src/styles/global.css:1960
`.sidebar` moves (`transition: transform 180ms cubic-bezier(0.2, 0, 0.13, 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. — docs/src/styles/global.css:2212
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether 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 · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`notify` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — docs/src/components/interactive/ProvidersViewDemo.tsx:39
The guard above `return trimmed;` also returns `trimmed`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — packages/core/src/agents/bot-gateway/sdk-import.ts:17
Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition. — packages/core/src/providers/account-service.ts:2206
`quitApp` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:395
`shouldUseOnlineClaudeApp` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — REDACTED:14247
The guard above `return "*/*";` also returns `"*/*"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — REDACTED:14690
`frontendAssetsDisabled` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — REDACTED:16486
`openExternal` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/ui/src/web-client-bridge.ts:151
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. — tests/e2e/electron-cdp.spec.ts:35
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Do you agree with this assessment?
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified
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.
What to do
Run the test suite in CI via an explicit runner step (`npm test` for the toolchain this pipeline already uses) and gate merges on it.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 2/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `packages/cli`.
`REDACTED` reports through `console.*` at line 163 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:163
`REDACTED` reports through `console.*` at line 496 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:496
`REDACTED` reports through `console.*` at line 500 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:500
`REDACTED` reports through `console.*` at line 510 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:510
`REDACTED` reports through `console.*` at line 515 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:515
`REDACTED` reports through `console.*` at line 522 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:522
`REDACTED` reports through `console.*` at line 527 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:527
`REDACTED` reports through `console.*` at line 552 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:552
`REDACTED` reports through `console.*` at line 856 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:856
`packages/core/src/usage/store.ts` reports through `console.*` at line 405 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/usage/store.ts:405
`packages/core/src/usage/store.ts` reports through `console.*` at line 530 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/usage/store.ts:530
`packages/core/src/usage/store.ts` reports through `console.*` at line 539 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/usage/store.ts:539
`packages/core/src/usage/store.ts` reports through `console.*` at line 548 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/usage/store.ts:548
`packages/core/src/usage/store.ts` reports through `console.*` at line 557 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/usage/store.ts:557
`packages/core/src/usage/store.ts` reports through `console.*` at line 566 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/usage/store.ts:566
`packages/core/src/usage/store.ts` reports through `console.*` at line 578 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/usage/store.ts:578
`packages/core/src/storage/migration.ts` reports through `console.*` at line 13 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/storage/migration.ts:13
`REDACTED` reports through `console.*` at line 709 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:709
`REDACTED` reports through `console.*` at line 1891 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:1891
`REDACTED` reports through `console.*` at line 140 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:140
`REDACTED` reports through `console.*` at line 168 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:168
`REDACTED` reports through `console.*` at line 180 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:180
`REDACTED` reports through `console.*` at line 520 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:520
`REDACTED` reports through `console.*` at line 559 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:559
`REDACTED` reports through `console.*` at line 756 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:756
`REDACTED` reports through `console.*` at line 992 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:992
`packages/core/src/providers/model-catalog.ts` reports through `console.*` at line 191 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/providers/model-catalog.ts:191
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1352 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1352
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1361 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1361
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1370 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1370
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1425 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1425
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1435 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1435
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1445 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1445
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1480 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1480
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1485 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1485
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1490 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1490
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1739 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1739
`packages/core/src/profiles/launch-service.ts` reports through `console.*` at line 1905 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/core/src/profiles/launch-service.ts:1905
`REDACTED` reports through `console.*` at line 124 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:124
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 3 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
`package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:79
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×6) — packages/core/src/mcp/toolhub-mcp.ts:1074, REDACTED:34, REDACTED:39, …
What to do
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`mkdtempSync` in `runScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:64
`rmSync` in `runScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:131
`mkdtempSync` in `runWebScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:136
`rmSync` in `runWebScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:206
`mkdirSync` in `startBotGatewayQrLogin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/agents/bot-gateway/qr-login-service.ts:59
`mkdirSync` in `launchClaudeAppProfile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/agents/claude-app/launch.ts:55
`existsSync` in `launchCodexCompatibleAppProfile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:581
`appendFileSync` in `prepareCodexAppNetResponder` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1014
`readFileSync` in `waitForCodexDevToolsPort` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/agents/codex/media-preview-bridge.ts:233
`mkdirSync` in `open` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:195, packages/core/src/observability/request-log-store.ts:1400, packages/core/src/usage/store.ts:346
`existsSync` in `loadOnboardingFinished` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/config/onboarding-state.ts:17
`existsSync` in `readManagedCoreGatewayMarker` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:806
`readFileSync` in `readManagedCoreGatewayMarker` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:810
`rmSync` in `removeManagedCoreGatewayMarker` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:832
`openSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/media/executors.ts:130
`writeSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/media/executors.ts:143
`closeSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — packages/core/src/media/executors.ts:147, packages/core/src/media/executors.ts:151
`rmSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/media/executors.ts:148
`rmSync` in `importResult` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/media/service.ts:478
`existsSync` in `getBodyChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/observability/request-log-store.ts:1202
`mkdirSync` in `openSqliteStore` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:99, REDACTED:102
`writeFileSync` in `fetchPluginMarketplace` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/plugins/marketplace.ts:61
`existsSync` in `readCachedMarketplace` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/plugins/marketplace.ts:70
`readFileSync` in `readCachedMarketplace` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/plugins/marketplace.ts:75
`existsSync` in `cachedMarketplaceModulePath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/plugins/marketplace.ts:247
`readFileSync` in `cachedMarketplaceModulePath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/plugins/marketplace.ts:249
`writeFileSync` in `cachedMarketplaceModulePath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/plugins/marketplace.ts:263
`existsSync` in `openProfileFromCcr` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/profiles/launch-service.ts:139
`mkdirSync` in `downloadProviderIconCandidate` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:190
`writeFileSync` in `downloadProviderIconCandidate` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:192
`writeFileSync` in `openMacosTerminalCertificateInstaller` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1584
`chmodSync` in `openMacosTerminalCertificateInstaller` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1585
`mkdirSync` in `exportAppData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:809
`writeFileSync` in `exportAppData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:828
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety6.8 / 10Adequate✓ 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.
338 typed · 159 plain JS — the untyped files are cdn/public/ccr-provider-buttons.js, REDACTED, extension/chrome/confirm.js, REDACTED, packages/cli/test/integration/cli-help.test.mjs, packages/core/test/architecture/gateway-service-architecture.test.mjs (+153 more).
Do you agree with this assessment?
R10 · Code Duplication4.9 / 10Weak✓ Tool-verified
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
168 duplicated blocks under packages/core/src/ have copies in at least two of the sibling directories agents, config, contracts, gateway, mcp, media (+10 more sibling(s) not listed) — 116 of them are reported below, and 52 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 168 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 168 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 168 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. — packages/core/src/gateway/features/hosted-web-search/discovery.ts:568
150 duplicated blocks under packages/ have copies in at least two of the sibling directories cli, core, electron, ui — 113 of them are reported below, and 37 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 150 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 150 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 150 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. — REDACTED:936
29 duplicated blocks under packages/ui/src/pages/ have copies in at least two of the sibling directories browser, home, tray — 22 of them are reported below, and 7 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 29 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 29 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 29 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. — packages/ui/src/pages/home/shared/common.ts:176
12 of the duplicated blocks reported below have copies in at least two of the sibling directories claude-app, claude-code, codex, kilo, local-providers, opencode (+2 more sibling(s) not listed) under packages/core/src/agents/. That concentration is one structural fact, not 12 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 12 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. — REDACTED:17
10 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, scripts — 4 of them are reported below, and 6 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 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 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 10 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. — packages/core/src/observability/request-log-store.ts:4243
8 of the duplicated blocks reported below have copies in at least two of the sibling directories auth, context-archive, core-runtime, features, http, request (+1 more sibling(s) not listed) under packages/core/src/gateway/. That concentration is one structural fact, not 8 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 8 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. — packages/core/src/gateway/request/pipeline.ts:74
7 duplicated blocks under packages/ui/src/pages/home/ have copies in at least two of the sibling directories components, shared — 2 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 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/ui/src/pages/home/components/dashboard.tsx:2228
REDACTED:936 · packages/electron/src/main/ipc.ts:1147 — 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. — REDACTED:936
REDACTED:18 · REDACTED:34 — the two spans are one implementation copied and then locally edited — 1322 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:18
REDACTED:1878 · packages/ui/src/pages/home/shared/routing.ts:58 — the two spans are one implementation copied and then locally edited — 1165 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:1878
packages/core/src/gateway/features/codex-multi-agent-bridge.ts:16 · packages/core/src/gateway/features/codex-patch-bridge.ts:18 — the two spans are one implementation copied and then locally edited — 899 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/gateway/features/codex-multi-agent-bridge.ts:16
REDACTED:17 · REDACTED:29 — the two spans are one implementation copied and then locally edited — 1065 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:17
packages/core/src/gateway/features/codex-multi-agent-bridge.ts:242 · packages/core/src/gateway/features/codex-patch-bridge.ts:289 — the two spans are one implementation copied and then locally edited — 954 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/gateway/features/codex-multi-agent-bridge.ts:242
packages/ui/src/pages/home/shared/common.ts:176 · packages/ui/src/pages/tray/shared.tsx:386 — the 2 copies are spread across 2 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. — packages/ui/src/pages/home/shared/common.ts:176
packages/core/src/agents/claude-app/launch.ts:220 · REDACTED:1074 — the two spans are one implementation copied and then locally edited — 752 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/agents/claude-app/launch.ts:220
REDACTED:22 · REDACTED:26 — the two spans are one implementation copied and then locally edited — 748 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:22
packages/ui/src/pages/home/components/profiles.tsx:554 · packages/ui/src/pages/home/components/virtual-models.tsx:1042 — the two spans are one implementation copied and then locally edited — 638 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/pages/home/components/profiles.tsx:554
packages/ui/src/pages/home/shared/provider-accounts.ts:9 · packages/ui/src/pages/tray/shared.tsx:772 — the two spans are one implementation copied and then locally edited — 677 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/pages/home/shared/provider-accounts.ts:9
packages/core/src/gateway/features/hosted-web-search/discovery.ts:568 · packages/core/src/mcp/fusion-vision-mcp.ts:713 — the two spans are one implementation copied and then locally edited — 954 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/gateway/features/hosted-web-search/discovery.ts:568
packages/core/src/observability/request-log-store.ts:6344 · packages/core/src/usage/store.ts:1136 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/core/src/observability/request-log-store.ts:6344
packages/ui/src/pages/tray/TrayApp.tsx:25 · packages/ui/src/pages/tray/TrayDetailApp.tsx:16 — the two spans are one implementation copied and then locally edited — 527 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/pages/tray/TrayApp.tsx:25
packages/core/src/agents/bot-gateway/env.ts:204 · REDACTED:173 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/core/src/agents/bot-gateway/env.ts:204
packages/ui/src/pages/home/components/settings.tsx:865 · packages/ui/src/pages/home/components/virtual-models.tsx:729 — the two spans are one implementation copied and then locally edited — 582 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/pages/home/components/settings.tsx:865
packages/core/src/contracts/i18n.ts:79 · packages/core/src/contracts/i18n.ts:223 — the two spans are one implementation copied and then locally edited — 259 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/contracts/i18n.ts:79
REDACTED:1107 · packages/ui/src/pages/home/shared/common.ts:361 — the two spans are one implementation copied and then locally edited — 420 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:1107
REDACTED:3168 · packages/core/src/plugins/marketplace.ts:404 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:3168
packages/core/src/plugins/marketplace.ts:528 · packages/ui/src/pages/home/shared/extensions.ts:185 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/core/src/plugins/marketplace.ts:528
packages/ui/src/pages/home/components/dashboard.tsx:2228 · packages/ui/src/pages/home/shared/common.ts:449 — the 2 copies are spread across 2 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. — packages/ui/src/pages/home/components/dashboard.tsx:2228
packages/core/src/gateway/features/hosted-web-search/response-transform.ts:74 · packages/core/src/gateway/features/hosted-web-search/response-transform.ts:278 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/core/src/gateway/features/hosted-web-search/response-transform.ts:74
REDACTED:172 · packages/ui/src/pages/home/shared/profiles.ts:1104 — the two spans are one implementation copied and then locally edited — 395 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:172
packages/core/src/contracts/deep-link.ts:123 · packages/core/src/contracts/deep-link.ts:198 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/core/src/contracts/deep-link.ts:123
packages/core/src/observability/request-log-store.ts:6070 · packages/core/src/usage/store.ts:1074 — the two spans are one implementation copied and then locally edited — 357 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/observability/request-log-store.ts:6070
packages/ui/src/pages/home/components/api-keys.tsx:269 · packages/ui/src/pages/home/components/extensions.tsx:212 — the two spans are one implementation copied and then locally edited — 351 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/pages/home/components/api-keys.tsx:269
packages/ui/src/pages/home/shared/provider-accounts.ts:150 · packages/ui/src/pages/tray/shared.tsx:868 — the two spans are one implementation copied and then locally edited — 401 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/pages/home/shared/provider-accounts.ts:150
packages/ui/src/pages/home/shared/logs.ts:1036 · packages/ui/src/pages/home/shared/logs.ts:1216 — the two spans are one implementation copied and then locally edited — 311 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/pages/home/shared/logs.ts:1036
REDACTED:1206 · packages/electron/src/main/ipc.ts:1084 — 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. — REDACTED:1206
REDACTED:1327 · packages/electron/src/main/ipc.ts:1480 — 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. — REDACTED:1327
REDACTED:1276 · packages/electron/src/main/ipc.ts:1424 — 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. — REDACTED:1276
packages/core/src/providers/account-service.ts:2017 · packages/electron/src/main/provider-account-webcontent.ts:238 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/core/src/providers/account-service.ts:2017
packages/core/src/mcp/network-capture-mcp.ts:363 · packages/electron/src/main/electron-web-search-mcp.ts:1239 — the two spans are one implementation copied and then locally edited — 329 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/core/src/mcp/network-capture-mcp.ts:363
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.
proxyRequest has cyclomatic complexity 152 and cognitive complexity 172; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/gateway/request/pipeline.ts:123
handleOmeletteConnectRpc has cyclomatic complexity 112 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:2235
(anonymous) has cyclomatic complexity 91 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:3622
updateFromRawTrace has cyclomatic complexity 90 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/observability/request-log-store.ts:822
normalizeUnknownProfileItem has cyclomatic complexity 84 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/shared/profiles.ts:1540
runTool has cyclomatic complexity 76 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:773
setup has cyclomatic complexity 68 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:530
handleDesignRestApi has cyclomatic complexity 67 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:9815
App has cyclomatic complexity 66 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. — packages/ui/src/pages/home/App.tsx:182
routeMockRequest has cyclomatic complexity 64 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:895
pickConfig has cyclomatic complexity 62 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:769
parseBotGateway has cyclomatic complexity 61 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. — REDACTED:2221
parseProfile has cyclomatic complexity 57 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:3480
AddProfileForm has cyclomatic complexity 55 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/components/profiles.tsx:710
handleRequest has cyclomatic complexity 54 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/gateway/http/request-handler.ts:54
loadAppConfig has cyclomatic complexity 54 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:245
inferAgentFromText has cyclomatic complexity 54 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/observability/request-log-store.ts:2043
main has cyclomatic complexity 49 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/cli/src/cli.ts:74
(anonymous) has cyclomatic complexity 49 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/components/providers.tsx:4889
fetchUpstreamWithFallback has cyclomatic complexity 48 and cognitive complexity 91; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/gateway/upstream/executor.ts:291
assistantFullTextCandidates has cyclomatic complexity 48 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/observability/request-log-store.ts:2746
waitForReadiness has cyclomatic complexity 48 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1653
submitProviderDraft has cyclomatic complexity 48 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/App.tsx:1705
normalizeProfileItem has cyclomatic complexity 47 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/shared/profiles.ts:1395
waitForNextReadinessEvent has cyclomatic complexity 45 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1772
ProviderAccountSummaryCard has cyclomatic complexity 44 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/components/dashboard.tsx:2929
profileSummaryItems has cyclomatic complexity 44 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/shared/profiles.ts:1285
parseOpenRouterDiscountRouting has cyclomatic complexity 42 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1572
extractUsageSnapshot has cyclomatic complexity 41 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/observability/request-log-store.ts:6348
aggregateOpenAiResponsesStreamPayloads has cyclomatic complexity 40 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/shared/logs.ts:659
handleAdminRequest has cyclomatic complexity 40 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:4102
handleClaudeShipSessionApi has cyclomatic complexity 40 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:5197
normalizeBotGatewayRuntimeConfig has cyclomatic complexity 40 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. — packages/ui/src/pages/home/shared/profiles.ts:1171
AddProviderDialog has cyclomatic complexity 40 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/components/providers.tsx:3466
commentFromRequest has cyclomatic complexity 40 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:9472
synthesizeWeatherWebSearchAnswer has cyclomatic complexity 39 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/gateway/features/hosted-web-search/evidence.ts:358
parseProfileAgent has cyclomatic complexity 39 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:3801
applyPluginRegistration has cyclomatic complexity 38 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/plugins/service.ts:554
createVirtualModelDraftFromProfile has cyclomatic complexity 38 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/shared/virtual-models.ts:99
AddProviderForm has cyclomatic complexity 38 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pages/home/components/providers.tsx:1961
Do you agree with this assessment?
R3 · Large Files0.0 / 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.
REDACTED has 15598 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
REDACTED has 6922 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
packages/core/src/observability/request-log-store.ts has 6113 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/observability/request-log-store.ts:1
packages/ui/src/pages/home/components/dashboard.tsx has 6045 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/components/dashboard.tsx:1
packages/ui/src/pages/home/components/providers.tsx has 4874 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/components/providers.tsx:1
REDACTED has 3964 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
REDACTED has 3954 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
packages/ui/src/pages/home/App.tsx has 3382 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/App.tsx:1
REDACTED has 3340 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
packages/ui/src/pages/home/components/settings.tsx has 3284 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/components/settings.tsx:1
packages/core/src/mcp/toolhub-mcp.ts has 2712 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/mcp/toolhub-mcp.ts:1
packages/ui/src/pages/home/components/network-logs.tsx has 2666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/components/network-logs.tsx:1
packages/ui/src/pages/home/shared/i18n.tsx has 2556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/shared/i18n.tsx:1
packages/core/src/providers/account-service.ts has 2456 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/providers/account-service.ts:1
packages/core/src/contracts/app.ts has 2361 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/contracts/app.ts:1
packages/ui/src/pages/home/shared/providers.ts has 2286 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/shared/providers.ts:1
packages/ui/src/pages/home/components/profiles.tsx has 2205 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/components/profiles.tsx:1
packages/core/src/profiles/launch-service.ts has 1982 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/profiles/launch-service.ts:1
packages/core/src/providers/probe.ts has 1951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/providers/probe.ts:1
packages/core/src/observability/raw-trace-sync.ts 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. — packages/core/src/observability/raw-trace-sync.ts:1
REDACTED has 1730 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
packages/ui/src/pages/home/shared/profiles.ts has 1721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/shared/profiles.ts:1
packages/core/src/gateway/claude-code-router-plugin.ts has 1583 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/gateway/claude-code-router-plugin.ts:1
REDACTED has 1461 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
packages/electron/src/main/ipc.ts has 1441 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/electron/src/main/ipc.ts:1
packages/ui/src/pages/home/components/virtual-models.tsx has 1338 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/components/virtual-models.tsx:1
REDACTED has 1317 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
packages/core/src/gateway/request/pipeline.ts has 1293 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/gateway/request/pipeline.ts:1
packages/core/src/usage/store.ts has 1287 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/usage/store.ts:1
packages/ui/src/pages/home/shared/logs.ts has 1235 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/shared/logs.ts:1
packages/core/src/plugins/service.ts has 1231 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/plugins/service.ts:1
packages/electron/src/main/electron-web-search-mcp.ts has 1212 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/electron/src/main/electron-web-search-mcp.ts:1
packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts has 1163 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts:1
packages/core/src/mcp/fusion-vision-mcp.ts has 1161 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/mcp/fusion-vision-mcp.ts:1
packages/ui/src/pages/home/shared/virtual-models.ts has 1150 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pages/home/shared/virtual-models.ts:1
packages/core/src/gateway/upstream/executor.ts has 1147 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/gateway/upstream/executor.ts:1
packages/core/src/observability/request-log-runtime.ts has 1146 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/observability/request-log-runtime.ts:1
REDACTED has 1126 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
packages/core/src/gateway/features/hosted-web-search/response-transform.ts has 1059 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/gateway/features/hosted-web-search/response-transform.ts:1
packages/cli/src/cli.ts has 1006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/cli/src/cli.ts: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 Coverage8.7 / 10Strong✓ 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. (×37) — packages/ui/src/pages/home/App.tsx:1, REDACTED:1, packages/ui/src/pages/home/components/settings.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling6.7 / 10Adequate✓ 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.
test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
What to do
Add eslint as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code7.4 / 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.
2 file(s) (~1160 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — packages/cli
Unreachable from the 22 application, 10 tooling and 182 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 (22 application, 10 tooling, 182 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 (×13) — packages/core/src/mcp/fusion-vision-mcp.ts, packages/core/src/routing/route-script-worker.ts, packages/core/src/observability/request-log-worker.ts, …
Nothing imports this binding — it is safe to review for removal. (×18) — REDACTED:242, packages/core/src/agents/zcode/model-catalog.ts:77, packages/core/src/contracts/app.ts:130, …
Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists. (×7) — packages/ui/src/pages/home/shared/common.ts:39, packages/ui/src/pages/home/shared/common.ts:624, packages/ui/src/pages/home/shared/controls.tsx:253, …
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.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. — REDACTED:14
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.
Do you agree with this assessment?
R9 · Circular Imports4.4 / 10Weak✓ Tool-verified
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.
packages/core/src/agents/local-providers/codex.ts → REDACTED → REDACTED → packages/core/src/agents/local-providers/codex.ts (one verified cycle inside a mutually-dependent group of 4 files) — packages/core/src/agents/local-providers/codex.ts:17
Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository. Its Node HTTP listeners were read for HTTPS enforcement alone — TLS served, a redirect to https:// or HSTS, or a TLS-terminating proxy configuration committed beside the server — each judged per server package.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×4) — build/dev.mjs:130, build/dev.mjs:139, REDACTED:5672, …
`server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) (×3) — REDACTED:542, REDACTED:356, REDACTED:796
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 4 sites, not one: `build/dev.mjs:130` (createHash("sha1")), `build/dev.mjs:139` (createHash("sha1")), `REDACTED:5672` (createHash("sha1")), `REDACTED:5818` (createHash("sha1")). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Enforce HTTPS on each listed server: serve TLS itself, or redirect plain requests to `https://` and send `Strict-Transport-Security` (`helmet()` does by default) behind the TLS-terminating proxy — and commit that proxy's configuration beside the service. A server only this machine reaches should bind `127.0.0.1`.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 308) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 305 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. — packages/core/src/media/executors.ts:305
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.
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 document3.5 / 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.
`interpolateRawAppConfigEnvVars` is exported, takes a document from its caller (line 4179) and hands it to `interpolateEnvVars`, which calls itself at line 4192 (`interpolateEnvVars`) with a piece of `value` (and at line 4198) — and nowhere in `interpolateEnvVars` 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 `interpolateEnvVars` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:4192
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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 29/37 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`rpc` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/ui/src/web-client-bridge.ts:13
`routeClaudeDesignFetchRequest` 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 })`. — REDACTED:288
`fetchManifestText` awaits `https.request(…)` 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: `https.request(url, { signal })`. — packages/core/src/providers/manifest-service.ts:40
`post` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/core/src/mcp/toolhub-mcp.ts:1073
`fetchImportJob` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — REDACTED:35, REDACTED:77
`submitLoginState` 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 })`. — REDACTED:51
`submitCookies` 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 })`. — REDACTED:93
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped4.9 / 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.
`escapeHtml(basePath)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:6021
`escapeHtmlAttribute(href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. (×2) — REDACTED:14937, REDACTED:14994
`escapeHtmlAttribute(normalizedStylePath)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:14941
`escapeHtmlAttribute(normalizedScriptPath)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:14974
`escapeJsonForScript(me)` is text this program did not author, and it is written into a script or style context through markup this function returns 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — REDACTED:15122
`escapeJsonForScript(defaultModelId)` is text this program did not author, and it is written into a script or style context through markup this function returns 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — REDACTED:16197
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.
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. (×31) — packages/ui/src/web-client-bridge.ts:82, packages/ui/src/pages/home/shared/api-keys.ts:304, packages/ui/src/pages/home/shared/common.ts:114, …
`.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. (×4) — packages/ui/src/pages/home/App.tsx:351, packages/ui/src/pages/home/App.tsx:472, packages/ui/src/pages/home/shared/polling.ts:63, …
`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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×5) — REDACTED:3436, REDACTED:3476, REDACTED:3549, …
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.
5/7 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
~0.1 `!` null assertions per 1k TypeScript source lines — 23 assertion(s) across the 169989 source line(s) of the 317 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: packages/core/src/media/service.ts (4), docs/src/docs-structure.ts (3), docs/src/pages/search-index-[locale].json.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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 — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'better-sqlite3' (packages/core/src/storage/sqlite-native.ts:2) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'better-sqlite3' (packages/core/src/storage/sqlite-native.ts:2) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'better-sqlite3' (packages/core/src/storage/sqlite-native.ts:2) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 52 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's 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 — Not applicable: 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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — The runtime tier booted this repository's service, but crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:3458: page.addScriptTag: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe ran the repo's playwright suite against the booted app but captured no surfaces (suite failed to install/run, or visited no pages) — see runtime diagnostics. This repository also has a user interface (125 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates) that the booted service does not serve, and this scan has no strategy that reaches it — so no WCAG success criterion was verified in a rendered page on this run. That is a gap in OUR tooling, not a finding about your application: nothing here says the interface is inaccessible. The static accessibility checks still ran.
AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: this repository stores data through 'better-sqlite3' (packages/core/src/storage/sqlite-native.ts:2) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository stands up no server (no Express, Fastify, Koa, Hono, NestJS or similar app, no Next.js/SvelteKit/Nuxt server route, no edge function), creates no Supabase tables and talks to no hosted backend. Access control is therefore N/A here — a browser application or library is authorized by the server it calls, not by itself; a client-side route guard hides a page and authorizes nothing. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D11 Test Reliability — Test reliability not included — no browser-driven test runner (@playwright/test)
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D25 ADR Conformance — no ADRs to check
D32 Data Compliance (PII/GDPR) — 6 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D4 Code Duplication — This repository's production source (.ts, .tsx) is not read by D4's token comparison, which compares .NET source: duplication in it is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream. Not scored here — read the R10 card for this repository's duplication.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
DM1 Aggregate boundaries — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM10 One transaction, one aggregate — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM2 Strongly-typed ids — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM4 Rich vs anemic model — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM5 Encapsulated state — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM6 Domain ↔ infrastructure boundary — this TypeScript/JavaScript repository maps no type to a persistence framework (TypeORM/Prisma/MikroORM/Sequelize/Mongoose), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. 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 — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Import cycle (2 files) packages/ui/src/pages/home/shared/extensions.ts:17— packages/ui/src/pages/home/shared/extensions.ts → packages/ui/src/pages/home/shared/routing.ts → packages/ui/src/pages/home/shared/extensions.ts (one verified cycle inside a mutually-dependent group of 5 files)
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×1
Hover-only interaction on <div> packages/ui/src/pages/home/components/network-logs.tsx:1456— 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.
Banned license: pm2 package.json:86— `pm2` 7.0.4 is published on registry.npmjs.org under `AGPL-3.0`, which this policy bans, and it is a production, optional or peer dependency this repository's committed lockfile resolves — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception.
Boundary-crossing change coupling: preload.ts ↔ electron.d.ts packages/electron/src/main/preload.ts:1— `packages/electron/src/main/preload.ts` (context electron) and `packages/ui/src/types/electron.d.ts` (context ui) sit in DIFFERENT parts of the tree yet change together 100% of the time (17 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) — 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 17 shared commits counted here, the most recent 3 are `923c7421` Add overview statistics reset with persistent reset tracking; `9e7d4f78` Implement router enhancements; `4097bbe5` Improve router configuration and request handling — run `git show` on any of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 12322 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 11822 over it, 24.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/dashboard.tsx packages/ui/src/pages/home/components/dashboard.tsx— FileTooLong — 5164 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4664 over it, 10.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: observability/request-log-store.ts packages/core/src/observability/request-log-store.ts— FileTooLong — 5061 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4561 over it, 10.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/providers.tsx packages/ui/src/pages/home/components/providers.tsx— FileTooLong — 4366 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3866 over it, 8.73× 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 — 3276 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2776 over it, 6.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 3071 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2571 over it, 6.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/settings.tsx packages/ui/src/pages/home/components/settings.tsx— FileTooLong — 2853 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2353 over it, 5.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: home/App.tsx packages/ui/src/pages/home/App.tsx— FileTooLong — 2754 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: App (182-3630). The bar is 500 significant lines; this is 2254 over it, 5.51× 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: REDACTED REDACTED— FileTooLong — 2648 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2148 over it, 5.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: components/network-logs.tsx packages/ui/src/pages/home/components/network-logs.tsx— FileTooLong — 2368 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1868 over it, 4.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: mcp/toolhub-mcp.ts packages/core/src/mcp/toolhub-mcp.ts— FileTooLong — 2182 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1682 over it, 4.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: contracts/app.ts packages/core/src/contracts/app.ts— FileTooLong — 2086 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1586 over it, 4.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/profiles.tsx packages/ui/src/pages/home/components/profiles.tsx— FileTooLong — 1959 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1459 over it, 3.92× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: providers/account-service.ts packages/core/src/providers/account-service.ts— FileTooLong — 1923 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1423 over it, 3.85× 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: shared/providers.ts packages/ui/src/pages/home/shared/providers.ts— FileTooLong — 1814 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1314 over it, 3.63× 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: profiles/launch-service.ts packages/core/src/profiles/launch-service.ts— FileTooLong — 1577 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1077 over it, 3.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: providers/probe.ts packages/core/src/providers/probe.ts— FileTooLong — 1503 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1003 over it, 3.01× 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: shared/profiles.ts packages/ui/src/pages/home/shared/profiles.ts— FileTooLong — 1392 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 892 over it, 2.78× 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: observability/raw-trace-sync.ts packages/core/src/observability/raw-trace-sync.ts— FileTooLong — 1391 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 891 over it, 2.78× 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 — 1386 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 886 over it, 2.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: gateway/claude-code-router-plugin.ts packages/core/src/gateway/claude-code-router-plugin.ts— FileTooLong — 1246 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 746 over it, 2.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: components/virtual-models.tsx packages/ui/src/pages/home/components/virtual-models.tsx— FileTooLong — 1201 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 701 over it, 2.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1168 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 668 over it, 2.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: main/ipc.ts packages/electron/src/main/ipc.ts— FileTooLong — 1166 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 666 over it, 2.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: request/pipeline.ts packages/core/src/gateway/request/pipeline.ts— FileTooLong — 1089 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: GatewayRequestPipeline (114-1205). The bar is 500 significant lines; this is 589 over it, 2.18× 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.
FunctionTooLong: App.App packages/ui/src/pages/home/App.tsx:182— FunctionTooLong — App runs 2617 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2517 over it, 26.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: providers.AddProviderForm packages/ui/src/pages/home/components/providers.tsx:1961— FunctionTooLong — AddProviderForm 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: providers.ProviderUsageSettings packages/ui/src/pages/home/components/providers.tsx:2888— FunctionTooLong — ProviderUsageSettings runs 381 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 281 over it, 3.81× 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: dashboard.OverviewView packages/ui/src/pages/home/components/dashboard.tsx:48— FunctionTooLong — OverviewView runs 377 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 277 over it, 3.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: profiles.AddProfileForm packages/ui/src/pages/home/components/profiles.tsx:710— FunctionTooLong — AddProfileForm runs 366 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: providers.ModelMetadataEditor packages/ui/src/pages/home/components/providers.tsx:4669— FunctionTooLong — ModelMetadataEditor runs 365 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: providers.ProviderModelPicker packages/ui/src/pages/home/components/providers.tsx:3900— FunctionTooLong — ProviderModelPicker runs 333 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 233 over it, 3.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: settings.TraySettingsPage packages/ui/src/pages/home/components/settings.tsx:1908— FunctionTooLong — TraySettingsPage runs 333 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 233 over it, 3.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: routing.AddRoutingRuleDialog packages/ui/src/pages/home/components/routing.tsx:375— FunctionTooLong — AddRoutingRuleDialog runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.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: settings.BotConfigDialog packages/ui/src/pages/home/components/settings.tsx:1453— FunctionTooLong — BotConfigDialog runs 318 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 218 over it, 3.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: network-logs.LogsView packages/ui/src/pages/home/components/network-logs.tsx:353— FunctionTooLong — LogsView runs 292 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: media-preview-bridge.codexMediaPreviewPageBootstrap packages/core/src/agents/codex/media-preview-bridge.ts:375— FunctionTooLong — codexMediaPreviewPageBootstrap runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: dashboard.CodexResetCreditDialog packages/ui/src/pages/home/components/dashboard.tsx:3640— FunctionTooLong — CodexResetCreditDialog runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.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: network-logs.LogJsonPanel packages/ui/src/pages/home/components/network-logs.tsx:1782— FunctionTooLong — LogJsonPanel runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.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: onboarding.OnboardingView packages/ui/src/pages/home/components/onboarding.tsx:40— FunctionTooLong — OnboardingView runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.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: executor.fetchUpstreamWithFallback packages/core/src/gateway/upstream/executor.ts:291— FunctionTooLong — fetchUpstreamWithFallback runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× 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: main.BrowserChrome packages/ui/src/pages/browser/main.tsx:31— FunctionTooLong — BrowserChrome runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× 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: providers.ProvidersView packages/ui/src/pages/home/components/providers.tsx:31— FunctionTooLong — ProvidersView runs 261 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 161 over it, 2.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.
FunctionTooLong: browser-automation-mcp.browserPublicAutomationTools REDACTED:193— FunctionTooLong — browserPublicAutomationTools runs 245 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× 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: virtual-models.FusionToolSelectControl packages/ui/src/pages/home/components/virtual-models.tsx:1021— FunctionTooLong — FusionToolSelectControl runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.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: model-selector.ModelSelector packages/ui/src/pages/home/components/model-selector.tsx:36— FunctionTooLong — ModelSelector runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: providers.OpenRouterProviderBlacklistSelect packages/ui/src/pages/home/components/providers.tsx:4272— FunctionTooLong — OpenRouterProviderBlacklistSelect runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: profiles.ProfileView packages/ui/src/pages/home/components/profiles.tsx:53— FunctionTooLong — ProfileView runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router-plugin.createGatewayPlugin REDACTED:193— FunctionTooLong — createGatewayPlugin runs 230 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: virtual-models.VirtualModelDialog packages/ui/src/pages/home/components/virtual-models.tsx:275— FunctionTooLong — VirtualModelDialog runs 227 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: packages/ui/src/pages/home/App.tsx packages/ui/src/pages/home/App.tsx:182— packages/ui/src/pages/home/App.tsx changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 524 in App.App at line 182. 6 of those changes were fix/bug commits, and the other 29 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/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: REDACTED REDACTED:3616— REDACTED changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in config.parseProfiles at line 3616. 6 of those changes were fix/bug commits, and the other 38 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +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: packages/core/src/gateway/request/pipeline.ts packages/core/src/gateway/request/pipeline.ts:123— packages/core/src/gateway/request/pipeline.ts changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in GatewayRequestPipeline.proxyRequest at line 123. 7 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/request/pipeline.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/ui/src/pages/home/components/dashboard.tsx packages/ui/src/pages/home/components/dashboard.tsx:48— packages/ui/src/pages/home/components/dashboard.tsx changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in dashboard.OverviewView at line 48. 6 of those changes were fix/bug commits, and the other 19 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/components/dashboard.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: packages/core/src/observability/request-log-store.ts packages/core/src/observability/request-log-store.ts:822— packages/core/src/observability/request-log-store.ts changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in RequestLogStore.updateFromRawTrace at line 822. 4 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/observability/request-log-store.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/ui/src/pages/home/components/providers.tsx packages/ui/src/pages/home/components/providers.tsx:1961— packages/ui/src/pages/home/components/providers.tsx changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in providers.AddProviderForm at line 1961. 5 of those changes were fix/bug commits, and the other 21 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/components/providers.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: packages/ui/src/pages/home/components/profiles.tsx packages/ui/src/pages/home/components/profiles.tsx:710— packages/ui/src/pages/home/components/profiles.tsx changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in profiles.AddProfileForm at line 710. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/components/profiles.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: packages/ui/src/pages/home/shared/profiles.ts packages/ui/src/pages/home/shared/profiles.ts:1540— packages/ui/src/pages/home/shared/profiles.ts changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in profiles.normalizeUnknownProfileItem at line 1540. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/shared/profiles.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:3481— REDACTED changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in service.restoreInactiveGlobalProfileConfigs at line 3481. 4 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +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: packages/ui/src/pages/home/components/network-logs.tsx packages/ui/src/pages/home/components/network-logs.tsx:1782— packages/ui/src/pages/home/components/network-logs.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in network-logs.LogJsonPanel at line 1782. 4 of those changes were fix/bug commits, and the other 12 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/components/network-logs.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: packages/ui/src/pages/home/shared/providers.ts packages/ui/src/pages/home/shared/providers.ts:1202— packages/ui/src/pages/home/shared/providers.ts changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in providers.createProviderAccountDraftFromConfig at line 1202. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/shared/providers.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/gateway/upstream/executor.ts packages/core/src/gateway/upstream/executor.ts:291— packages/core/src/gateway/upstream/executor.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in executor.fetchUpstreamWithFallback at line 291. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/upstream/executor.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/gateway/core-runtime/config-compiler.ts packages/core/src/gateway/core-runtime/config-compiler.ts:424— packages/core/src/gateway/core-runtime/config-compiler.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in config-compiler.normalizeCoreGatewayVirtualModelProfile at line 424. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/core-runtime/config-compiler.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:158— REDACTED changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in GatewayService.startGateway at line 158. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +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: packages/ui/src/pages/home/components/settings.tsx packages/ui/src/pages/home/components/settings.tsx:1453— packages/ui/src/pages/home/components/settings.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in settings.BotConfigDialog at line 1453. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/components/settings.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/ui/src/pages/home/components/onboarding.tsx packages/ui/src/pages/home/components/onboarding.tsx:40— packages/ui/src/pages/home/components/onboarding.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in onboarding.OnboardingView at line 40. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/ui/src/pages/home/components/onboarding.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: packages/cli/src/cli.ts packages/cli/src/cli.ts:74— packages/cli/src/cli.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in cli.main at line 74. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/cli/src/cli.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/agents/codex/model-catalog.ts packages/core/src/agents/codex/model-catalog.ts:466— packages/core/src/agents/codex/model-catalog.ts changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in model-catalog.documentedReasoningProfile at line 466. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/agents/codex/model-catalog.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/gateway/http/request-handler.ts packages/core/src/gateway/http/request-handler.ts:54— packages/core/src/gateway/http/request-handler.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in GatewayHttpRequestHandler.handleRequest at line 54. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/http/request-handler.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/gateway/claude-code-router-plugin.ts packages/core/src/gateway/claude-code-router-plugin.ts:68— packages/core/src/gateway/claude-code-router-plugin.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ClaudeCodeRouterPlugin.routeRequest at line 68. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/claude-code-router-plugin.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/profiles/launch-service.ts packages/core/src/profiles/launch-service.ts:121— packages/core/src/profiles/launch-service.ts changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in launch-service.openProfileFromCcr at line 121. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/profiles/launch-service.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/providers/probe.ts packages/core/src/providers/probe.ts:340— packages/core/src/providers/probe.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in probe.resolveGatewayProviderProbe at line 340. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/providers/probe.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:9815— REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in index.handleDesignRestApi at line 9815. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +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: packages/core/src/gateway/features/model-discovery.ts packages/core/src/gateway/features/model-discovery.ts:503— packages/core/src/gateway/features/model-discovery.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in model-discovery.buildGatewayDiscoverableModelIds at line 503. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/features/model-discovery.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/usage/store.ts packages/core/src/usage/store.ts:1140— packages/core/src/usage/store.ts changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in store.extractUsageSnapshot at line 1140. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/usage/store.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Sync-over-async blocking REDACTED:64— `mkdtempSync` in `runScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:131— `rmSync` in `runScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:136— `mkdtempSync` in `runWebScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:206— `rmSync` in `runWebScenario` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/agents/bot-gateway/qr-login-service.ts:59— `mkdirSync` in `startBotGatewayQrLogin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/agents/claude-app/launch.ts:55— `mkdirSync` in `launchClaudeAppProfile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:581— `existsSync` in `launchCodexCompatibleAppProfile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:1014— `appendFileSync` in `prepareCodexAppNetResponder` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/agents/codex/media-preview-bridge.ts:233— `readFileSync` in `waitForCodexDevToolsPort` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:195— `mkdirSync` in `open` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/config/onboarding-state.ts:17— `existsSync` in `loadOnboardingFinished` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:806— `existsSync` in `readManagedCoreGatewayMarker` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:810— `readFileSync` in `readManagedCoreGatewayMarker` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:832— `rmSync` in `removeManagedCoreGatewayMarker` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/media/executors.ts:130— `openSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/media/executors.ts:143— `writeSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/media/executors.ts:147— `closeSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/media/executors.ts:148— `rmSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/media/executors.ts:151— `closeSync` in `download` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/media/service.ts:478— `rmSync` in `importResult` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/observability/request-log-store.ts:1202— `existsSync` in `getBodyChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/observability/request-log-store.ts:1400— `mkdirSync` in `open` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:99— `mkdirSync` in `openSqliteStore` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:102— `mkdirSync` in `openSqliteStore` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/plugins/marketplace.ts:61— `writeFileSync` in `fetchPluginMarketplace` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
+ 13 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×37
No test reaches this file packages/ui/src/pages/home/App.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 REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/ui/src/pages/home/components/settings.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/core/src/mcp/toolhub-mcp.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 packages/electron/src/main/ipc.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 packages/electron/src/main/electron-web-search-mcp.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 packages/core/src/mcp/fusion-vision-mcp.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 packages/cli/src/cli.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 REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/electron/src/main/tray-controller.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 packages/ui/src/pages/browser/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 REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/electron/src/main/chrome-login-import.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 REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/core/src/routing/route-script-worker.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 packages/electron/src/main/update-service.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 packages/electron/src/main/main-app.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 packages/core/src/observability/request-log-worker.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 cdn/public/ccr-provider-buttons.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/core/src/mcp/fusion-tool-fallback-mcp.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 packages/electron/src/main/preload.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 packages/core/src/mcp/media-tools-proxy-mcp.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 packages/electron/src/main/app-menu.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 packages/core/src/mcp/browser-web-search-proxy-mcp.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.
Swallowed exception (empty catch) packages/ui/src/web-client-bridge.ts: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) packages/ui/src/pages/home/App.tsx:351— `.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) packages/ui/src/pages/home/App.tsx:472— `.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) packages/ui/src/pages/home/shared/api-keys.ts:304— 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) packages/ui/src/pages/home/shared/common.ts:114— 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) packages/ui/src/pages/home/shared/polling.ts:63— `.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) packages/ui/src/pages/home/shared/controls.tsx:600— 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) packages/ui/src/pages/home/components/profiles.tsx:1901— 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) packages/ui/src/pages/home/components/providers.tsx:2137— `.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) REDACTED:2315— 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:277— 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:440— 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:448— 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:561— 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: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) REDACTED:164— 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) packages/electron/src/main/ipc.ts:1525— 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) packages/electron/src/main/main-app.ts:92— 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) packages/electron/src/main/main.ts:50— 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) packages/electron/src/main/provider-account-webcontent.ts:106— 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:2931— 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:10452— 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:685— 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:1372— 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) packages/core/src/routing/rewrite.ts:297— 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.
Change coupling: launch-core.ts ↔ REDACTED packages/core/src/profiles/launch-core.ts:1— `packages/core/src/profiles/launch-core.ts` and `REDACTED` change together 85% of the time (11 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) 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 11 shared commits counted here, the most recent 3 are `c8e5e2b5` Add WorkBuddy app integration; `7c4a877c` feat: support Kilo Code profiles; `084b660c` Document Pi agent profile support — run `git show` on any of them.
Change coupling: REDACTED ↔ ipc.ts REDACTED:1— `REDACTED` and `packages/electron/src/main/ipc.ts` change together 71% of the time (15 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 15 shared commits counted here, the most recent 3 are `9f45399b` perf(app): avoid repeated eager executable discovery (#1776); `923c7421` Add overview statistics reset with persistent reset tracking; `9e7d4f78` Implement router enhancements — run `git show` on any of them.
Change coupling: App.tsx ↔ electron.d.ts packages/ui/src/pages/home/App.tsx:1— `packages/ui/src/pages/home/App.tsx` and `packages/ui/src/types/electron.d.ts` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `923c7421` Add overview statistics reset with persistent reset tracking; `10786391` fix(theme): synchronize dark mode across app and tray; `ca2609c7` Add Codex model metadata probing and propagation — run `git show` on any of them.
Change coupling: REDACTED ↔ providers.tsx packages/core/src/contracts/deep-link.ts:1— `packages/core/src/contracts/deep-link.ts` and `packages/ui/src/pages/home/components/providers.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) 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 `7a2b4c3a` feat: respect explicit user context windows over imported Codex caps; `9e7d4f78` Implement router enhancements; `4344a2d6` Refactor routing configuration and improve provider support — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED REDACTED:1— `REDACTED` and `REDACTED` change together 56% of the time (10 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 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 `26e7b0b7` fix codex worksapce error; `4344a2d6` Refactor routing configuration and improve provider support; `225b3c23` Improve Codex authentication and app-server launch handling — run `git show` on any of them.
Change coupling: probe.ts ↔ providers.ts packages/core/src/providers/probe.ts:1— `packages/core/src/providers/probe.ts` and `packages/ui/src/pages/home/shared/providers.ts` change together 55% of the time (11 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `14df423c` fix(opencode-go): support Go provider identity and required session h…; `e8db9406` Add automatic provider model refresh and dialog Escape handling; `3f566d99` Preserve API keys across provider probes — run `git show` on any of them.
Change coupling: request-log-store.ts ↔ store.ts packages/core/src/observability/request-log-store.ts:1— `packages/core/src/observability/request-log-store.ts` and `packages/core/src/usage/store.ts` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `e52f037d` Support DeepSeek cache usage for OpenCode Go; `17fd7458` Normalize usage token conventions per source; `00f5d6e4` fix cache ratio token accounting — run `git show` on any of them.
Change coupling: launch-core.ts ↔ profiles.ts packages/core/src/profiles/launch-core.ts:1— `packages/core/src/profiles/launch-core.ts` and `packages/ui/src/pages/home/shared/profiles.ts` 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `c8e5e2b5` Add WorkBuddy app integration; `7c4a877c` feat: support Kilo Code profiles; `084b660c` Document Pi agent profile support — run `git show` on any of them.
Change coupling: REDACTED ↔ profiles.ts REDACTED:1— `REDACTED` and `packages/ui/src/pages/home/shared/profiles.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 `c8e5e2b5` Add WorkBuddy app integration; `6e34da7f` Enforce profile model allowlists across agent catalogs; `7c4a877c` feat: support Kilo Code profiles — run `git show` on any of them.
Change coupling: probe.ts ↔ providers.tsx packages/core/src/providers/probe.ts:1— `packages/core/src/providers/probe.ts` and `packages/ui/src/pages/home/components/providers.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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `14df423c` fix(opencode-go): support Go provider identity and required session h…; `b1fd1e24` fix(gemini): honor selected protocols and API key auth (#1778); `e8db9406` Add automatic provider model refresh and dialog Escape handling — run `git show` on any of them.
Change coupling: dashboard.tsx ↔ shared.tsx packages/ui/src/pages/home/components/dashboard.tsx:1— `packages/ui/src/pages/home/components/dashboard.tsx` and `packages/ui/src/pages/tray/shared.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) 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 5 shared commits counted here, the most recent 3 are `43948b4c` Refactor router configuration and expand provider support (at that commit the files were still `src/renderer/pages/home/components/dashboard.tsx` and `src/renderer/pages/tray/shared.tsx`); `b6f8bb3c` Add Codex manual reset account metrics (at that commit the files were still `src/renderer/pages/home/components/dashboard.tsx` and `src/renderer/pages/tray/shared.tsx`); `e558a7c4` Add catalog-backed Claude Code model metadata (at that commit the files were still `src/renderer/pages/home/components/dashboard.tsx` and `src/renderer/pages/tray/shared.tsx`) — run `git show` on any of them.
Change coupling: REDACTED ↔ providers.ts packages/core/src/contracts/deep-link.ts:1— `packages/core/src/contracts/deep-link.ts` and `packages/ui/src/pages/home/shared/providers.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) 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 5 shared commits counted here, the most recent 3 are `6c1a9088` Refactor router implementation and configuration; `0d51897d` Add Gemini interactions protocol support (at that commit the files were still `src/shared/deep-link.ts` and `src/renderer/pages/home/shared/providers.ts`); `56c1b666` Refactor router config and provider handling (at that commit the files were still `src/shared/deep-link.ts` and `src/renderer/pages/home/shared/providers.ts`) — run `git show` on any of them.
Focus outline removed inline packages/ui/src/pages/home/components/dashboard.tsx:4916— <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 packages/ui/src/pages/home/components/model-selector.tsx:190— <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 packages/ui/src/pages/home/components/network-logs.tsx:158— <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 packages/ui/src/pages/home/components/network-logs.tsx:232— <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 packages/ui/src/pages/home/components/network-logs.tsx:319— <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 packages/ui/src/pages/home/components/network-logs.tsx:516— <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 packages/ui/src/pages/home/components/network-logs.tsx:908— <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 packages/ui/src/pages/home/components/network-logs.tsx:2119— <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 packages/ui/src/pages/home/components/network-logs.tsx:2128— <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 packages/ui/src/pages/home/components/network-logs.tsx:2707— <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 packages/ui/src/pages/home/components/network-logs.tsx:2752— <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).
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×11
Animation without a prefers-reduced-motion guard packages/ui/src/styles/globals.css:599— `.overview-status-segment` moves (`transition: filter 140ms ease, transform 140ms ease`) 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 packages/ui/src/styles/globals.css:785— `.overview-activity-cell` moves (`transition: filter 120ms ease, transform 120ms ease`) 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 packages/ui/src/styles/globals.css:1456— `.onboarding-step-panel` moves (`transition: opacity 180ms ease-out,
transform 240ms cubic-bezier(.22, 1, .36, 1),
visibility 0ms linear 180ms`) 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 packages/ui/src/styles/globals.css:1470— `.onboarding-step-panel-active` moves (`transition: opacity 180ms ease-out 40ms,
transform 260ms cubic-bezier(.22, 1, .36, 1) 40ms,
visibility 0ms`) 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 packages/ui/src/styles/globals.css:1478— `.onboarding-mascot-sprite-provider` moves (`animation: onboarding-mascot-sprite-run-provider 680ms steps(7, end) both,
onboarding-mascot-provider-motion 680ms cubic-bezier(.22, 1, .36, 1) both`) 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 packages/ui/src/styles/globals.css:1484— `.onboarding-mascot-sprite-profile` moves (`animation: onboarding-mascot-sprite-run-profile 820ms steps(7, end) both,
onboarding-mascot-profile-motion 820ms cubic-bezier(.16, 1, .3, 1) both`) 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 packages/ui/src/styles/globals.css:1490— `.onboarding-mascot-sprite-enter` moves (`animation: onboarding-mascot-sprite-run-enter 620ms steps(7, end) both,
onboarding-mascot-enter-motion 620ms cubic-bezier(.2, 1.1, .3, 1) both`) 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 docs/src/styles/global.css:640— `.cta-button` moves (`transition: background 140ms ease,
box-shadow 140ms ease,
transform 140ms ease`) 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 docs/src/styles/global.css:1726— `.code-copy .copy-icon` moves (`transition: opacity 160ms ease,
transform 160ms ease,
color 160ms ease`) 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 docs/src/styles/global.css:1960— `.toc-inline summary svg:last-child` moves (`transition: transform 160ms ease`) 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 docs/src/styles/global.css:2212— `.sidebar` moves (`transition: transform 180ms cubic-bezier(0.2, 0, 0.13, 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.
D30 · Dependency Vulnerabilities· Medium CVE · ×10
ClassTooLong: App packages/ui/src/pages/home/App.tsx:1— ClassTooLong — 2617 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 2217 over it, 6.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GatewayRequestPipeline packages/core/src/gateway/request/pipeline.ts:114— ClassTooLong — 893 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 493 over it, 2.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.
ClassTooLong: RequestLogRuntime packages/core/src/observability/request-log-runtime.ts:134— ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 225 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BuiltInBrowserService REDACTED:64— ClassTooLong — 619 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 219 over it, 1.55× 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: BrowserAutomationMcpService REDACTED:662— ClassTooLong — 589 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 189 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RawTraceSynchronizer packages/core/src/observability/raw-trace-sync.ts:138— ClassTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 122 over it, 1.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: GatewayPluginService packages/core/src/plugins/service.ts:256— ClassTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded), 35 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.
ClassTooLong: GatewayService REDACTED:79— ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 75 over it, 1.19× 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.
X2 · Cancellation propagation· Async function without AbortSignal · ×8
Async function without AbortSignal: rpc packages/ui/src/web-client-bridge.ts:13— `rpc` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: routeClaudeDesignFetchRequest REDACTED:288— `routeClaudeDesignFetchRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchManifestText packages/core/src/providers/manifest-service.ts:40— `fetchManifestText` awaits `https.request(…)` 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: `https.request(url, { signal })`.
Async function without AbortSignal: post packages/core/src/mcp/toolhub-mcp.ts:1073— `post` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchImportJob REDACTED:35— `fetchImportJob` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: submitLoginState REDACTED:51— `submitLoginState` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchImportJob REDACTED:77— `fetchImportJob` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: submitCookies REDACTED:93— `submitCookies` 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 })`.
MethodTooLong: GatewayRequestPipeline.proxyRequest packages/core/src/gateway/request/pipeline.ts:123— MethodTooLong — proxyRequest runs 853 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 753 over it, 8.53× 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: BrowserAutomationMcpService.runTool REDACTED:773— MethodTooLong — runTool runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.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.
MethodTooLong: GatewayHttpRequestHandler.handleRequest packages/core/src/gateway/http/request-handler.ts:54— MethodTooLong — handleRequest runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GatewayService.startGateway REDACTED:158— MethodTooLong — startGateway runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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: ClaudeCodeRouterPlugin.routeRequest packages/core/src/gateway/claude-code-router-plugin.ts:68— MethodTooLong — routeRequest runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BuiltInBrowserService.configureTab REDACTED:511— MethodTooLong — configureTab runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WindowsManager.openPluginAppWindow REDACTED:120— MethodTooLong — openPluginAppWindow runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.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.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×7
Untrusted text written into markup unescaped REDACTED:6021— `escapeHtml(basePath)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped REDACTED:14937— `escapeHtmlAttribute(href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped REDACTED:14941— `escapeHtmlAttribute(normalizedStylePath)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped REDACTED:14974— `escapeHtmlAttribute(normalizedScriptPath)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped REDACTED:14994— `escapeHtmlAttribute(href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped REDACTED:15122— `escapeJsonForScript(me)` is text this program did not author, and it is written into a script or style context through markup this function returns 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped REDACTED:16197— `escapeJsonForScript(defaultModelId)` is text this program did not author, and it is written into a script or style context through markup this function returns 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. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Outbound HTTP without resilience packages/core/src/mcp/toolhub-mcp.ts:1074— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:34— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:39— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:42— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:5778— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:344— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Swallowed exception (caught, then discarded) REDACTED:3436— `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) REDACTED:3476— `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) REDACTED:3549— `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) REDACTED:3565— `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Swallowed exception (caught, then discarded) REDACTED:7156— `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Repeated repair: REDACTED REDACTED:430— REDACTED 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 10 (its worst body is gateway-service.gatewayEndpoint at line 430), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude-app): remove deprecated configuration keys (#1772)”; “fix(claude-app): preserve preferences on restore (#1768)”; “fix: preserve coworkEgressAllowedHosts when rewriting Claude App config”; “fix: invalidate gateway model discovery cache when profile allowlist changes”. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/core/src/gateway/http/io.ts packages/core/src/gateway/http/io.ts:28— packages/core/src/gateway/http/io.ts 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 14 (its worst body is io.inferClientFromUserAgent at line 28), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: hide JSON credential values in diagnostics”; “fix: hide credentials without obscuring diagnostics”; “fix: add privacy-safe upstream failure diagnostics”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/http/io.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: packages/core/src/agents/local-providers/claude-code.ts packages/core/src/agents/local-providers/claude-code.ts:273— packages/core/src/agents/local-providers/claude-code.ts 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 claude-code.scanClaudeCodeKeychain at line 273), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve provider account meters during import”; “fix(claude-code): never resolve a token from inside mcpOAuth”; “fix(claude-code): look up the keychain item by account”. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/agents/local-providers/claude-code.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: packages/core/src/gateway/core-runtime/responses-session-affinity.ts packages/core/src/gateway/core-runtime/responses-session-affinity.ts:42— packages/core/src/gateway/core-runtime/responses-session-affinity.ts 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 responses-session-affinity.applyResponsesSessionAffinity at line 42), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): send session_id header for Codex Responses prompt cache affinity”; “fix(opencode-go): support Go provider identity and required session header”; “fix: skip session affinity body fields for codex responses upstreams”. 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-12..2026-10-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-12 11:35:09 +08:00' --until='2026-10-10 11:35:09 +08:00' --full-history --no-merges -- packages/core/src/gateway/core-runtime/responses-session-affinity.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.
TooManyMethods: RequestLogRuntime packages/core/src/observability/request-log-runtime.ts:134— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BuiltInBrowserService REDACTED:64— TooManyMethods — 42 methods. The bar is 30 methods; 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.
TooManyMethods: MediaService packages/core/src/media/service.ts:50— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GatewayPluginService packages/core/src/plugins/service.ts:256— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Weak hash algorithm build/dev.mjs:130— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm build/dev.mjs:139— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm REDACTED:5672— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm REDACTED:5818— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
AC2 · Forms & labels· <Select> field component without a label · ×3
<Select> field component without a label packages/ui/src/pages/home/components/profiles.tsx:2177— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label packages/ui/src/pages/home/components/settings.tsx:2569— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label packages/ui/src/pages/home/shared/controls.tsx:116— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
App.App::submitProviderDraft (cyclomatic 40) packages/ui/src/pages/home/App.tsx:1705— App.App::submitProviderDraft has cyclomatic complexity 40 (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::persistConfig, App.App::refreshProviderModels) 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::refreshProviderModels (cyclomatic 18) packages/ui/src/pages/home/App.tsx:1535— App.App::refreshProviderModels 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. This shape REPEATS in the file: 3 other methods here (App.App, App.App::persistConfig, App.App::submitProviderDraft) 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::persistConfig (cyclomatic 17) packages/ui/src/pages/home/App.tsx:1062— App.App::persistConfig 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: 3 other methods here (App.App, App.App::refreshProviderModels, App.App::submitProviderDraft) 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::submitProviderDraft (cognitive 43) packages/ui/src/pages/home/App.tsx:1705— App.App::submitProviderDraft has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 15 (17 pts), boolean chains 7, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 3 other methods here (App.App, App.App::persistConfig, App.App::refreshProviderModels) 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::refreshProviderModels (cognitive 21) packages/ui/src/pages/home/App.tsx:1535— App.App::refreshProviderModels has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 3 (4 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. This shape REPEATS in the file: 3 other methods here (App.App, App.App::persistConfig, App.App::submitProviderDraft) 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::persistConfig (cognitive 18) packages/ui/src/pages/home/App.tsx:1062— App.App::persistConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (App.App, App.App::refreshProviderModels, App.App::submitProviderDraft) 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.
Change-coupling hub: ipc-channels.ts → app.ts, App.tsx, electron.d.ts packages/core/src/contracts/ipc-channels.ts— `packages/core/src/contracts/ipc-channels.ts` changes together with 3 other files — `packages/core/src/contracts/app.ts`, `packages/ui/src/pages/home/App.tsx`, `packages/ui/src/types/electron.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: REDACTED → REDACTED, REDACTED, ipc-channels.ts, launch-core.ts, preload.ts, profiles.tsx, settings.tsx, i18n.tsx, profiles.ts, types.ts, shared.tsx, electron.d.ts REDACTED— `REDACTED` changes together with 12 other files — `REDACTED`, `packages/core/src/contracts/deep-link.ts`, `packages/core/src/contracts/ipc-channels.ts`, `packages/core/src/profiles/launch-core.ts`, `packages/electron/src/main/preload.ts`, `packages/ui/src/pages/home/components/profiles.tsx`, `packages/ui/src/pages/home/components/settings.tsx`, `packages/ui/src/pages/home/shared/i18n.tsx`, `packages/ui/src/pages/home/shared/profiles.ts`, `packages/ui/src/pages/home/shared/types.ts`, `packages/ui/src/pages/tray/shared.tsx`, `packages/ui/src/types/electron.d.ts` — none of which declares a dependency on it: one file is the hub of 12 separate couplings, not 12 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 12.
Change-coupling hub: i18n.tsx → app.ts, REDACTED, account-service.ts, options.ts, profiles.ts, providers.ts packages/ui/src/pages/home/shared/i18n.tsx— `packages/ui/src/pages/home/shared/i18n.tsx` changes together with 6 other files — `packages/core/src/contracts/app.ts`, `packages/core/src/contracts/deep-link.ts`, `packages/core/src/providers/account-service.ts`, `packages/ui/src/pages/home/shared/options.ts`, `packages/ui/src/pages/home/shared/profiles.ts`, `packages/ui/src/pages/home/shared/providers.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.
R10 · Code Duplication· Duplicated block with local edits (55 matched lines × 2 locations) · ×3
Duplicated block with local edits (55 matched lines × 2 locations) REDACTED:172— REDACTED:172 · packages/ui/src/pages/home/shared/profiles.ts:1104 — the two spans are one implementation copied and then locally edited — 395 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 (55 matched lines × 2 locations) packages/core/src/observability/request-log-store.ts:6070— packages/core/src/observability/request-log-store.ts:6070 · packages/core/src/usage/store.ts:1074 — the two spans are one implementation copied and then locally edited — 357 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 (55 matched lines × 2 locations) packages/ui/src/pages/home/components/api-keys.tsx:269— packages/ui/src/pages/home/components/api-keys.tsx:269 · packages/ui/src/pages/home/components/extensions.tsx:212 — the two spans are one implementation copied and then locally edited — 351 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.
IC1 · Incompleteness & stubs· Guard cannot change the result · ×2
Guard cannot change the result — returns what the code already falls through to packages/core/src/agents/bot-gateway/sdk-import.ts:17— The guard above `return trimmed;` also returns `trimmed`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Guard cannot change the result — returns what the code already falls through to REDACTED:14690— The guard above `return "*/*";` also returns `"*/*"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Fake-async — async method never awaits REDACTED:395— `quitApp` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits packages/ui/src/web-client-bridge.ts:151— `openExternal` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Hollow method — returns a constant without doing the work REDACTED:14247— `shouldUseOnlineClaudeApp` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work REDACTED:16486— `frontendAssetsDisabled` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Duplicated block (48 lines × 2 locations) REDACTED:1206— REDACTED:1206 · packages/electron/src/main/ipc.ts:1084 — 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 (48 lines × 2 locations) REDACTED:1327— REDACTED:1327 · packages/electron/src/main/ipc.ts:1480 — 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.
Dead file (~308 LoC) packages/core/src/observability/request-log-worker.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~308 LoC) packages/electron/bundled-plugins/new-api-account/index.cjs— no import path from any entry point (22 application, 10 tooling, 182 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
AC2 · Forms & labels· <fieldset> without a <legend> · ×1
<fieldset> without a <legend> packages/ui/src/pages/home/components/settings.tsx:1758— 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.
AC2 · Forms & labels· <Textarea> field component without a label · ×1
<Textarea> field component without a label packages/ui/src/pages/home/shared/controls.tsx:153— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark docs/src/components/Redirect.astro:16— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Multiple navigation landmarks without distinguishing labels docs/src/layouts/DocsLayout.astro:141— With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×1
Modal dialog does not manage focus packages/ui/src/pages/home/components/network-logs.tsx:2264— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Low contrast Tailwind colour pair (2.5:1) packages/ui/src/pages/home/components/api-keys.tsx:236— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
Low contrast colour pair in CSS (2.2:1) packages/ui/src/styles/globals.css:577— `.overview-status-icon[data-tone="ok"]` sets color: #fff on background-color: #34c759 — 2.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.5:1) packages/ui/src/styles/globals.css:587— `.overview-status-icon[data-tone="error"]` sets color: #fff on background-color: #ff3b30 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.3:1) docs/src/styles/global.css:629— `.cta-button` sets color: #ffffff on background-color: #16a34a — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×1
Focus outline removed in CSS without a :focus replacement docs/src/styles/global.css:517— `.search input` 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.
GatewayRequestPipeline.proxyRequest (cyclomatic 142) packages/core/src/gateway/request/pipeline.ts:123— GatewayRequestPipeline.proxyRequest has cyclomatic complexity 142 (threshold 15). Of this number, 118 points are the body's own statements and 24 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.handleOmeletteConnectRpc (cyclomatic 112) REDACTED:2235— index.handleOmeletteConnectRpc has cyclomatic complexity 112 (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.
config.parseProfiles (cyclomatic 84) REDACTED:3616— config.parseProfiles has cyclomatic complexity 84 (threshold 15). Most of this is not in the body itself: 2 of the 84 points are its own statements and the rest belongs to one function literal inside it that branches (line 3622). 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.
profiles.normalizeUnknownProfileItem (cyclomatic 80) packages/ui/src/pages/home/shared/profiles.ts:1540— profiles.normalizeUnknownProfileItem has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dashboard.OverviewView (cyclomatic 80) packages/ui/src/pages/home/components/dashboard.tsx:48— dashboard.OverviewView has cyclomatic complexity 80 (threshold 15). Of this number, 16 points are the body's own statements and 64 belong to 33 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.
RequestLogStore.updateFromRawTrace (cyclomatic 76) packages/core/src/observability/request-log-store.ts:822— RequestLogStore.updateFromRawTrace has cyclomatic complexity 76 (threshold 15). Of this number, 74 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
providers.AddProviderForm (cyclomatic 76) packages/ui/src/pages/home/components/providers.tsx:1961— providers.AddProviderForm has cyclomatic complexity 76 (threshold 15). Of this number, 36 points are the body's own statements and 40 belong to 16 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.
browser-automation-mcp.targetActionScript (cyclomatic 74) REDACTED:2904— browser-automation-mcp.targetActionScript has cyclomatic complexity 74 (threshold 15). Of this number, 29 points are the body's own statements and 45 belong to 11 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.
profiles.AddProfileForm (cyclomatic 68) packages/ui/src/pages/home/components/profiles.tsx:710— profiles.AddProfileForm has cyclomatic complexity 68 (threshold 15). Of this number, 55 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
createClaudeProductPlugin.setup (cyclomatic 68) REDACTED:530— createClaudeProductPlugin.setup has cyclomatic complexity 68 (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.
index.createClaudeProductPlugin.setup (cyclomatic 67) REDACTED:530— index.createClaudeProductPlugin.setup has cyclomatic complexity 67 (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.
index.handleDesignRestApi (cyclomatic 67) REDACTED:9815— index.handleDesignRestApi has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
settings.BotConfigDialog (cyclomatic 66) packages/ui/src/pages/home/components/settings.tsx:1453— settings.BotConfigDialog has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 9 of the 66 points are its own statements and the rest belongs to 16 function items inside it that branch (saveWithQrLogin, waitForQrLoginConfirmation, startQrLogin, …). 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.
BrowserAutomationMcpService.runTool (cyclomatic 65) REDACTED:773— BrowserAutomationMcpService.runTool has cyclomatic complexity 65 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
onboarding.OnboardingView (cyclomatic 65) packages/ui/src/pages/home/components/onboarding.tsx:40— onboarding.OnboardingView has cyclomatic complexity 65 (threshold 15). Of this number, 34 points are the body's own statements and 31 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.
index.routeMockRequest (cyclomatic 64) REDACTED:895— index.routeMockRequest has cyclomatic complexity 64 (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.
providers.AddProviderDialog (cyclomatic 59) packages/ui/src/pages/home/components/providers.tsx:3466— providers.AddProviderDialog has cyclomatic complexity 59 (threshold 15). Of this number, 38 points are the body's own statements and 21 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
App.App (cyclomatic 59) packages/ui/src/pages/home/App.tsx:182— App.App has cyclomatic complexity 59 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 3 other methods here (App.App::persistConfig, App.App::refreshProviderModels, App.App::submitProviderDraft) 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.
config.parseProfile (cyclomatic 55) REDACTED:3480— config.parseProfile has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
network-logs.LogJsonPanel (cyclomatic 55) packages/ui/src/pages/home/components/network-logs.tsx:1782— network-logs.LogJsonPanel has cyclomatic complexity 55 (threshold 15). Of this number, 20 points are the body's own statements and 35 belong to 9 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.
GatewayHttpRequestHandler.handleRequest (cyclomatic 53) packages/core/src/gateway/http/request-handler.ts:54— GatewayHttpRequestHandler.handleRequest 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.
providers.ProviderUsageSettings (cyclomatic 53) packages/ui/src/pages/home/components/providers.tsx:2888— providers.ProviderUsageSettings has cyclomatic complexity 53 (threshold 15). Of this number, 33 points are the body's own statements and 20 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.
config.parseBotGateway (cyclomatic 51) REDACTED:2221— config.parseBotGateway has cyclomatic complexity 51 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
settings.TraySettingsPage (cyclomatic 50) packages/ui/src/pages/home/components/settings.tsx:1908— settings.TraySettingsPage has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 14 of the 50 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 2096, changeTrayWidgetAccountProviders, a function literal at line 2173, …). 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.
config.pickConfig (cyclomatic 49) REDACTED:769— config.pickConfig has cyclomatic complexity 49 (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.
request-log-store.inferAgentFromText (cyclomatic 49) packages/core/src/observability/request-log-store.ts:2043— request-log-store.inferAgentFromText has cyclomatic complexity 49 (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.
virtual-models.FusionToolSelectControl (cyclomatic 49) packages/ui/src/pages/home/components/virtual-models.tsx:1021— virtual-models.FusionToolSelectControl has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 13 of the 49 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 1208, 1232, 1069, …). 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.
cli.main (cyclomatic 48) packages/cli/src/cli.ts:74— cli.main 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.
browser-automation-mcp.waitForReadiness (cyclomatic 48) REDACTED:1653— browser-automation-mcp.waitForReadiness 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.
profiles.normalizeProfileItem (cyclomatic 46) packages/ui/src/pages/home/shared/profiles.ts:1395— profiles.normalizeProfileItem has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
browser-automation-mcp.waitForNextReadinessEvent (cyclomatic 45) REDACTED:1772— browser-automation-mcp.waitForNextReadinessEvent 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.
providers.ModelMetadataEditor (cyclomatic 45) packages/ui/src/pages/home/components/providers.tsx:4669— providers.ModelMetadataEditor has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 5 of the 45 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 4889, a function literal at line 4751, a function literal at line 4775, …). 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.
executor.fetchUpstreamWithFallback (cyclomatic 44) packages/core/src/gateway/upstream/executor.ts:291— executor.fetchUpstreamWithFallback 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.
virtual-models.VirtualModelDialog (cyclomatic 43) packages/ui/src/pages/home/components/virtual-models.tsx:275— virtual-models.VirtualModelDialog 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 14 function items inside it that branch (applyFusionTools, discoverMcpServerTools, submitCustomMcpDialog, …). 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.
dashboard.ProviderAccountSummaryCard (cyclomatic 43) packages/ui/src/pages/home/components/dashboard.tsx:2929— dashboard.ProviderAccountSummaryCard has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
profiles.ProfileView (cyclomatic 42) packages/ui/src/pages/home/components/profiles.tsx:53— profiles.ProfileView has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 3 of the 42 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 118, 125, 231). 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.
commentFromRequest (cyclomatic 42) REDACTED:9472— commentFromRequest has cyclomatic complexity 42 (threshold 15). Of this number, 40 points are the body's own statements and 2 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.
request-log-store.assistantFullTextCandidates (cyclomatic 41) packages/core/src/observability/request-log-store.ts:2746— request-log-store.assistantFullTextCandidates 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.
main.BrowserChrome (cyclomatic 41) packages/ui/src/pages/browser/main.tsx:31— main.BrowserChrome has cyclomatic complexity 41 (threshold 15). 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 (copyChromeImportUrl, a function literal at line 169, a function literal at line 69, …). 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.
profiles.profileSummaryItems (cyclomatic 41) packages/ui/src/pages/home/shared/profiles.ts:1285— profiles.profileSummaryItems 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.
routing.AddRoutingRuleDialog (cyclomatic 41) packages/ui/src/pages/home/components/routing.tsx:375— routing.AddRoutingRuleDialog has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 14 of the 41 points are its own statements and the rest belongs to 9 function items inside it that branch (validateScript, testScript, a function literal at line 517, …). 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.
service.restoreInactiveGlobalProfileConfigs (cyclomatic 40) REDACTED:3481— service.restoreInactiveGlobalProfileConfigs has cyclomatic complexity 40 (threshold 15). Of this number, 37 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
index.handleAdminRequest (cyclomatic 40) REDACTED:4102— index.handleAdminRequest has cyclomatic complexity 40 (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.
index.handleClaudeShipSessionApi (cyclomatic 40) REDACTED:5197— index.handleClaudeShipSessionApi has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
logs.aggregateOpenAiResponsesStreamPayloads (cyclomatic 40) packages/ui/src/pages/home/shared/logs.ts:659— logs.aggregateOpenAiResponsesStreamPayloads has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dashboard.CodexResetCreditDialog (cyclomatic 40) packages/ui/src/pages/home/components/dashboard.tsx:3640— dashboard.CodexResetCreditDialog has cyclomatic complexity 40 (threshold 15). Of this number, 22 points are the body's own statements and 18 belong to 9 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.
config.parseProfileAgent (cyclomatic 39) REDACTED:3801— config.parseProfileAgent has cyclomatic complexity 39 (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.
evidence.synthesizeWeatherWebSearchAnswer (cyclomatic 39) packages/core/src/gateway/features/hosted-web-search/evidence.ts:358— evidence.synthesizeWeatherWebSearchAnswer 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.
manifest-service.isPublicIpv4 (cyclomatic 39) packages/core/src/providers/manifest-service.ts:269— manifest-service.isPublicIpv4 has cyclomatic complexity 39 (threshold 15). Of this number, 38 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.
model-selector.ModelSelector (cyclomatic 39) packages/ui/src/pages/home/components/model-selector.tsx:36— model-selector.ModelSelector has cyclomatic complexity 39 (threshold 15). Of this number, 20 points are the body's own statements and 19 belong to 9 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.
profiles.normalizeBotGatewayRuntimeConfig (cyclomatic 38) packages/ui/src/pages/home/shared/profiles.ts:1171— profiles.normalizeBotGatewayRuntimeConfig has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
provider-references.renameProviderReferences (cyclomatic 38) packages/ui/src/pages/home/shared/provider-references.ts:4— provider-references.renameProviderReferences has cyclomatic complexity 38 (threshold 15). Of this number, 20 points are the body's own statements and 18 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.
network-logs.LogsView (cyclomatic 38) packages/ui/src/pages/home/components/network-logs.tsx:353— network-logs.LogsView has cyclomatic complexity 38 (threshold 15). Of this number, 17 points are the body's own statements and 21 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.
index.chatWithGateway (cyclomatic 37) REDACTED:10458— index.chatWithGateway has cyclomatic complexity 37 (threshold 15). Of this number, 35 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.
providers.ProvidersView (cyclomatic 37) packages/ui/src/pages/home/components/providers.tsx:31— providers.ProvidersView has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 165, a function literal at line 179, a function literal at line 48, …). 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.
providers.ProviderModelPicker (cyclomatic 36) packages/ui/src/pages/home/components/providers.tsx:3900— providers.ProviderModelPicker has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 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.
providers.OpenRouterProviderBlacklistSelect (cyclomatic 36) packages/ui/src/pages/home/components/providers.tsx:4272— providers.OpenRouterProviderBlacklistSelect has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 14 of the 36 points are its own statements and the rest belongs to 9 function items inside it that branch (loadProviders, a function literal at line 4323, a function literal at line 4514, …). 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.
OpenAiToolHubSearchAgent.search (cyclomatic 35) packages/core/src/mcp/toolhub-mcp.ts:1467— OpenAiToolHubSearchAgent.search 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.
opencode.readOpenCodeCatalog (cyclomatic 34) packages/core/src/agents/local-providers/opencode.ts:447— opencode.readOpenCodeCatalog 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.
dashboard.ProviderAccountsOverview (cyclomatic 34) packages/ui/src/pages/home/components/dashboard.tsx:2608— dashboard.ProviderAccountsOverview has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 12 of the 34 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 2717, finishAccountCardSort, a function literal at line 2695, …). 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.
extensions.wrapperPluginCapability (cyclomatic 33) packages/ui/src/pages/home/shared/extensions.ts:560— extensions.wrapperPluginCapability 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. This is NOT this file's highest cyclomatic complexity: extensions.pluginPermissionAlias (cyclomatic 40) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
providers.ProviderDeepLinkDialog (cyclomatic 33) packages/ui/src/pages/home/components/providers.tsx:758— providers.ProviderDeepLinkDialog has cyclomatic complexity 33 (threshold 15). Of this number, 32 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.
providers.LocalAgentProviderImportPanel (cyclomatic 32) packages/ui/src/pages/home/components/providers.tsx:1372— providers.LocalAgentProviderImportPanel has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 1481, importCandidate, a function literal at line 1391, …). 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.
GatewayService.startGateway (cyclomatic 31) REDACTED:158— GatewayService.startGateway has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tools.mediaToolBindingsForConfig (cyclomatic 31) packages/core/src/media/tools.ts:30— tools.mediaToolBindingsForConfig has cyclomatic complexity 31 (threshold 15). Of this number, 27 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.connectGatewayChatStreamResponse (cyclomatic 31) REDACTED:10587— index.connectGatewayChatStreamResponse has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 10588, 10605). 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.
index.isOnlineClaudeDesignProxyRoutePath (cyclomatic 31) REDACTED:14269— index.isOnlineClaudeDesignProxyRoutePath has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
providers.createProviderAccountDraftFromConfig (cyclomatic 31) packages/ui/src/pages/home/shared/providers.ts:1202— providers.createProviderAccountDraftFromConfig has cyclomatic complexity 31 (threshold 15). Of this number, 26 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.
network-logs.useLogBodyWorkerView (cyclomatic 31) packages/ui/src/pages/home/components/network-logs.tsx:1554— network-logs.useLogBodyWorkerView has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 1571, 1599, 1657, …). 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.
shared.stripJsonCommentsAndTrailingCommas (cyclomatic 30) packages/core/src/agents/local-providers/shared.ts:202— shared.stripJsonCommentsAndTrailingCommas 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.
providers.ProviderPresetCombobox (cyclomatic 30) packages/ui/src/pages/home/components/providers.tsx:944— providers.ProviderPresetCombobox has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 11 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 981, a function literal at line 1080, a function literal at line 1026, …). 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.
update.UpdateDialog (cyclomatic 30) packages/ui/src/pages/home/components/update.tsx:12— update.UpdateDialog has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
network-logs.LogExpandedDetails (cyclomatic 30) packages/ui/src/pages/home/components/network-logs.tsx:947— network-logs.LogExpandedDetails has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
normalizeProjectStoreData (cyclomatic 30) REDACTED:7966— normalizeProjectStoreData 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.
normalizeCloudflarePagesConfig (cyclomatic 30) REDACTED:16381— normalizeCloudflarePagesConfig 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.
toolhub-mcp.normalizeServerConfig (cyclomatic 29) packages/core/src/mcp/toolhub-mcp.ts:1852— toolhub-mcp.normalizeServerConfig has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
executors.isRestrictedIpAddress (cyclomatic 29) packages/core/src/media/executors.ts:289— executors.isRestrictedIpAddress has cyclomatic complexity 29 (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.
request-log-runtime.prepareRecordForQueue (cyclomatic 29) packages/core/src/observability/request-log-runtime.ts:945— request-log-runtime.prepareRecordForQueue has cyclomatic complexity 29 (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.
request-log-store.assistantStreamText (cyclomatic 29) packages/core/src/observability/request-log-store.ts:2697— request-log-store.assistantStreamText has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
config-compiler.normalizeCoreGatewayVirtualModelProfile (cyclomatic 28) packages/core/src/gateway/core-runtime/config-compiler.ts:424— config-compiler.normalizeCoreGatewayVirtualModelProfile 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.
service.applyCodexProfile (cyclomatic 28) REDACTED:570— service.applyCodexProfile has cyclomatic complexity 28 (threshold 15). Of this number, 26 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.
route-script-result.normalizeRouteScriptResult (cyclomatic 28) packages/core/src/routing/route-script-result.ts:27— route-script-result.normalizeRouteScriptResult has cyclomatic complexity 28 (threshold 15). Of this number, 27 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.
ProvidersViewDemo.ProvidersViewDemo (cyclomatic 27) docs/src/components/interactive/ProvidersViewDemo.tsx:72— ProvidersViewDemo.ProvidersViewDemo has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (play, a function literal at line 104, play::waitFor, …). 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.
grok.grokModelCatalogFromPayload (cyclomatic 27) packages/core/src/agents/local-providers/grok.ts:371— grok.grokModelCatalogFromPayload 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.
config.parseProviderModelMetadata (cyclomatic 27) REDACTED:1532— config.parseProviderModelMetadata has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.handleOrganizationApi (cyclomatic 27) REDACTED:4002— index.handleOrganizationApi 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.
index.normalizeQuestionsV2Question (cyclomatic 27) REDACTED:12811— index.normalizeQuestionsV2Question 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.
fusion-config.fusionBuiltinToolArtifacts (cyclomatic 26) packages/core/src/mcp/fusion-config.ts:19— fusion-config.fusionBuiltinToolArtifacts 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.
index.handleClaudeShipCodeApi (cyclomatic 26) REDACTED:5035— index.handleClaudeShipCodeApi has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
dialog.Dialog (cyclomatic 26) packages/ui/src/components/ui/dialog.tsx:56— dialog.Dialog has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 91, 71, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
routing.RoutingView (cyclomatic 26) packages/ui/src/pages/home/components/routing.tsx:20— routing.RoutingView has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 104, 146, 155, …). 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.
serveAsset (cyclomatic 26) REDACTED:2475— serveAsset has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
claude-code-router-plugin.routerRuleConditionMatches (cyclomatic 25) packages/core/src/gateway/claude-code-router-plugin.ts:1390— claude-code-router-plugin.routerRuleConditionMatches 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.
service.resolveProviderMediaTarget (cyclomatic 25) packages/core/src/media/service.ts:717— service.resolveProviderMediaTarget 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.
request-log-store.collectToolCalls (cyclomatic 25) packages/core/src/observability/request-log-store.ts:2951— request-log-store.collectToolCalls 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.
index.handleClaudeShipBakuSessionApi (cyclomatic 25) REDACTED:5314— index.handleClaudeShipBakuSessionApi 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
browser-automation-mcp.detectPageHandoff (cyclomatic 25) REDACTED:2516— browser-automation-mcp.detectPageHandoff 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.
providers.providerJsonConnectorDraftPartsFromDraft (cyclomatic 25) packages/ui/src/pages/home/shared/providers.ts:1300— providers.providerJsonConnectorDraftPartsFromDraft has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
providers.ProviderConnectionStatusPanel (cyclomatic 25) packages/ui/src/pages/home/components/providers.tsx:1739— providers.ProviderConnectionStatusPanel 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.
profiles.ClaudeConfigEditorContent (cyclomatic 25) packages/ui/src/pages/home/components/profiles.tsx:1337— profiles.ClaudeConfigEditorContent has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 1473, a function literal at line 1368, a function literal at line 1376, …). 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.
media-preview-bridge.loadCodexMediaArtifact (cyclomatic 24) packages/core/src/agents/codex/media-preview-bridge.ts:293— media-preview-bridge.loadCodexMediaArtifact 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.
media-preview-bridge.codexMediaPreviewPageBootstrap::receive (cyclomatic 24) packages/core/src/agents/codex/media-preview-bridge.ts:639— media-preview-bridge.codexMediaPreviewPageBootstrap::receive 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.
existing-gateway-probe.reloadExistingCcrGatewayConfig (cyclomatic 24) packages/core/src/gateway/existing-gateway-probe.ts:80— existing-gateway-probe.reloadExistingCcrGatewayConfig 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.
error-detail.appendAggregateErrorAttemptSummary (cyclomatic 24) packages/core/src/gateway/http/error-detail.ts:54— error-detail.appendAggregateErrorAttemptSummary has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
fusion-vision-mcp.analyzeVision (cyclomatic 24) packages/core/src/mcp/fusion-vision-mcp.ts:247— fusion-vision-mcp.analyzeVision 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.
route-trace.boundedPreview (cyclomatic 24) packages/core/src/observability/route-trace.ts:256— route-trace.boundedPreview 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.
claude-design-window.routeClaudeDesignFetchRequest (cyclomatic 24) REDACTED:288— claude-design-window.routeClaudeDesignFetchRequest has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
logs.collectOpenAiStreamToolCalls (cyclomatic 24) packages/ui/src/pages/home/shared/logs.ts:457— logs.collectOpenAiStreamToolCalls has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 462). 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.
zcode.zcodeProviderModelCatalog (cyclomatic 23) packages/core/src/agents/local-providers/zcode.ts:212— zcode.zcodeProviderModelCatalog 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.
fusion-config.fusionFallbackToolDefinitions (cyclomatic 23) packages/core/src/mcp/fusion-config.ts:218— fusion-config.fusionFallbackToolDefinitions 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.
request-log-store.extractUsageSnapshot (cyclomatic 23) packages/core/src/observability/request-log-store.ts:6348— request-log-store.extractUsageSnapshot 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.
index.handleClaudeShipSecrets (cyclomatic 23) REDACTED:7486— index.handleClaudeShipSecrets has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.createDesignRestProject (cyclomatic 23) REDACTED:7662— index.createDesignRestProject has cyclomatic complexity 23 (threshold 15). Of this number, 21 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.gatewaySseEventTextDelta (cyclomatic 23) REDACTED:10833— index.gatewaySseEventTextDelta has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
model-catalog.documentedReasoningProfile (cyclomatic 22) packages/core/src/agents/codex/model-catalog.ts:466— model-catalog.documentedReasoningProfile has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
config.parseProviderCapabilityProtocol (cyclomatic 22) REDACTED:1811— config.parseProviderCapabilityProtocol has cyclomatic complexity 22 (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 is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
deep-link.normalizeDeepLinkModelMetadata (cyclomatic 22) packages/core/src/contracts/deep-link.ts:640— deep-link.normalizeDeepLinkModelMetadata has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClaudeCodeRouterPlugin.routeRequest (cyclomatic 22) packages/core/src/gateway/claude-code-router-plugin.ts:68— ClaudeCodeRouterPlugin.routeRequest 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.
claude-code-router-plugin.resolveRouterRule (cyclomatic 22) packages/core/src/gateway/claude-code-router-plugin.ts:1231— claude-code-router-plugin.resolveRouterRule 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.
discovery.claudeCodeWebSearchToolResultTexts (cyclomatic 22) packages/core/src/gateway/features/hosted-web-search/discovery.ts:244— discovery.claudeCodeWebSearchToolResultTexts has cyclomatic complexity 22 (threshold 15). Of this number, 21 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.
response-transform.transformAnthropicWebSearchProtocolSseText (cyclomatic 22) packages/core/src/gateway/features/hosted-web-search/response-transform.ts:541— response-transform.transformAnthropicWebSearchProtocolSseText has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pricing-service.providerModelPrefixes (cyclomatic 22) packages/core/src/models/pricing-service.ts:477— pricing-service.providerModelPrefixes has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RawTraceSynchronizer.processStoredBundle (cyclomatic 22) packages/core/src/observability/raw-trace-sync.ts:355— RawTraceSynchronizer.processStoredBundle has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RequestLogRuntime.enqueueRawTrace (cyclomatic 22) packages/core/src/observability/request-log-runtime.ts:251— RequestLogRuntime.enqueueRawTrace has cyclomatic complexity 22 (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.
request-log-store.collectToolCallPayloads (cyclomatic 22) packages/core/src/observability/request-log-store.ts:3285— request-log-store.collectToolCallPayloads has cyclomatic complexity 22 (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.
GatewayPluginService.applyGatewayRequestTransforms (cyclomatic 22) packages/core/src/plugins/service.ts:338— GatewayPluginService.applyGatewayRequestTransforms 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.
WindowsManager.openPluginAppWindow (cyclomatic 22) REDACTED:120— WindowsManager.openPluginAppWindow has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 229, 219, 177, …). 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.
virtual-models.virtualModelProfileFromDraft (cyclomatic 22) packages/ui/src/pages/home/shared/virtual-models.ts:525— virtual-models.virtualModelProfileFromDraft has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 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.
profiles.AgentSelectControl (cyclomatic 22) packages/ui/src/pages/home/components/profiles.tsx:547— profiles.AgentSelectControl 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 7 function literals inside it that branch (lines 574, 641, 610, …). 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.
profiles.BotGatewaySelectForm (cyclomatic 22) packages/ui/src/pages/home/components/profiles.tsx:1944— profiles.BotGatewaySelectForm 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 4 function items inside it that branch (a function literal at line 1971, a function literal at line 2001, updateEnabled, …). 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.
update.updatePrimaryAction (cyclomatic 22) packages/ui/src/pages/home/components/update.tsx:161— update.updatePrimaryAction 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.
network-logs.JsonTreeNode (cyclomatic 22) packages/ui/src/pages/home/components/network-logs.tsx:2506— network-logs.JsonTreeNode has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dashboard.ProviderAccountMeterLine (cyclomatic 22) packages/ui/src/pages/home/components/dashboard.tsx:3440— dashboard.ProviderAccountMeterLine 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.
omeletteProjectFromRow (cyclomatic 22) REDACTED:13502— omeletteProjectFromRow has cyclomatic complexity 22 (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 is NOT this file's highest cyclomatic complexity: callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
claude-code-router-plugin.resolveRouterConditionValue (cyclomatic 21) packages/core/src/gateway/claude-code-router-plugin.ts:1440— claude-code-router-plugin.resolveRouterConditionValue has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
context-archive-continuation.openAiResponsesResponseFromSseEvents (cyclomatic 21) packages/core/src/gateway/features/context-archive-continuation.ts:496— context-archive-continuation.openAiResponsesResponseFromSseEvents has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
executor.resolveProviderCredentialRoutingTarget (cyclomatic 21) packages/core/src/gateway/upstream/executor.ts:904— executor.resolveProviderCredentialRoutingTarget 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.
fusion-vision-mcp.sniffImageType (cyclomatic 21) packages/core/src/mcp/fusion-vision-mcp.ts:997— fusion-vision-mcp.sniffImageType has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RequestLogStore.writeBatch (cyclomatic 21) packages/core/src/observability/request-log-store.ts:453— RequestLogStore.writeBatch 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.
launch-service.profileBotRuntimeStatus (cyclomatic 21) packages/core/src/profiles/launch-service.ts:785— launch-service.profileBotRuntimeStatus has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
model-catalog.catalogProviderModelRank (cyclomatic 21) packages/core/src/providers/model-catalog.ts:455— model-catalog.catalogProviderModelRank has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
rewrite.compileRouteRewrite (cyclomatic 21) packages/core/src/routing/rewrite.ts:78— rewrite.compileRouteRewrite has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
store.extractUsageSnapshot (cyclomatic 21) packages/core/src/usage/store.ts:1140— store.extractUsageSnapshot 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.
index.resolveDesignIndexAssets (cyclomatic 21) REDACTED:2995— index.resolveDesignIndexAssets has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
routing.normalizeRouterRules (cyclomatic 21) packages/ui/src/pages/home/shared/routing.ts:103— routing.normalizeRouterRules has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 109). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
providers.providerCredentialsFromDraft (cyclomatic 21) packages/ui/src/pages/home/shared/providers.ts:945— providers.providerCredentialsFromDraft 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.
dialog-stack.AppDialogStack (cyclomatic 21) packages/ui/src/pages/home/components/dialog-stack.tsx:12— dialog-stack.AppDialogStack has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
network-logs.NetworkingView (cyclomatic 21) packages/ui/src/pages/home/components/network-logs.tsx:51— network-logs.NetworkingView has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dashboard.AgentTrajectoryNodePreview (cyclomatic 21) packages/ui/src/pages/home/components/dashboard.tsx:5642— dashboard.AgentTrajectoryNodePreview has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
kimi.readKimiConfiguredProviders (cyclomatic 20) packages/core/src/agents/local-providers/kimi.ts:251— kimi.readKimiConfiguredProviders 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 3 function literals inside it that branch (lines 267, 263, 264). 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.
kimi.splitTomlArray (cyclomatic 20) packages/core/src/agents/local-providers/kimi.ts:577— kimi.splitTomlArray has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
config.parseOpenRouterDiscountRouting (cyclomatic 20) REDACTED:1572— config.parseOpenRouterDiscountRouting 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 is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
config.parseRouterRules (cyclomatic 20) REDACTED:1975— config.parseRouterRules has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1981). 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. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
context-archive-continuation.anthropicMessagesResponseFromSseEvents (cyclomatic 20) packages/core/src/gateway/features/context-archive-continuation.ts:435— context-archive-continuation.anthropicMessagesResponseFromSseEvents has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
marketplace.normalizeMarketplaceEntry (cyclomatic 20) packages/core/src/plugins/marketplace.ts:126— marketplace.normalizeMarketplaceEntry has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: marketplace.pluginPermissionAlias (cyclomatic 40) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
GatewayPluginService.applyPluginRegistration (cyclomatic 20) packages/core/src/plugins/service.ts:554— GatewayPluginService.applyPluginRegistration 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.
service.applyClaudeCodeProfile (cyclomatic 20) REDACTED:399— service.applyClaudeCodeProfile has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
model-catalog.buildCatalogIndex (cyclomatic 20) packages/core/src/providers/model-catalog.ts:200— model-catalog.buildCatalogIndex has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.mergeGatewaySsePayload (cyclomatic 20) REDACTED:10912— index.mergeGatewaySsePayload 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 is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.isOnlineClaudeShipProxyRoutePath (cyclomatic 20) REDACTED:14318— index.isOnlineClaudeShipProxyRoutePath has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
providers.parseProviderAccountDraft (cyclomatic 20) packages/ui/src/pages/home/shared/providers.ts:1090— providers.parseProviderAccountDraft has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
logs.aggregateAnthropicStreamPayloads (cyclomatic 20) packages/ui/src/pages/home/shared/logs.ts:968— logs.aggregateAnthropicStreamPayloads has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
profiles.profileDraftValidation (cyclomatic 20) packages/ui/src/pages/home/components/profiles.tsx:1832— profiles.profileDraftValidation 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.
dashboard.TracePayloadPane (cyclomatic 20) packages/ui/src/pages/home/components/dashboard.tsx:5762— dashboard.TracePayloadPane has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
layout.MainLayout (cyclomatic 20) packages/ui/src/pages/home/components/layout.tsx:90— layout.MainLayout 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.
claudeShipSessionPayload (cyclomatic 20) REDACTED:6264— claudeShipSessionPayload has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
config.parseProxy (cyclomatic 19) REDACTED:2518— config.parseProxy has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
config.parseGatewayPluginSurfaces (cyclomatic 19) REDACTED:3168— config.parseGatewayPluginSurfaces has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
protocol.appendFooterToJson (cyclomatic 19) packages/core/src/gateway/context-archive/protocol.ts:544— protocol.appendFooterToJson has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
router-plugin.createGatewayPlugin (cyclomatic 19) REDACTED:193— router-plugin.createGatewayPlugin has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 385, 346, 221, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RequestLogStore.record (cyclomatic 19) packages/core/src/observability/request-log-store.ts:578— RequestLogStore.record has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (insert). 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.
request-log-store.collectOpenAiStreamToolInput (cyclomatic 19) packages/core/src/observability/request-log-store.ts:3083— request-log-store.collectOpenAiStreamToolInput 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.
request-log-store.detectSseEventError (cyclomatic 19) packages/core/src/observability/request-log-store.ts:6247— request-log-store.detectSseEventError 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.
marketplace.parsePluginSurfaces (cyclomatic 19) packages/core/src/plugins/marketplace.ts:404— marketplace.parsePluginSurfaces has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: marketplace.pluginPermissionAlias (cyclomatic 40) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
account-service.kimiCodeUsageMeter (cyclomatic 19) packages/core/src/providers/account-service.ts:1186— account-service.kimiCodeUsageMeter 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.
account-service.localCodexAccountCredential (cyclomatic 19) packages/core/src/providers/account-service.ts:1590— account-service.localCodexAccountCredential 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.
index.mergeStoredMessagesIntoProjectChats (cyclomatic 19) REDACTED:8047— index.mergeStoredMessagesIntoProjectChats has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.gatewayHttpErrorMessage (cyclomatic 19) REDACTED:10889— index.gatewayHttpErrorMessage has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
profiles.isProfileDraftSubmittable (cyclomatic 19) packages/ui/src/pages/home/shared/profiles.ts:662— profiles.isProfileDraftSubmittable 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.
profiles.normalizeBotGatewayConversationRef (cyclomatic 19) packages/ui/src/pages/home/shared/profiles.ts:1248— profiles.normalizeBotGatewayConversationRef 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.
feedback.PersistenceFeedback (cyclomatic 19) packages/ui/src/pages/home/components/feedback.tsx:7— feedback.PersistenceFeedback 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
dashboard.providerAccountCardResizeHandleIcon (cyclomatic 19) packages/ui/src/pages/home/components/dashboard.tsx:3287— dashboard.providerAccountCardResizeHandleIcon 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.
kimi.refreshKimiAuth (cyclomatic 18) packages/core/src/agents/local-providers/kimi.ts:397— kimi.refreshKimiAuth 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.
config.parseProviderCredentials (cyclomatic 18) REDACTED:1707— config.parseProviderCredentials has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 1713). 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. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
config.parseBotGatewaySavedConfigs (cyclomatic 18) REDACTED:2352— config.parseBotGatewaySavedConfigs has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2358). 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. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
config.parseGatewayPlugins (cyclomatic 18) REDACTED:2653— config.parseGatewayPlugins has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2659). 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. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
claude-code-router-plugin.resolveConfiguredRouteDecision (cyclomatic 18) packages/core/src/gateway/claude-code-router-plugin.ts:304— claude-code-router-plugin.resolveConfiguredRouteDecision has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
claude-code-router-plugin.configuredSubagentModelDescriptionRows (cyclomatic 18) packages/core/src/gateway/claude-code-router-plugin.ts:999— claude-code-router-plugin.configuredSubagentModelDescriptionRows 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.
ContextArchiveService.ask (cyclomatic 18) packages/core/src/gateway/context-archive.ts:207— ContextArchiveService.ask 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.
upstream-header-sanitizer.mergeUpstreamProviderHeaders (cyclomatic 18) packages/core/src/gateway/core-runtime/upstream-header-sanitizer.ts:187— upstream-header-sanitizer.mergeUpstreamProviderHeaders has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
tool-discovery.listLegacySseMcpServerTools (cyclomatic 18) packages/core/src/mcp/tool-discovery.ts:187— tool-discovery.listLegacySseMcpServerTools has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (routeSseEvent, a function literal at line 214, rejectPending). 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.
GatewayMediaExecutor.download (cyclomatic 18) packages/core/src/media/executors.ts:99— GatewayMediaExecutor.download 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.
request-log-worker.isCompleteJsonContainer (cyclomatic 18) packages/core/src/observability/request-log-worker.ts:251— request-log-worker.isCompleteJsonContainer 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.
openrouter-discount-provider-router.endpointSatisfiesProviderConstraints (cyclomatic 18) packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts:815— openrouter-discount-provider-router.endpointSatisfiesProviderConstraints 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.
account-service.refreshCodexAccountToken (cyclomatic 18) packages/core/src/providers/account-service.ts:1652— account-service.refreshCodexAccountToken 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.
probe.resolveGatewayProviderProbe (cyclomatic 18) packages/core/src/providers/probe.ts:340— probe.resolveGatewayProviderProbe 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.
probe.providerProbeCodexOauthRequest (cyclomatic 18) packages/core/src/providers/probe.ts:1223— probe.providerProbeCodexOauthRequest 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.
system-proxy-fetch.shouldBypassProxy (cyclomatic 18) REDACTED:244— system-proxy-fetch.shouldBypassProxy 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.
index.listProjectDirectoryEntries (cyclomatic 18) REDACTED:8516— index.listProjectDirectoryEntries 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
ipc.decodePngPixels (cyclomatic 18) packages/electron/src/main/ipc.ts:743— ipc.decodePngPixels 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 is NOT this file's highest cyclomatic complexity: ipc.pluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
tooltip.Tooltip (cyclomatic 18) packages/ui/src/components/ui/tooltip.tsx:61— tooltip.Tooltip has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 81, 119, 125, …). 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.
profiles.createProfileDraftFromProfile (cyclomatic 18) packages/ui/src/pages/home/shared/profiles.ts:592— profiles.createProfileDraftFromProfile 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.
providers.ProviderMobileCard (cyclomatic 18) packages/ui/src/pages/home/components/providers.tsx:326— providers.ProviderMobileCard 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.
providers.ProviderSetupProgress (cyclomatic 18) packages/ui/src/pages/home/components/providers.tsx:1603— providers.ProviderSetupProgress 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 one function literal inside it that branches (line 1666). 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.
profiles.ProfileRoutingSettings (cyclomatic 18) packages/ui/src/pages/home/components/profiles.tsx:1098— profiles.ProfileRoutingSettings has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (submitRuleDialog, a function literal at line 1188, openEditRuleDialog, …). 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.
network-logs.LogBodyChunkContent (cyclomatic 18) packages/ui/src/pages/home/components/network-logs.tsx:2165— network-logs.LogBodyChunkContent has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
dashboard.OverviewActivityGrid (cyclomatic 18) packages/ui/src/pages/home/components/dashboard.tsx:1565— dashboard.OverviewActivityGrid has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dashboard.overviewMetricDatum (cyclomatic 18) packages/ui/src/pages/home/components/dashboard.tsx:2385— dashboard.overviewMetricDatum 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.
cli.parseArgs (cyclomatic 17) packages/cli/src/cli.ts:245— cli.parseArgs 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.
model-catalog.codexModelCapabilityProfile (cyclomatic 17) packages/core/src/agents/codex/model-catalog.ts:231— model-catalog.codexModelCapabilityProfile 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.
opencode.opencodeCandidates (cyclomatic 17) packages/core/src/agents/local-providers/opencode.ts:83— opencode.opencodeCandidates 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 2 function literals inside it that branch (lines 95, 84). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
zcode.readZcodeConfiguredProviders (cyclomatic 17) packages/core/src/agents/local-providers/zcode.ts:156— zcode.readZcodeConfiguredProviders has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 164). 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.
config.parseGatewayPluginProxyRoutes (cyclomatic 17) REDACTED:3416— config.parseGatewayPluginProxyRoutes has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 3422). 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. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
MediaService.videoStart (cyclomatic 17) packages/core/src/media/service.ts:149— MediaService.videoStart 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.
request-log-store.toRequestLogEntry (cyclomatic 17) packages/core/src/observability/request-log-store.ts:5104— request-log-store.toRequestLogEntry 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 is NOT this file's highest cyclomatic complexity: request-log-store.extractSessionIdFromPayload (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
account-service.kimiCodeUsageLimitLabel (cyclomatic 17) packages/core/src/providers/account-service.ts:1241— account-service.kimiCodeUsageLimitLabel 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.
model-catalog.providerModelMetadataFromCatalog (cyclomatic 17) packages/core/src/providers/model-catalog.ts:278— model-catalog.providerModelMetadataFromCatalog 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.
management-server.inspectPluginDirectory (cyclomatic 17) REDACTED:889— management-server.inspectPluginDirectory has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: management-server.pluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.normalizeProjectViewOpenFiles (cyclomatic 17) REDACTED:8013— index.normalizeProjectViewOpenFiles has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.generatedFilePathFromFenceInfo (cyclomatic 17) REDACTED:11441— index.generatedFilePathFromFenceInfo 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.isVisibleStoredMessage (cyclomatic 17) REDACTED:13166— index.isVisibleStoredMessage has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
ipc.inspectPluginDirectory (cyclomatic 17) packages/electron/src/main/ipc.ts:1030— ipc.inspectPluginDirectory has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ipc.pluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
virtual-models.normalizeVirtualModelDraftPatch (cyclomatic 17) packages/ui/src/pages/home/shared/virtual-models.ts:198— virtual-models.normalizeVirtualModelDraftPatch 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.
virtual-models.fusionVisionConfigFromProfile (cyclomatic 17) packages/ui/src/pages/home/shared/virtual-models.ts:226— virtual-models.fusionVisionConfigFromProfile 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.
virtual-models.selectedFusionToolNamesFromProfile (cyclomatic 17) packages/ui/src/pages/home/shared/virtual-models.ts:859— virtual-models.selectedFusionToolNamesFromProfile has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 867). 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.
profiles.profileConfigFromDraft (cyclomatic 17) packages/ui/src/pages/home/shared/profiles.ts:712— profiles.profileConfigFromDraft has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
profiles.ProfileOpenDialog (cyclomatic 17) packages/ui/src/pages/home/components/profiles.tsx:394— profiles.ProfileOpenDialog has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dashboard.SystemStatusBar (cyclomatic 17) packages/ui/src/pages/home/components/dashboard.tsx:2465— dashboard.SystemStatusBar 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.
dashboard.providerAccountBentoLayout (cyclomatic 17) packages/ui/src/pages/home/components/dashboard.tsx:4314— dashboard.providerAccountBentoLayout 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.
dashboard.UsageAnalysisCard (cyclomatic 17) packages/ui/src/pages/home/components/dashboard.tsx:6274— dashboard.UsageAnalysisCard has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TrayApp.TrayApp (cyclomatic 17) packages/ui/src/pages/tray/TrayApp.tsx:17— TrayApp.TrayApp has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 32, 67, 117, …). 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.
ProfileViewDemo.ProfileViewDemo (cyclomatic 16) docs/src/components/interactive/ProfileViewDemo.tsx:38— ProfileViewDemo.ProfileViewDemo 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 4 function items inside it that branch (play, a function literal at line 99, submitProfile, …). 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.
cli.parseWebArgs (cyclomatic 16) packages/cli/src/cli.ts:324— cli.parseWebArgs 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.
cli.runWebServer (cyclomatic 16) packages/cli/src/cli.ts:495— cli.runWebServer 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 3 function items inside it that branch (a function literal at line 537, shutdown, a function literal at line 527). 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.
handoff-scan-service.bluetoothScanTargetFromObject (cyclomatic 16) packages/core/src/agents/bot-gateway/handoff-scan-service.ts:160— handoff-scan-service.bluetoothScanTargetFromObject 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.
model-catalog.buildCodexModelCatalogIds (cyclomatic 16) packages/core/src/agents/codex/model-catalog.ts:78— model-catalog.buildCodexModelCatalogIds 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.
model-catalog.normalizeProviderProtocol (cyclomatic 16) packages/core/src/agents/codex/model-catalog.ts:618— model-catalog.normalizeProviderProtocol 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.
model-catalog.virtualModelMatchesCatalogModel (cyclomatic 16) packages/core/src/agents/codex/model-catalog.ts:695— model-catalog.virtualModelMatchesCatalogModel 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.
config.normalizeBotGatewayAuthType (cyclomatic 16) REDACTED:172— config.normalizeBotGatewayAuthType 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. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
config.loadAppConfig (cyclomatic 16) REDACTED:245— config.loadAppConfig has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: config.gatewayPluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
config-compiler.compileCoreGatewayConfig (cyclomatic 16) packages/core/src/gateway/core-runtime/config-compiler.ts:44— config-compiler.compileCoreGatewayConfig 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.
evidence.synthesizeComponentChangelogWebSearchAnswer (cyclomatic 16) packages/core/src/gateway/features/hosted-web-search/evidence.ts:284— evidence.synthesizeComponentChangelogWebSearchAnswer has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
model-discovery.buildGatewayDiscoverableModelIds (cyclomatic 16) packages/core/src/gateway/features/model-discovery.ts:503— model-discovery.buildGatewayDiscoverableModelIds 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.
CcrRemoteControlService.appendEvent (cyclomatic 16) packages/core/src/gateway/remote-control-service.ts:371— CcrRemoteControlService.appendEvent 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.
request-log-store.userTextCandidates (cyclomatic 16) packages/core/src/observability/request-log-store.ts:2469— request-log-store.userTextCandidates has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: request-log-store.extractSessionIdFromPayload (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
route-trace.sanitizeReportedChange (cyclomatic 16) packages/core/src/observability/route-trace.ts:204— route-trace.sanitizeReportedChange 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.
marketplace.parsePluginDependency (cyclomatic 16) packages/core/src/plugins/marketplace.ts:194— marketplace.parsePluginDependency has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: marketplace.pluginPermissionAlias (cyclomatic 40) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
launch-service.openProfileFromCcr (cyclomatic 16) packages/core/src/profiles/launch-service.ts:121— launch-service.openProfileFromCcr 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.
launch-service.openOpenCodeAppProfile (cyclomatic 16) packages/core/src/profiles/launch-service.ts:168— launch-service.openOpenCodeAppProfile 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.
service.applyProfileConfig (cyclomatic 16) REDACTED:146— service.applyProfileConfig has cyclomatic complexity 16 (threshold 15). Of this number, 13 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.
credential-pool.recordProviderCredentialOutcome (cyclomatic 16) packages/core/src/providers/credential-pool.ts:39— credential-pool.recordProviderCredentialOutcome 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.
icons.providerIconMagicExtension (cyclomatic 16) REDACTED:285— icons.providerIconMagicExtension 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.
probe.protocolHints (cyclomatic 16) packages/core/src/providers/probe.ts:1823— probe.protocolHints 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.
runtime-topology.normalizeProviderProtocol (cyclomatic 16) packages/core/src/providers/runtime-topology.ts:388— runtime-topology.normalizeProviderProtocol 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.
config-compiler.scriptRuleDiagnostics (cyclomatic 16) packages/core/src/routing/config-compiler.ts:182— config-compiler.scriptRuleDiagnostics 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.
management-server.parsePluginSurfaces (cyclomatic 16) REDACTED:999— management-server.parsePluginSurfaces has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: management-server.pluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.appendDesignAgentMessage (cyclomatic 16) REDACTED:7751— index.appendDesignAgentMessage has cyclomatic complexity 16 (threshold 15). Of this number, 13 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.proxyArtifactMessages (cyclomatic 16) REDACTED:10019— index.proxyArtifactMessages 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
index.normalizeClaudeDesignRoutingRule (cyclomatic 16) REDACTED:11782— index.normalizeClaudeDesignRoutingRule 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. This is NOT this file's highest cyclomatic complexity: index.callDesignMcpTool (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
chrome-login-import.normalizeChromeCookie (cyclomatic 16) packages/electron/src/main/chrome-login-import.ts:273— chrome-login-import.normalizeChromeCookie 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.
browser-automation-mcp.compactJsonValue (cyclomatic 16) REDACTED:3377— browser-automation-mcp.compactJsonValue 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.
electron-web-search-mcp.searchUrlForEngine (cyclomatic 16) packages/electron/src/main/electron-web-search-mcp.ts:671— electron-web-search-mcp.searchUrlForEngine 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.
ipc.parsePluginSurfaces (cyclomatic 16) packages/electron/src/main/ipc.ts:1210— ipc.parsePluginSurfaces has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ipc.pluginPermissionAlias (cyclomatic 36) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
routing.normalizeClaudeDesignRoutingRuleDraft (cyclomatic 16) packages/ui/src/pages/home/shared/routing.ts:440— routing.normalizeClaudeDesignRoutingRuleDraft 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.
virtual-models.fusionWebSearchConfigFromProfile (cyclomatic 16) packages/ui/src/pages/home/shared/virtual-models.ts:287— virtual-models.fusionWebSearchConfigFromProfile 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.
providers.createProviderInstallLinkFromDraft (cyclomatic 16) packages/ui/src/pages/home/shared/providers.ts:1543— providers.createProviderInstallLinkFromDraft 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.
profiles.normalizeBotGatewayAuthType (cyclomatic 16) packages/ui/src/pages/home/shared/profiles.ts:1104— profiles.normalizeBotGatewayAuthType 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.
logs.aggregateOpenAiStreamPayloads (cyclomatic 16) packages/ui/src/pages/home/shared/logs.ts:288— logs.aggregateOpenAiStreamPayloads 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.
logs.collectOpenAiResponseOutputItem (cyclomatic 16) packages/ui/src/pages/home/shared/logs.ts:771— logs.collectOpenAiResponseOutputItem 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.
logs.aggregateGeminiStreamPayloads (cyclomatic 16) packages/ui/src/pages/home/shared/logs.ts:1169— logs.aggregateGeminiStreamPayloads 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.
No assertions: generated Codex CLI middleware runtime is valid JavaScript packages/core/test/integration/agents/codex-cli-middleware-runtime.test.mjs:11— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
GatewayRequestPipeline.proxyRequest (cognitive 153) packages/core/src/gateway/request/pipeline.ts:123— GatewayRequestPipeline.proxyRequest has cognitive complexity 153 (threshold 15). Drivers by points: if/else 57 (75 pts), boolean chains 34, ternaries 25 (34 pts), loops 4 (7 pts), error handling 2 (3 pts) (nesting depth added 31). Of this number, 134 points are the body's own statements and 19 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
profiles.AddProfileForm (cognitive 144) packages/ui/src/pages/home/components/profiles.tsx:710— profiles.AddProfileForm has cognitive complexity 144 (threshold 15). Drivers by points: ternaries 45 (128 pts), boolean chains 13, if/else 3 (nesting depth added 83). Of this number, 124 points are the body's own statements and 20 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
profiles.normalizeUnknownProfileItem (cognitive 135) packages/ui/src/pages/home/shared/profiles.ts:1540— profiles.normalizeUnknownProfileItem has cognitive complexity 135 (threshold 15). Drivers by points: ternaries 50 (124 pts), boolean chains 10, if/else 1 (nesting depth added 74). 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.
providers.AddProviderForm (cognitive 118) packages/ui/src/pages/home/components/providers.tsx:1961— providers.AddProviderForm has cognitive complexity 118 (threshold 15). Drivers by points: ternaries 38 (84 pts), boolean chains 20, if/else 10 (14 pts) (nesting depth added 50). Of this number, 58 points are the body's own statements and 60 belong to 16 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.
providers.ProviderUsageSettings (cognitive 110) packages/ui/src/pages/home/components/providers.tsx:2888— providers.ProviderUsageSettings has cognitive complexity 110 (threshold 15). Drivers by points: ternaries 31 (92 pts), if/else 10, boolean chains 5, error handling 3 (nesting depth added 61). Of this number, 90 points are the body's own statements and 20 belong to 6 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.
executor.fetchUpstreamWithFallback (cognitive 87) packages/core/src/gateway/upstream/executor.ts:291— executor.fetchUpstreamWithFallback has cognitive complexity 87 (threshold 15). Drivers by points: ternaries 23 (53 pts), if/else 11 (26 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-automation-mcp.targetActionScript (cognitive 87) REDACTED:2904— browser-automation-mcp.targetActionScript has cognitive complexity 87 (threshold 15). Drivers by points: if/else 35 (50 pts), boolean chains 18, ternaries 10 (18 pts), error handling 1 (nesting depth added 23). Of this number, 45 points are the body's own statements and 42 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.OverviewView (cognitive 83) packages/ui/src/pages/home/components/dashboard.tsx:48— dashboard.OverviewView has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 31 (41 pts), if/else 24, boolean chains 17, error handling 1 (nesting depth added 10). Most of this is not in the body itself: 15 of the 83 points are its own statements and the rest belongs to 33 function items inside it that branch (a function literal at line 208, changeWidgetAccountCardSize, a function literal at line 127, …). 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.
dashboard.ProviderAccountsOverview (cognitive 83) packages/ui/src/pages/home/components/dashboard.tsx:2608— dashboard.ProviderAccountsOverview has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 20 (71 pts), boolean chains 9, if/else 3 (nesting depth added 51). Of this number, 26 points are the body's own statements and 57 belong to 5 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.
index.handleDesignRestApi (cognitive 81) REDACTED:9815— index.handleDesignRestApi has cognitive complexity 81 (threshold 15). Drivers by points: if/else 35 (53 pts), boolean chains 28 (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.
config.parseProfile (cognitive 78) REDACTED:3480— config.parseProfile has cognitive complexity 78 (threshold 15). Drivers by points: if/else 31 (56 pts), boolean chains 13, ternaries 5 (9 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.parseProfiles (cognitive 75) REDACTED:3616— config.parseProfiles has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 26 (40 pts), boolean chains 29, if/else 6 (nesting depth added 14). Most of this is not in the body itself: 1 of the 75 points is its own statement and the rest belongs to one function literal inside it that branches (line 3622). 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.
browser-automation-mcp.waitForReadiness (cognitive 75) REDACTED:1653— browser-automation-mcp.waitForReadiness has cognitive complexity 75 (threshold 15). Drivers by points: if/else 25 (57 pts), boolean chains 12, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayHttpRequestHandler.handleRequest (cognitive 74) packages/core/src/gateway/http/request-handler.ts:54— GatewayHttpRequestHandler.handleRequest has cognitive complexity 74 (threshold 15). Drivers by points: if/else 39 (60 pts), boolean chains 12, ternaries 1 (2 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.
RequestLogStore.updateFromRawTrace (cognitive 74) packages/core/src/observability/request-log-store.ts:822— RequestLogStore.updateFromRawTrace has cognitive complexity 74 (threshold 15). Drivers by points: boolean chains 29, if/else 22 (27 pts), ternaries 12 (18 pts) (nesting depth added 11). Of this number, 72 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
fusion-config.fusionBuiltinToolArtifacts (cognitive 72) packages/core/src/mcp/fusion-config.ts:19— fusion-config.fusionBuiltinToolArtifacts has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 11 (44 pts), if/else 8 (22 pts), boolean chains 5, loops 1 (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.
request-log-store.assistantFullTextCandidates (cognitive 71) packages/core/src/observability/request-log-store.ts:2746— request-log-store.assistantFullTextCandidates has cognitive complexity 71 (threshold 15). Drivers by points: if/else 29 (53 pts), ternaries 3 (7 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
logs.aggregateOpenAiResponsesStreamPayloads (cognitive 71) packages/ui/src/pages/home/shared/logs.ts:659— logs.aggregateOpenAiResponsesStreamPayloads has cognitive complexity 71 (threshold 15). Drivers by points: if/else 25 (56 pts), boolean chains 11, ternaries 2 (3 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fusion-config.fusionFallbackToolDefinitions (cognitive 67) packages/core/src/mcp/fusion-config.ts:218— fusion-config.fusionFallbackToolDefinitions has cognitive complexity 67 (threshold 15). Drivers by points: if/else 10 (37 pts), ternaries 5 (21 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.ProviderAccountSummaryCard (cognitive 67) packages/ui/src/pages/home/components/dashboard.tsx:2929— dashboard.ProviderAccountSummaryCard has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 24 (51 pts), boolean chains 13, if/else 2 (3 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
settings.BotConfigDialog (cognitive 66) packages/ui/src/pages/home/components/settings.tsx:1453— settings.BotConfigDialog has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 23, ternaries 10 (11 pts), error handling 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 8 of the 66 points are its own statements and the rest belongs to 16 function items inside it that branch (saveWithQrLogin, waitForQrLoginConfirmation, startQrLogin, …). 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.
index.routeMockRequest (cognitive 63) REDACTED:895— index.routeMockRequest has cognitive complexity 63 (threshold 15). Drivers by points: if/else 37 (41 pts), boolean chains 22 (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.
routing.AddRoutingRuleDialog (cognitive 63) packages/ui/src/pages/home/components/routing.tsx:375— routing.AddRoutingRuleDialog has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 28 (51 pts), boolean chains 5, if/else 5, error handling 2 (nesting depth added 23). Of this number, 20 points are the body's own statements and 43 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-automation-mcp.waitForNextReadinessEvent (cognitive 62) REDACTED:1772— browser-automation-mcp.waitForNextReadinessEvent has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 18, ternaries 2 (3 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence.synthesizeWeatherWebSearchAnswer (cognitive 61) packages/core/src/gateway/features/hosted-web-search/evidence.ts:358— evidence.synthesizeWeatherWebSearchAnswer has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 29 (52 pts), boolean chains 5, if/else 4 (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.
providers.ProvidersView (cognitive 61) packages/ui/src/pages/home/components/providers.tsx:31— providers.ProvidersView has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 18 (40 pts), boolean chains 12, if/else 6 (8 pts), loops 1 (nesting depth added 24). Most of this is not in the body itself: 4 of the 61 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 165, a function literal at line 179, a function literal at line 63, …). 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.
providers.ModelMetadataEditor (cognitive 60) packages/ui/src/pages/home/components/providers.tsx:4669— providers.ModelMetadataEditor has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 17 (30 pts), if/else 21, boolean chains 9 (nesting depth added 13). Most of this is not in the body itself: 5 of the 60 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 4889, a function literal at line 4751, a function literal at line 4775, …). 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.
profiles.ProfileView (cognitive 60) packages/ui/src/pages/home/components/profiles.tsx:53— profiles.ProfileView has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 27 (48 pts), boolean chains 12 (nesting depth added 21). Most of this is not in the body itself: 2 of the 60 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 118, 125, 231). 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.
service.restoreInactiveGlobalProfileConfigs (cognitive 59) REDACTED:3481— service.restoreInactiveGlobalProfileConfigs has cognitive complexity 59 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 19, loops 7 (15 pts) (nesting depth added 21). Of this number, 57 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App.App (cognitive 59) packages/ui/src/pages/home/App.tsx:182— App.App has cognitive complexity 59 (threshold 15). Drivers by points: if/else 249 (276 pts), ternaries 120 (147 pts), boolean chains 99, error handling 23 (24 pts), loops 4 (6 pts) (nesting depth added 57). 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 (App.App::persistConfig, App.App::refreshProviderModels, App.App::submitProviderDraft) 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.
virtual-models.FusionToolSelectControl (cognitive 58) packages/ui/src/pages/home/components/virtual-models.tsx:1021— virtual-models.FusionToolSelectControl has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 21 (37 pts), boolean chains 14, if/else 7 (nesting depth added 16). Most of this is not in the body itself: 15 of the 58 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 1208, 1232, 1069, …). 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.
createClaudeProductPlugin.setup (cognitive 57) REDACTED:530— createClaudeProductPlugin.setup has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 31, ternaries 19 (21 pts), if/else 3, loops 1, other 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
settings.TraySettingsPage (cognitive 55) packages/ui/src/pages/home/components/settings.tsx:1908— settings.TraySettingsPage has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 23 (28 pts), if/else 17 (19 pts), boolean chains 8 (nesting depth added 7). Of this number, 16 points are the body's own statements and 39 belong to 16 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
providers.ProviderModelPicker (cognitive 52) packages/ui/src/pages/home/components/providers.tsx:3900— providers.ProviderModelPicker has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 21 (36 pts), if/else 7 (9 pts), boolean chains 7 (nesting depth added 17). Of this number, 30 points are the body's own statements and 22 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.
cli.main (cognitive 51) packages/cli/src/cli.ts:74— cli.main has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 14, ternaries 2 (3 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.
config.pickConfig (cognitive 51) REDACTED:769— config.pickConfig has cognitive complexity 51 (threshold 15). Drivers by points: if/else 40 (44 pts), boolean chains 7 (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.
tools.mediaToolBindingsForConfig (cognitive 51) packages/core/src/media/tools.ts:30— tools.mediaToolBindingsForConfig has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 5 (13 pts), boolean chains 7, loops 1 (nesting depth added 22). Of this number, 48 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.
OpenAiToolHubSearchAgent.search (cognitive 50) packages/core/src/mcp/toolhub-mcp.ts:1467— OpenAiToolHubSearchAgent.search has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 8 (19 pts), boolean chains 8, loops 2 (4 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.
shared.stripJsonCommentsAndTrailingCommas (cognitive 49) packages/core/src/agents/local-providers/shared.ts:202— shared.stripJsonCommentsAndTrailingCommas has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 5 (11 pts), boolean chains 7 (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.
index.createClaudeProductPlugin.setup (cognitive 49) REDACTED:530— index.createClaudeProductPlugin.setup has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 28, ternaries 13 (17 pts), if/else 3, loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
profiles.normalizeProfileItem (cognitive 49) packages/ui/src/pages/home/shared/profiles.ts:1395— profiles.normalizeProfileItem has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 19 (28 pts), boolean chains 18, if/else 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.
providers.ProviderDeepLinkDialog (cognitive 49) packages/ui/src/pages/home/components/providers.tsx:758— providers.ProviderDeepLinkDialog has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 23 (41 pts), boolean chains 8 (nesting depth added 18). Of this number, 48 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.
providers.AddProviderDialog (cognitive 49) packages/ui/src/pages/home/components/providers.tsx:3466— providers.AddProviderDialog has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 15 (22 pts), boolean chains 19, if/else 5, match/switch 2, error handling 1 (nesting depth added 7). Of this number, 36 points are the body's own statements and 13 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.
service.applyProfileConfig (cognitive 48) REDACTED:146— service.applyProfileConfig has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 8 (44 pts), if/else 2, boolean chains 1, loops 1 (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.
main.BrowserChrome (cognitive 47) packages/ui/src/pages/browser/main.tsx:31— main.BrowserChrome has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 17 (26 pts), if/else 13, boolean chains 6, error handling 2 (nesting depth added 9). Of this number, 19 points are the body's own statements and 28 belong to 10 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
config.parseBotGateway (cognitive 45) REDACTED:2221— config.parseBotGateway has cognitive complexity 45 (threshold 15). Drivers by points: if/else 35, boolean chains 10. 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.
profiles.normalizeProfileAgent (cognitive 45) packages/ui/src/pages/home/shared/profiles.ts:1800— profiles.normalizeProfileAgent has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 9 (45 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.
serveAsset (cognitive 45) REDACTED:2475— serveAsset has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 2 (8 pts), boolean chains 7, loops 2 (5 pts), error handling 1 (4 pts) (nesting depth added 22). Of this number, 40 points are the body's own statements and 5 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.
RequestLogStore.writeBatch (cognitive 44) packages/core/src/observability/request-log-store.ts:453— RequestLogStore.writeBatch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 5, ternaries 1 (5 pts), error handling 1, loops 1 (nesting depth added 24). 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.
index.handleAdminRequest (cognitive 44) REDACTED:4102— index.handleAdminRequest has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 25, if/else 11 (13 pts), ternaries 3 (6 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
index.handleClaudeShipSessionApi (cognitive 44) REDACTED:5197— index.handleClaudeShipSessionApi has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 16 (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.
extensions.wrapperPluginCapability (cognitive 43) packages/ui/src/pages/home/shared/extensions.ts:560— extensions.wrapperPluginCapability has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 17 (28 pts), if/else 10, boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
providers.ProviderConnectionStatusPanel (cognitive 43) packages/ui/src/pages/home/components/providers.tsx:1739— providers.ProviderConnectionStatusPanel has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 19 (38 pts), boolean chains 5 (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.
providers.OpenRouterProviderBlacklistSelect (cognitive 43) packages/ui/src/pages/home/components/providers.tsx:4272— providers.OpenRouterProviderBlacklistSelect has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 16 (24 pts), if/else 10, boolean chains 8, error handling 1 (nesting depth added 8). Most of this is not in the body itself: 15 of the 43 points are its own statements and the rest belongs to 9 function items inside it that branch (loadProviders, a function literal at line 4323, a function literal at line 4514, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
model-selector.ModelSelector (cognitive 43) packages/ui/src/pages/home/components/model-selector.tsx:36— model-selector.ModelSelector has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 13 (21 pts), boolean chains 15, if/else 7 (nesting depth added 8). Of this number, 27 points are the body's own statements and 16 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
virtual-models.VirtualModelDialog (cognitive 43) packages/ui/src/pages/home/components/virtual-models.tsx:275— virtual-models.VirtualModelDialog has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 15 (17 pts), if/else 13 (14 pts), boolean chains 9, loops 2, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 43 points are its own statements and the rest belongs to 14 function items inside it that branch (applyFusionTools, discoverMcpServerTools, submitCustomMcpDialog, …). 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.
network-logs.LogsView (cognitive 43) packages/ui/src/pages/home/components/network-logs.tsx:353— network-logs.LogsView has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 10, if/else 7 (nesting depth added 9). Of this number, 22 points are the body's own statements and 21 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.
BrowserAutomationMcpService.runTool (cognitive 42) REDACTED:773— BrowserAutomationMcpService.runTool has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 4 (8 pts), boolean chains 7, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
profiles.ClaudeConfigEditorContent (cognitive 42) packages/ui/src/pages/home/components/profiles.tsx:1337— profiles.ClaudeConfigEditorContent has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 18 (35 pts), if/else 5, boolean chains 2 (nesting depth added 17). Most of this is not in the body itself: 6 of the 42 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 1473, updateSetting, a function literal at line 1368, …). 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.
profiles.profileSummaryItems (cognitive 41) packages/ui/src/pages/home/shared/profiles.ts:1285— profiles.profileSummaryItems has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 21 (29 pts), boolean chains 9, if/else 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.
providers.LocalAgentProviderImportPanel (cognitive 41) packages/ui/src/pages/home/components/providers.tsx:1372— providers.LocalAgentProviderImportPanel has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 12 (23 pts), boolean chains 11, if/else 6, error handling 1 (nesting depth added 11). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 1481, importCandidate, a function literal at line 1391, …). 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.
claude-code-router-plugin.resolveRouterRule (cognitive 39) packages/core/src/gateway/claude-code-router-plugin.ts:1231— claude-code-router-plugin.resolveRouterRule has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 11 (26 pts), if/else 7 (10 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.handleOrganizationApi (cognitive 39) REDACTED:4002— index.handleOrganizationApi has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 8 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
zcode.zcodeProviderModelCatalog (cognitive 38) packages/core/src/agents/local-providers/zcode.ts:212— zcode.zcodeProviderModelCatalog has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 6, ternaries 2 (6 pts), loops 2 (4 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.
model-catalog.buildCatalogIndex (cognitive 38) packages/core/src/providers/model-catalog.ts:200— model-catalog.buildCatalogIndex has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 7, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 19). Of this number, 36 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
provider-references.renameProviderReferences (cognitive 38) packages/ui/src/pages/home/shared/provider-references.ts:4— provider-references.renameProviderReferences has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 10 (15 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (provider-references.renameProviderReferences::rules) 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.
dashboard.CodexResetCreditDialog (cognitive 38) packages/ui/src/pages/home/components/dashboard.tsx:3640— dashboard.CodexResetCreditDialog has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 18 (19 pts), if/else 10, boolean chains 8, error handling 1 (nesting depth added 1). Of this number, 20 points are the body's own statements and 18 belong to 9 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.
config.parseGatewayPluginSurfaces (cognitive 37) REDACTED:3168— config.parseGatewayPluginSurfaces has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5 (15 pts), boolean chains 2, ternaries 1 (nesting depth added 17). Of this number, 36 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
request-log-store.assistantStreamText (cognitive 37) packages/core/src/observability/request-log-store.ts:2697— request-log-store.assistantStreamText has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 9, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
marketplace.parsePluginSurfaces (cognitive 37) packages/core/src/plugins/marketplace.ts:404— marketplace.parsePluginSurfaces has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5 (15 pts), boolean chains 2, ternaries 1 (nesting depth added 17). Of this number, 36 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
profiles.normalizeBotGatewayRuntimeConfig (cognitive 37) packages/ui/src/pages/home/shared/profiles.ts:1171— profiles.normalizeBotGatewayRuntimeConfig has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 33, if/else 3, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
service.applyProfileRuntimeConfig (cognitive 36) REDACTED:366— service.applyProfileRuntimeConfig has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 8 (36 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
dashboard.ModelDistributionOverviewWidget (cognitive 36) packages/ui/src/pages/home/components/dashboard.tsx:1809— dashboard.ModelDistributionOverviewWidget has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (33 pts), boolean chains 3 (nesting depth added 22). Of this number, 21 points are the body's own statements and 15 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
context-archive-continuation.openAiResponsesResponseFromSseEvents (cognitive 35) packages/core/src/gateway/features/context-archive-continuation.ts:496— context-archive-continuation.openAiResponsesResponseFromSseEvents has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 5 (8 pts), boolean chains 3, loops 1 (nesting depth added 15). Of this number, 34 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.
toolhub-mcp.normalizeServerConfig (cognitive 34) packages/core/src/mcp/toolhub-mcp.ts:1852— toolhub-mcp.normalizeServerConfig has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 16 (22 pts), boolean chains 6, if/else 5 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-discovery.buildGatewayDiscoverableModelIds (cognitive 33) packages/core/src/gateway/features/model-discovery.ts:503— model-discovery.buildGatewayDiscoverableModelIds has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 7 (14 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.
logs.aggregateAnthropicStreamPayloads (cognitive 33) packages/ui/src/pages/home/shared/logs.ts:968— logs.aggregateAnthropicStreamPayloads has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 5, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboarding.OnboardingView (cognitive 33) packages/ui/src/pages/home/components/onboarding.tsx:40— onboarding.OnboardingView has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 21, ternaries 15 (18 pts), match/switch 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: one other method here (onboarding.OnboardingView::goToNextStep) 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.
GatewayService.startGateway (cognitive 32) REDACTED:158— GatewayService.startGateway has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 12, ternaries 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.
existing-gateway-probe.reloadExistingCcrGatewayConfig (cognitive 32) packages/core/src/gateway/existing-gateway-probe.ts:80— existing-gateway-probe.reloadExistingCcrGatewayConfig has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
request-log-worker.reviveCommand (cognitive 32) packages/core/src/observability/request-log-worker.ts:148— request-log-worker.reviveCommand has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 3 (5 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
account-service.readJsonPath (cognitive 32) packages/core/src/providers/account-service.ts:2373— account-service.readJsonPath has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
providers.ProviderPresetCombobox (cognitive 32) packages/ui/src/pages/home/components/providers.tsx:944— providers.ProviderPresetCombobox has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13 (16 pts), if/else 10 (11 pts), boolean chains 5 (nesting depth added 4). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 981, a function literal at line 1142, a function literal at line 1026, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
model-catalog.buildCodexModelCatalogIds (cognitive 31) packages/core/src/agents/codex/model-catalog.ts:78— model-catalog.buildCodexModelCatalogIds has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 7 (14 pts), boolean chains 1, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opencode.readOpenCodeCatalog (cognitive 31) packages/core/src/agents/local-providers/opencode.ts:447— opencode.readOpenCodeCatalog has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (8 pts), ternaries 6 (8 pts), loops 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.mergeStoredMessagesIntoProjectChats (cognitive 31) REDACTED:8047— index.mergeStoredMessagesIntoProjectChats has cognitive complexity 31 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 4 (9 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
network-logs.LogExpandedDetails (cognitive 31) packages/ui/src/pages/home/components/network-logs.tsx:947— network-logs.LogExpandedDetails has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 21 (23 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ClaudeCodeRouterPlugin.routeRequest (cognitive 30) packages/core/src/gateway/claude-code-router-plugin.ts:68— ClaudeCodeRouterPlugin.routeRequest has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 13 (19 pts), if/else 4 (6 pts), boolean chains 3, 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.
providers.createProviderAccountDraftFromConfig (cognitive 30) packages/ui/src/pages/home/shared/providers.ts:1202— providers.createProviderAccountDraftFromConfig has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, ternaries 10 (13 pts), if/else 3 (nesting depth added 3). Of this number, 28 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.
dashboard.SystemStatusBar (cognitive 30) packages/ui/src/pages/home/components/dashboard.tsx:2465— dashboard.SystemStatusBar has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 14 (28 pts), if/else 2 (nesting depth added 14). Of this number, 29 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.
chatWithGateway (cognitive 30) REDACTED:10458— chatWithGateway has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, if/else 7, ternaries 5 (6 pts), error handling 1 (nesting depth added 1). Of this number, 28 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
ProvidersViewDemo.ProvidersViewDemo (cognitive 29) docs/src/components/interactive/ProvidersViewDemo.tsx:72— ProvidersViewDemo.ProvidersViewDemo has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 6 (8 pts), boolean chains 5, loops 1 (nesting depth added 3). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 7 function items inside it that branch (play, a function literal at line 104, play::waitFor, …). 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.
cli.parseWebArgs (cognitive 29) packages/cli/src/cli.ts:324— cli.parseWebArgs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
media-preview-bridge.codexMediaPreviewPageBootstrap::receive (cognitive 29) packages/core/src/agents/codex/media-preview-bridge.ts:639— media-preview-bridge.codexMediaPreviewPageBootstrap::receive has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 5 (8 pts), boolean chains 4, loops 1 (2 pts), error handling 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.
app.availableGatewayModelIds (cognitive 29) packages/core/src/contracts/app.ts:1143— app.availableGatewayModelIds has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 5 (11 pts), ternaries 1 (4 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.
claude-code-router-plugin.routerRuleConditionMatches (cognitive 29) packages/core/src/gateway/claude-code-router-plugin.ts:1390— claude-code-router-plugin.routerRuleConditionMatches has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 3 (6 pts), boolean chains 5 (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.
index.handleClaudeShipCodeApi (cognitive 29) REDACTED:5035— index.handleClaudeShipCodeApi has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 9 (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.
index.normalizeQuestionsV2Question (cognitive 29) REDACTED:12811— index.normalizeQuestionsV2Question has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 5, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
profiles.normalizeBotGatewayConversationRef (cognitive 29) packages/ui/src/pages/home/shared/profiles.ts:1248— profiles.normalizeBotGatewayConversationRef has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 13 (25 pts), boolean chains 2, if/else 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routing.RoutingView (cognitive 29) packages/ui/src/pages/home/components/routing.tsx:20— routing.RoutingView has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, ternaries 7 (11 pts), if/else 2 (4 pts) (nesting depth added 6). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 104, 146, 155, …). 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.
network-logs.JsonTreeNode (cognitive 29) packages/ui/src/pages/home/components/network-logs.tsx:2506— network-logs.JsonTreeNode has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 17 (25 pts), boolean chains 2, if/else 2 (nesting depth added 8). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
grok.grokModelCatalogFromPayload (cognitive 28) packages/core/src/agents/local-providers/grok.ts:371— grok.grokModelCatalogFromPayload has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 9, ternaries 3 (6 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
request-log-store.inferAgentFromText (cognitive 28) packages/core/src/observability/request-log-store.ts:2043— request-log-store.inferAgentFromText has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 18, if/else 10. 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.
route-trace.boundedPreview (cognitive 28) packages/core/src/observability/route-trace.ts:256— route-trace.boundedPreview has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayPluginService.applyGatewayRequestTransforms (cognitive 28) packages/core/src/plugins/service.ts:338— GatewayPluginService.applyGatewayRequestTransforms has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 4 (8 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
service.profilePath (cognitive 28) REDACTED:902— service.profilePath has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (28 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
account-service.readJsonPathBracket (cognitive 28) packages/core/src/providers/account-service.ts:2464— account-service.readJsonPathBracket has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (5 pts), error handling 1 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
management-server.parsePluginSurfaces (cognitive 28) REDACTED:999— management-server.parsePluginSurfaces has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 10). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ipc.parsePluginSurfaces (cognitive 28) packages/electron/src/main/ipc.ts:1210— ipc.parsePluginSurfaces has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 10). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.providerAccountBentoPackedRowCount::place (cognitive 28) packages/ui/src/pages/home/components/dashboard.tsx:4388— dashboard.providerAccountBentoPackedRowCount::place has cognitive complexity 28 (threshold 15). Drivers by points: loops 6 (19 pts), if/else 2 (8 pts), boolean chains 1 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
claude-code-router-plugin.configuredSubagentModelDescriptionRows (cognitive 27) packages/core/src/gateway/claude-code-router-plugin.ts:999— claude-code-router-plugin.configuredSubagentModelDescriptionRows has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 5, loops 4 (5 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
context-archive-continuation.anthropicMessagesResponseFromSseEvents (cognitive 27) packages/core/src/gateway/features/context-archive-continuation.ts:435— context-archive-continuation.anthropicMessagesResponseFromSseEvents has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
discovery.claudeCodeWebSearchToolResultTexts (cognitive 27) packages/core/src/gateway/features/hosted-web-search/discovery.ts:244— discovery.claudeCodeWebSearchToolResultTexts has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 9). Of this number, 26 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.
fusion-vision-mcp.analyzeVision (cognitive 27) packages/core/src/mcp/fusion-vision-mcp.ts:247— fusion-vision-mcp.analyzeVision has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 5 (7 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.listProjectDirectoryEntries (cognitive 27) REDACTED:8516— index.listProjectDirectoryEntries has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 4 (8 pts), boolean chains 6, loops 1 (nesting depth added 10). Of this number, 24 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.forEachProtoField (cognitive 27) REDACTED:13867— index.forEachProtoField has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dialog.Dialog (cognitive 27) packages/ui/src/components/ui/dialog.tsx:56— dialog.Dialog has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, ternaries 3 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 91, 71, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
providers.providerCredentialsFromDraft (cognitive 27) packages/ui/src/pages/home/shared/providers.ts:945— providers.providerCredentialsFromDraft has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5 (10 pts), boolean chains 4, 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.
dashboard.ProviderAccountMeterLine (cognitive 27) packages/ui/src/pages/home/components/dashboard.tsx:3440— dashboard.ProviderAccountMeterLine has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (21 pts), boolean chains 6 (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.
connectGatewayChatStreamResponse (cognitive 27) REDACTED:10587— connectGatewayChatStreamResponse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 4 (5 pts), loops 2, error handling 1 (nesting depth added 2). None of this is in the body itself: all 27 points belong to 2 function literals inside it that branch (lines 10588, 10605). 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.
config.parseProviderModelMetadata (cognitive 26) REDACTED:1532— config.parseProviderModelMetadata has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 24, boolean chains 1, if/else 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.
service.resolveProviderMediaTarget (cognitive 26) packages/core/src/media/service.ts:717— service.resolveProviderMediaTarget has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 7, if/else 6 (7 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.
request-log-store.userTextCandidates (cognitive 26) packages/core/src/observability/request-log-store.ts:2469— request-log-store.userTextCandidates has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
request-log-store.extractUsageSnapshot (cognitive 26) packages/core/src/observability/request-log-store.ts:6348— request-log-store.extractUsageSnapshot has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 14 (21 pts), if/else 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route-script-result.normalizeRouteScriptResult (cognitive 26) packages/core/src/routing/route-script-result.ts:27— route-script-result.normalizeRouteScriptResult has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10, boolean chains 8, ternaries 7 (8 pts) (nesting depth added 1). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
index.extractGatewayToolCalls (cognitive 26) REDACTED:12589— index.extractGatewayToolCalls has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 2 (6 pts), loops 1 (2 pts) (nesting depth added 13). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-design-window.routeClaudeDesignFetchRequest (cognitive 26) REDACTED:288— claude-design-window.routeClaudeDesignFetchRequest has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 5, boolean chains 4, error handling 2 (3 pts) (nesting depth added 7). Of this number, 23 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
electron-web-search-mcp.searchUrlForEngine (cognitive 26) packages/electron/src/main/electron-web-search-mcp.ts:671— electron-web-search-mcp.searchUrlForEngine has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 2 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
providers.providerJsonConnectorDraftPartsFromDraft (cognitive 26) packages/ui/src/pages/home/shared/providers.ts:1300— providers.providerJsonConnectorDraftPartsFromDraft has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 7, ternaries 4 (6 pts), error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
network-logs.NetworkingView (cognitive 26) packages/ui/src/pages/home/components/network-logs.tsx:51— network-logs.NetworkingView has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 14 (20 pts), boolean chains 3, if/else 3 (nesting depth added 6). Of this number, 20 points are the body's own statements and 6 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.
dashboard.UsageAnalysisCard (cognitive 26) packages/ui/src/pages/home/components/dashboard.tsx:6274— dashboard.UsageAnalysisCard has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (22 pts), boolean chains 4 (nesting depth added 10). Of this number, 14 points are the body's own statements and 12 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.
commentFromRequest (cognitive 26) REDACTED:9472— commentFromRequest has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13, boolean chains 11, other 2. Of this number, 25 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
media-preview-bridge.loadCodexMediaArtifact (cognitive 25) packages/core/src/agents/codex/media-preview-bridge.ts:293— media-preview-bridge.loadCodexMediaArtifact has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7, error handling 1, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
request-log-worker.isCompleteJsonContainer (cognitive 25) packages/core/src/observability/request-log-worker.ts:251— request-log-worker.isCompleteJsonContainer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6, 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.
account-service.kimiCodeUsageResetAt (cognitive 25) packages/core/src/providers/account-service.ts:1291— account-service.kimiCodeUsageResetAt has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 3 (6 pts), boolean chains 3, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-catalog.catalogProviderTokenScore (cognitive 25) packages/core/src/providers/model-catalog.ts:583— model-catalog.catalogProviderTokenScore has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 3 (8 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
providers.parseProviderAccountDraft (cognitive 25) packages/ui/src/pages/home/shared/providers.ts:1090— providers.parseProviderAccountDraft has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (9 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
profiles.ProfileRoutingSettings (cognitive 25) packages/ui/src/pages/home/components/profiles.tsx:1098— profiles.ProfileRoutingSettings has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 13 (21 pts), boolean chains 2, if/else 2 (nesting depth added 8). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (submitRuleDialog, a function literal at line 1188, openEditRuleDialog, …). 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.
update.updatePrimaryAction (cognitive 25) packages/ui/src/pages/home/components/update.tsx:161— update.updatePrimaryAction has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 9, if/else 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.OverviewActivityGrid (cognitive 25) packages/ui/src/pages/home/components/dashboard.tsx:1565— dashboard.OverviewActivityGrid has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 14 (24 pts), boolean chains 1 (nesting depth added 10). Of this number, 18 points are the body's own statements and 7 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.
dashboard.providerAccountBentoLayout (cognitive 25) packages/ui/src/pages/home/components/dashboard.tsx:4314— dashboard.providerAccountBentoLayout has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kimi.splitTomlArray (cognitive 24) packages/core/src/agents/local-providers/kimi.ts:577— kimi.splitTomlArray has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 8, 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.
service.applyCodexProfile (cognitive 24) REDACTED:570— service.applyCodexProfile has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 8, error handling 1, if/else 1 (nesting depth added 1). Of this number, 22 points are the body's own statements and 2 belong 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.
index.handleClaudeShipBakuSessionApi (cognitive 24) REDACTED:5314— index.handleClaudeShipBakuSessionApi has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 10. 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.
index.mergeOpenAiSsePayload (cognitive 24) REDACTED:10956— index.mergeOpenAiSsePayload has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (6 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowsManager.openPluginAppWindow (cognitive 24) REDACTED:120— WindowsManager.openPluginAppWindow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 229, 177, 219, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
providers.ProviderSetupProgress (cognitive 24) packages/ui/src/pages/home/components/providers.tsx:1603— providers.ProviderSetupProgress has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 13 (20 pts), boolean chains 3, if/else 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1666). 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.
profiles.ProfileOpenDialog (cognitive 24) packages/ui/src/pages/home/components/profiles.tsx:394— profiles.ProfileOpenDialog has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 3, if/else 3 (nesting depth added 8). Of this number, 20 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.overviewMetricDatum (cognitive 24) packages/ui/src/pages/home/components/dashboard.tsx:2385— dashboard.overviewMetricDatum has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 9 (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.
executor.resolveProviderCredentialRoutingTarget (cognitive 23) packages/core/src/gateway/upstream/executor.ts:904— executor.resolveProviderCredentialRoutingTarget has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 7 (8 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.
GatewayMediaExecutor.download (cognitive 23) packages/core/src/media/executors.ts:99— GatewayMediaExecutor.download has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 2 (3 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RawTraceSynchronizer.processStoredBundle (cognitive 23) packages/core/src/observability/raw-trace-sync.ts:355— RawTraceSynchronizer.processStoredBundle has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 5 (7 pts), boolean chains 3, 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.
launch-service.probeExistingProfileGateway (cognitive 23) packages/core/src/profiles/launch-service.ts:456— launch-service.probeExistingProfileGateway has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
store.extractUsageSnapshot (cognitive 23) packages/core/src/usage/store.ts:1140— store.extractUsageSnapshot has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (18 pts), if/else 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
profiles.AgentSelectControl (cognitive 23) packages/ui/src/pages/home/components/profiles.tsx:547— profiles.AgentSelectControl has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 7, if/else 6 (nesting depth added 3). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 574, 610, 641, …). 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-catalog.documentedReasoningProfile (cognitive 22) packages/core/src/agents/codex/model-catalog.ts:466— model-catalog.documentedReasoningProfile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
config.parseProxy (cognitive 22) REDACTED:2518— config.parseProxy has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, ternaries 5 (9 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
config-compiler.normalizeCoreGatewayVirtualModelProfile (cognitive 22) packages/core/src/gateway/core-runtime/config-compiler.ts:424— config-compiler.normalizeCoreGatewayVirtualModelProfile has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 7, if/else 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
response-transform.transformAnthropicWebSearchProtocolSseText (cognitive 22) packages/core/src/gateway/features/hosted-web-search/response-transform.ts:541— response-transform.transformAnthropicWebSearchProtocolSseText has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (10 pts), boolean chains 7, if/else 3 (4 pts), loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 5 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.
stream-experience.geminiFragments (cognitive 22) packages/core/src/observability/stream-experience.ts:522— stream-experience.geminiFragments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (10 pts), ternaries 4 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
account-service.localAgentProviderAccountCredential (cognitive 22) packages/core/src/providers/account-service.ts:1470— account-service.localAgentProviderAccountCredential has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.mergeGatewaySsePayload (cognitive 22) REDACTED:10912— index.mergeGatewaySsePayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
index.claudeDesignProviderSelectorNames (cognitive 22) REDACTED:11842— index.claudeDesignProviderSelectorNames has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 10). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
profiles.BotGatewaySelectForm (cognitive 22) packages/ui/src/pages/home/components/profiles.tsx:1944— profiles.BotGatewaySelectForm has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 6, boolean chains 3, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1971, a function literal at line 2001, updateEnabled, …). 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.
onboarding.OnboardingView::goToNextStep (cognitive 22) packages/ui/src/pages/home/components/onboarding.tsx:173— onboarding.OnboardingView::goToNextStep has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (onboarding.OnboardingView) 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.
network-logs.LogJsonPanel (cognitive 22) packages/ui/src/pages/home/components/network-logs.tsx:1782— network-logs.LogJsonPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 17 (30 pts), if/else 17 (22 pts), boolean chains 12, error handling 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (network-logs.LogJsonPanel::loadInlineFullBody) 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.
dashboard.AgentTrajectoryNodePreview (cognitive 22) packages/ui/src/pages/home/components/dashboard.tsx:5642— dashboard.AgentTrajectoryNodePreview has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 13 (15 pts), boolean chains 4, if/else 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
layout.MainLayout (cognitive 22) packages/ui/src/pages/home/components/layout.tsx:90— layout.MainLayout has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 15 (19 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
cli.parseArgs (cognitive 21) packages/cli/src/cli.ts:245— cli.parseArgs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-code.scanClaudeCodeKeychain (cognitive 21) packages/core/src/agents/local-providers/claude-code.ts:273— claude-code.scanClaudeCodeKeychain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.defaultCodexConfigFile (cognitive 21) REDACTED:3880— config.defaultCodexConfigFile has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (21 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
deep-link.normalizeDeepLinkModelMetadata (cognitive 21) packages/core/src/contracts/deep-link.ts:640— deep-link.normalizeDeepLinkModelMetadata has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 19, boolean chains 1, if/else 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.
GatewayService.ensureStarted (cognitive 21) REDACTED:307— GatewayService.ensureStarted has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
protocol.removeCompactSignals (cognitive 21) packages/core/src/gateway/context-archive/protocol.ts:478— protocol.removeCompactSignals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 20 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.
protocol.appendFooterToJson (cognitive 21) packages/core/src/gateway/context-archive/protocol.ts:544— protocol.appendFooterToJson has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (7 pts), boolean chains 4 (nesting depth added 5). Of this number, 20 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.
model-catalog.reasoningConfigFromMetadata (cognitive 21) packages/core/src/gateway/model-catalog.ts:404— model-catalog.reasoningConfigFromMetadata has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
system-proxy-fetch.shouldBypassProxy (cognitive 21) REDACTED:244— system-proxy-fetch.shouldBypassProxy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.splitShellLike (cognitive 21) REDACTED:7216— index.splitShellLike has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.handleClaudeShipSecrets (cognitive 21) REDACTED:7486— index.handleClaudeShipSecrets has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (7 pts), if/else 4 (5 pts) (nesting depth added 4). Of this number, 17 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.normalizeProjectStoreData (cognitive 21) REDACTED:7966— index.normalizeProjectStoreData has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 6, if/else 3 (4 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
index.gatewaySseEventTextDelta (cognitive 21) REDACTED:10833— index.gatewaySseEventTextDelta has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6 (7 pts), boolean chains 5 (nesting depth added 5). Of this number, 14 points are the body's own statements and 7 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.
index.claudeDesignVirtualModelSelectors (cognitive 21) REDACTED:12243— index.claudeDesignVirtualModelSelectors has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 3 (7 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.
index.isVisibleStoredMessage (cognitive 21) REDACTED:13166— index.isVisibleStoredMessage has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 7, boolean chains 4 (nesting depth added 6). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChromeLoginImportService.importLoginState (cognitive 21) packages/electron/src/main/chrome-login-import.ts:178— ChromeLoginImportService.importLoginState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routing.normalizeRouterRules (cognitive 21) packages/ui/src/pages/home/shared/routing.ts:103— routing.normalizeRouterRules has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 4, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 109). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
profiles.defaultCodexConfigFile (cognitive 21) packages/ui/src/pages/home/shared/profiles.ts:1808— profiles.defaultCodexConfigFile has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (21 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
providers.ProviderMobileCard (cognitive 21) packages/ui/src/pages/home/components/providers.tsx:326— providers.ProviderMobileCard has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 6 (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.
update.UpdateDialog (cognitive 21) packages/ui/src/pages/home/components/update.tsx:12— update.UpdateDialog has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 9 (10 pts) (nesting depth added 1). Of this number, 20 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.
dashboard.TokenMixOverviewWidget (cognitive 21) packages/ui/src/pages/home/components/dashboard.tsx:1723— dashboard.TokenMixOverviewWidget has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 3 (nesting depth added 7). Of this number, 13 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-catalog.virtualModelMatchesCatalogModel (cognitive 20) packages/core/src/agents/codex/model-catalog.ts:695— model-catalog.virtualModelMatchesCatalogModel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.parseRouterRules (cognitive 20) REDACTED:1975— config.parseRouterRules has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 12 (13 pts), if/else 4, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 1981). 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.
config.parseProfileAgent (cognitive 20) REDACTED:3801— config.parseProfileAgent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 9. 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.
server.parseCoreServerArgs (cognitive 20) packages/core/src/entrypoints/server.ts:45— server.parseCoreServerArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
raw-trace-sync.pruneRawTraceDeadLetters (cognitive 20) packages/core/src/observability/raw-trace-sync.ts:1306— raw-trace-sync.pruneRawTraceDeadLetters has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 4 (8 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
request-log-store.detectSseEventError (cognitive 20) packages/core/src/observability/request-log-store.ts:6247— request-log-store.detectSseEventError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, ternaries 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.
launch-service.ensureGatewayConfigRunning (cognitive 20) packages/core/src/profiles/launch-service.ts:397— launch-service.ensureGatewayConfigRunning has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-auto-refresh.mergeProviderModelAutoRefreshResult (cognitive 20) packages/core/src/providers/model-auto-refresh.ts:235— model-auto-refresh.mergeProviderModelAutoRefreshResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (4 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.
rewrite.setPathValue (cognitive 20) packages/core/src/routing/rewrite.ts:242— rewrite.setPathValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 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.
index.handleOmeletteConnectRpc (cognitive 20) REDACTED:2235— index.handleOmeletteConnectRpc has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ipc.decodePngPixels (cognitive 20) packages/electron/src/main/ipc.ts:743— ipc.decodePngPixels has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5 (6 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
logs.collectOpenAiStreamToolCalls (cognitive 20) packages/ui/src/pages/home/shared/logs.ts:457— logs.collectOpenAiStreamToolCalls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 4. Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 462). 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.
logs.aggregateGeminiStreamPayloads (cognitive 20) packages/ui/src/pages/home/shared/logs.ts:1169— logs.aggregateGeminiStreamPayloads has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
feedback.PersistenceFeedback (cognitive 20) packages/ui/src/pages/home/components/feedback.tsx:7— feedback.PersistenceFeedback has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 4, if/else 2 (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dialog-stack.AppDialogStack (cognitive 20) packages/ui/src/pages/home/components/dialog-stack.tsx:12— dialog-stack.AppDialogStack has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 20. 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.
discoverRemoteDesignIndexAssets (cognitive 20) REDACTED:3173— discoverRemoteDesignIndexAssets has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 2 (7 pts), if/else 2 (6 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodexAppMediaPreviewBridge.run (cognitive 19) packages/core/src/agents/codex/media-preview-bridge.ts:97— CodexAppMediaPreviewBridge.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.parseOpenRouterDiscountRouting (cognitive 19) REDACTED:1572— config.parseOpenRouterDiscountRouting has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 16, if/else 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
claude-code-router-plugin.resolveConfiguredRouteDecision (cognitive 19) packages/core/src/gateway/claude-code-router-plugin.ts:304— claude-code-router-plugin.resolveConfiguredRouteDecision has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 4, if/else 3 (4 pts) (nesting depth added 3). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 349, 391, 315, …). 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.
claude-code-router-plugin.resolveRouterConditionValue (cognitive 19) packages/core/src/gateway/claude-code-router-plugin.ts:1440— claude-code-router-plugin.resolveRouterConditionValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ContextArchiveService.ask (cognitive 19) packages/core/src/gateway/context-archive.ts:207— ContextArchiveService.ask has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
router-plugin.createGatewayPlugin (cognitive 19) REDACTED:193— router-plugin.createGatewayPlugin has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 385, 346, 359, …). 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-catalog.buildModelCatalogIndex (cognitive 19) packages/core/src/gateway/model-catalog.ts:244— model-catalog.buildModelCatalogIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-discovery.listLegacySseMcpServerTools (cognitive 19) packages/core/src/mcp/tool-discovery.ts:187— tool-discovery.listLegacySseMcpServerTools has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 2, ternaries 2, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (routeSseEvent, a function literal at line 214, rejectPending). 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.
RawTraceSynchronizer.reconcileSourceBundles (cognitive 19) packages/core/src/observability/raw-trace-sync.ts:604— RawTraceSynchronizer.reconcileSourceBundles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (4 pts), loops 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.
request-log-runtime.prepareRecordForQueue (cognitive 19) packages/core/src/observability/request-log-runtime.ts:945— request-log-runtime.prepareRecordForQueue has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, ternaries 6 (7 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.
GatewayPluginService.applyPluginRegistration (cognitive 19) packages/core/src/plugins/service.ts:554— GatewayPluginService.applyPluginRegistration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
launch-service.openOpenCodeAppProfile (cognitive 19) packages/core/src/profiles/launch-service.ts:168— launch-service.openOpenCodeAppProfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
launch-service.profileBotRuntimeStatus (cognitive 19) packages/core/src/profiles/launch-service.ts:785— launch-service.profileBotRuntimeStatus has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 3, error handling 1, if/else 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.
model-auto-refresh.refreshAutoFetchProviderModels (cognitive 19) packages/core/src/providers/model-auto-refresh.ts:106— model-auto-refresh.refreshAutoFetchProviderModels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RouteScriptRuntime.execute (cognitive 19) packages/core/src/routing/route-script-runtime.ts:115— RouteScriptRuntime.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (5 pts), error handling 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.mergeDesignIndexAssets (cognitive 19) REDACTED:3073— index.mergeDesignIndexAssets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.gatewayHttpErrorMessage (cognitive 19) REDACTED:10889— index.gatewayHttpErrorMessage has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 8 (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.
index.isOnlineClaudeDesignProxyRoutePath (cognitive 19) REDACTED:14269— index.isOnlineClaudeDesignProxyRoutePath has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 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.
browser-automation-mcp.detectPageHandoff (cognitive 19) REDACTED:2516— browser-automation-mcp.detectPageHandoff has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 5, ternaries 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.
profiles.normalizeProfileRoutingConfig (cognitive 19) packages/ui/src/pages/home/shared/profiles.ts:412— profiles.normalizeProfileRoutingConfig has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 3 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cli.acquireServiceStartLock (cognitive 18) packages/cli/src/cli.ts:824— cli.acquireServiceStartLock has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (8 pts), if/else 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 10). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kimi.parseTomlPath (cognitive 18) packages/core/src/agents/local-providers/kimi.ts:521— kimi.parseTomlPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
upstream-header-sanitizer.createGatewayPlugin (cognitive 18) packages/core/src/gateway/core-runtime/upstream-header-sanitizer.ts:288— upstream-header-sanitizer.createGatewayPlugin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CcrRemoteControlService.appendEvent (cognitive 18) packages/core/src/gateway/remote-control-service.ts:371— CcrRemoteControlService.appendEvent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, ternaries 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pricing-service.providerModelPrefixes (cognitive 18) packages/core/src/models/pricing-service.ts:477— pricing-service.providerModelPrefixes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 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.
RequestLogStore.record (cognitive 18) packages/core/src/observability/request-log-store.ts:578— RequestLogStore.record has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11, if/else 5, boolean chains 2. Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (insert). 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.
request-log-store.readAgentSessionHeader (cognitive 18) packages/core/src/observability/request-log-store.ts:2156— request-log-store.readAgentSessionHeader has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
request-log-store.findSessionIdInPayload (cognitive 18) packages/core/src/observability/request-log-store.ts:2288— request-log-store.findSessionIdInPayload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route-trace.sanitizeReportedChange (cognitive 18) packages/core/src/observability/route-trace.ts:204— route-trace.sanitizeReportedChange has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
launch-service.openCodexAppProfile (cognitive 18) packages/core/src/profiles/launch-service.ts:264— launch-service.openCodexAppProfile has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5 (6 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
account-service.kimiCodeUsageMeter (cognitive 18) packages/core/src/providers/account-service.ts:1186— account-service.kimiCodeUsageMeter has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), boolean chains 5, if/else 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
account-service.readMappedDateString (cognitive 18) packages/core/src/providers/account-service.ts:2346— account-service.readMappedDateString has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 4 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
probe.providerProbeCodexOauthRequest (cognitive 18) packages/core/src/providers/probe.ts:1223— probe.providerProbeCodexOauthRequest has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (6 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProxyService.getCertificateStatus (cognitive 18) REDACTED:493— ProxyService.getCertificateStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (4 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.
index.discoverLocalDesignIndexAssets (cognitive 18) REDACTED:3416— index.discoverLocalDesignIndexAssets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 7). Of this number, 16 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.
index.storedProjectMessageText (cognitive 18) REDACTED:11252— index.storedProjectMessageText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
virtual-models.virtualModelToolSummary (cognitive 18) packages/ui/src/pages/home/shared/virtual-models.ts:759— virtual-models.virtualModelToolSummary has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5, boolean chains 4 (nesting depth added 4). 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 767). 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.
logs.aggregateOpenAiStreamPayloads (cognitive 18) packages/ui/src/pages/home/shared/logs.ts:288— logs.aggregateOpenAiStreamPayloads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claudeShipSessionPayload (cognitive 18) REDACTED:6264— claudeShipSessionPayload has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 6, other 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
omeletteProjectFromRow (cognitive 18) REDACTED:13502— omeletteProjectFromRow has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 15, ternaries 2, other 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.
kimi.readKimiConfiguredProviders (cognitive 17) packages/core/src/agents/local-providers/kimi.ts:251— kimi.readKimiConfiguredProviders has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (5 pts), if/else 2, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 267, 263, 264). 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.
config.parseProviderCapabilityProtocol (cognitive 17) REDACTED:1811— config.parseProviderCapabilityProtocol has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
protocol.extractOpenAiResponsesUsage (cognitive 17) packages/core/src/gateway/context-archive/protocol.ts:692— protocol.extractOpenAiResponsesUsage has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (6 pts), loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-discovery.virtualModelProfileMatchesSelector (cognitive 17) packages/core/src/gateway/features/model-discovery.ts:910— model-discovery.virtualModelProfileMatchesSelector has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 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.
toolhub-mcp.drainInputBuffer (cognitive 17) packages/core/src/mcp/toolhub-mcp.ts:225— toolhub-mcp.drainInputBuffer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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.
request-log-store.requestConversationItems (cognitive 17) packages/core/src/observability/request-log-store.ts:2536— request-log-store.requestConversationItems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 pts) (nesting depth added 5). Of this number, 11 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
request-log-store.collectAnthropicStreamToolInput (cognitive 17) packages/core/src/observability/request-log-store.ts:3048— request-log-store.collectAnthropicStreamToolInput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openrouter-discount-provider-router.endpointSatisfiesProviderConstraints (cognitive 17) packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts:815— openrouter-discount-provider-router.endpointSatisfiesProviderConstraints has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
manifest-service.fetchManifestText (cognitive 17) packages/core/src/providers/manifest-service.ts:40— manifest-service.fetchManifestText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 74, 46, 44, …). 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-catalog.providerModelMetadataFromCatalog (cognitive 17) packages/core/src/providers/model-catalog.ts:278— model-catalog.providerModelMetadataFromCatalog has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 13 (15 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
model-catalog.catalogReasoningLevels (cognitive 17) packages/core/src/providers/model-catalog.ts:316— model-catalog.catalogReasoningLevels has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
probe.resolveGatewayProviderProbe (cognitive 17) packages/core/src/providers/probe.ts:340— probe.resolveGatewayProviderProbe has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11, boolean chains 5, if/else 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.
service.forwardHttpsRequestViaHttpProxy (cognitive 17) REDACTED:1067— service.forwardHttpsRequestViaHttpProxy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 5 function literals inside it that branch (lines 1107, 1150, 1165, …). 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.
management-server.parsePluginPermissions (cognitive 17) REDACTED:939— management-server.parsePluginPermissions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.resolveDesignIndexAssets (cognitive 17) REDACTED:2995— index.resolveDesignIndexAssets has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 14, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
index.normalizeProjectViewOpenFiles (cognitive 17) REDACTED:8013— index.normalizeProjectViewOpenFiles has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.generatedFilePathFromFenceInfo (cognitive 17) REDACTED:11441— index.generatedFilePathFromFenceInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, ternaries 3 (6 pts), boolean chains 5 (nesting depth added 3). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.sanitizeGatewayMessageContentBlocksForRequest (cognitive 17) REDACTED:11560— index.sanitizeGatewayMessageContentBlocksForRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.claudeDesignProviderModelProviderSelectors (cognitive 17) REDACTED:12199— index.claudeDesignProviderModelProviderSelectors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 2 (3 pts), loops 2 (nesting depth added 5). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.sanitizeStoredMessageDisplayContent (cognitive 17) REDACTED:13098— index.sanitizeStoredMessageDisplayContent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ipc.parsePluginPermissions (cognitive 17) packages/electron/src/main/ipc.ts:1150— ipc.parsePluginPermissions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tooltip.Tooltip (cognitive 17) packages/ui/src/components/ui/tooltip.tsx:61— tooltip.Tooltip has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 2. Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 81, 119, 125, …). 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.
extensions.parsePluginAppsSettingsText (cognitive 17) packages/ui/src/pages/home/shared/extensions.ts:50— extensions.parsePluginAppsSettingsText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (6 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
virtual-models.virtualModelProfileFromDraft (cognitive 17) packages/ui/src/pages/home/shared/virtual-models.ts:525— virtual-models.virtualModelProfileFromDraft has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 6, if/else 4. Of this number, 9 points are the body's own statements and 8 belong 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.
logs.collectOpenAiResponseOutputItem (cognitive 17) packages/ui/src/pages/home/shared/logs.ts:771— logs.collectOpenAiResponseOutputItem has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
profiles.parseClaudeConfigInputValue (cognitive 17) packages/ui/src/pages/home/components/profiles.tsx:1694— profiles.parseClaudeConfigInputValue has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), error handling 2 (4 pts), if/else 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
profiles.profileDraftValidation (cognitive 17) packages/ui/src/pages/home/components/profiles.tsx:1832— profiles.profileDraftValidation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6 (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.
network-logs.LogJsonPanel::loadInlineFullBody (cognitive 17) packages/ui/src/pages/home/components/network-logs.tsx:1929— network-logs.LogJsonPanel::loadInlineFullBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (network-logs.LogJsonPanel) 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.
dashboard.providerAccountCardResizeHandleIcon (cognitive 17) packages/ui/src/pages/home/components/dashboard.tsx:3287— dashboard.providerAccountCardResizeHandleIcon has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (6 pts), if/else 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handleClaudeShipCliOutputLine (cognitive 17) REDACTED:6893— handleClaudeShipCliOutputLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileViewDemo.ProfileViewDemo (cognitive 16) docs/src/components/interactive/ProfileViewDemo.tsx:38— ProfileViewDemo.ProfileViewDemo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (play, a function literal at line 99, play::waitFor, …). 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.
handoff-scan-service.collectBluetoothScanTargetsFromText (cognitive 16) packages/core/src/agents/bot-gateway/handoff-scan-service.ts:216— handoff-scan-service.collectBluetoothScanTargetsFromText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-catalog.codexModelCapabilityProfile (cognitive 16) packages/core/src/agents/codex/model-catalog.ts:231— model-catalog.codexModelCapabilityProfile has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (10 pts), boolean chains 6 (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.
codex.codexModelCatalogFromPayload (cognitive 16) packages/core/src/agents/local-providers/codex.ts:695— codex.codexModelCatalogFromPayload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kimi.refreshKimiAuth (cognitive 16) packages/core/src/agents/local-providers/kimi.ts:397— kimi.refreshKimiAuth has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
kimi.parseTomlValue (cognitive 16) packages/core/src/agents/local-providers/kimi.ts:553— kimi.parseTomlValue has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, ternaries 3 (5 pts) (nesting depth added 2). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
opencode.readOpenCodeCredential (cognitive 16) packages/core/src/agents/local-providers/opencode.ts:341— opencode.readOpenCodeCredential has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 2, loops 2, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.parseGatewayPlugins (cognitive 16) REDACTED:2653— config.parseGatewayPlugins has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 12, boolean chains 2, if/else 2. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2659). 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.
deep-link.normalizeDeepLinkOpenRouterDiscountRouting (cognitive 16) packages/core/src/contracts/deep-link.ts:681— deep-link.normalizeDeepLinkOpenRouterDiscountRouting has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3, boolean chains 2, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence.synthesizeComponentChangelogWebSearchAnswer (cognitive 16) packages/core/src/gateway/features/hosted-web-search/evidence.ts:284— evidence.synthesizeComponentChangelogWebSearchAnswer has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4, boolean chains 3 (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.
model-discovery.createClaudeCliAutoCompactWindows (cognitive 16) packages/core/src/gateway/features/model-discovery.ts:248— model-discovery.createClaudeCliAutoCompactWindows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), 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.
fusion-config.fusionToolNamesBackedByMcpServers (cognitive 16) packages/core/src/mcp/fusion-config.ts:341— fusion-config.fusionToolNamesBackedByMcpServers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 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.
fusion-vision-mcp.imageInputToUrl (cognitive 16) packages/core/src/mcp/fusion-vision-mcp.ts:895— fusion-vision-mcp.imageInputToUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 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.
GatewayMediaExecutor.resumeVideo (cognitive 16) packages/core/src/media/executors.ts:75— GatewayMediaExecutor.resumeVideo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RawTraceSynchronizer.expireIncompleteSources (cognitive 16) packages/core/src/observability/raw-trace-sync.ts:695— RawTraceSynchronizer.expireIncompleteSources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (5 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 696). 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.
RequestLogRuntime.enqueueRawTrace (cognitive 16) packages/core/src/observability/request-log-runtime.ts:251— RequestLogRuntime.enqueueRawTrace has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
request-log-store.collectToolCalls (cognitive 16) packages/core/src/observability/request-log-store.ts:2951— request-log-store.collectToolCalls has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), loops 2 (3 pts), ternaries 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
account-service.localCodexAccountCredential (cognitive 16) packages/core/src/providers/account-service.ts:1590— account-service.localCodexAccountCredential has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (5 pts), ternaries 3 (nesting depth added 2). Of this number, 13 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.
manifest-service.isPublicIpv4 (cognitive 16) packages/core/src/providers/manifest-service.ts:269— manifest-service.isPublicIpv4 has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 15, if/else 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.
model-catalog.catalogProviderModelRank (cognitive 16) packages/core/src/providers/model-catalog.ts:455— model-catalog.catalogProviderModelRank has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
system-proxy.readMacUpstreamProxy (cognitive 16) REDACTED:571— system-proxy.readMacUpstreamProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelRegistry.resolve (cognitive 16) packages/core/src/routing/model-registry.ts:25— ModelRegistry.resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (5 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.
index.copyDesignMcpFiles (cognitive 16) REDACTED:1877— index.copyDesignMcpFiles has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 2 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.claudeShipSyncedFileBody (cognitive 16) REDACTED:7316— index.claudeShipSyncedFileBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.lastGatewayUserMessage (cognitive 16) REDACTED:13313— index.lastGatewayUserMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-automation-mcp.snapshotScript.roleOf (cognitive 16) REDACTED:2817— browser-automation-mcp.snapshotScript.roleOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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.
virtual-models.normalizeVirtualModelDraftPatch (cognitive 16) packages/ui/src/pages/home/shared/virtual-models.ts:198— virtual-models.normalizeVirtualModelDraftPatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
virtual-models.selectedFusionToolNamesFromProfile (cognitive 16) packages/ui/src/pages/home/shared/virtual-models.ts:859— virtual-models.selectedFusionToolNamesFromProfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 867). 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.
providers.createProviderInstallLinkFromDraft (cognitive 16) packages/ui/src/pages/home/shared/providers.ts:1543— providers.createProviderInstallLinkFromDraft has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 6, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
providers.recommendedModelRank (cognitive 16) packages/ui/src/pages/home/shared/providers.ts:2360— providers.recommendedModelRank has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
provider-references.renameProviderReferences::rules (cognitive 16) packages/ui/src/pages/home/shared/provider-references.ts:27— provider-references.renameProviderReferences::rules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (provider-references.renameProviderReferences) 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.
virtual-models.MediaModelConfigurationPanel (cognitive 16) packages/ui/src/pages/home/components/virtual-models.tsx:182— virtual-models.MediaModelConfigurationPanel has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
network-logs.LogRouteTraceDialog (cognitive 16) packages/ui/src/pages/home/components/network-logs.tsx:1065— network-logs.LogRouteTraceDialog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 2, if/else 1 (nesting depth added 5). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1115, 1079, 1087). 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.
network-logs.useLogBodyWorkerView (cognitive 16) packages/ui/src/pages/home/components/network-logs.tsx:1554— network-logs.useLogBodyWorkerView has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 4. None of this is in the body itself: all 16 points belong to 7 function literals inside it that branch (lines 1571, 1657, 1649, …). 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.
network-logs.LogBodyChunkContent (cognitive 16) packages/ui/src/pages/home/components/network-logs.tsx:2165— network-logs.LogBodyChunkContent has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts) (nesting depth added 1). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
dashboard.AgentSessionDetailCard (cognitive 16) packages/ui/src/pages/home/components/dashboard.tsx:4626— dashboard.AgentSessionDetailCard has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dashboard.TracePayloadPane (cognitive 16) packages/ui/src/pages/home/components/dashboard.tsx:5762— dashboard.TracePayloadPane has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 6, if/else 3. Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TrayApp.TrayApp (cognitive 16) packages/ui/src/pages/tray/TrayApp.tsx:17— TrayApp.TrayApp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 5, boolean chains 3, error handling 2. Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 32, 67, 117, …). 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.
IC1 · Incompleteness & stubs· Empty method body · ×1
Empty method body — does nothing with its inputs docs/src/components/interactive/ProvidersViewDemo.tsx:39— `notify` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
IC1 · Incompleteness & stubs· Both branches are identical · ×1
Both branches are identical — the condition decides nothing packages/core/src/providers/account-service.ts:2206— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Duplication concentrated across 16 sibling directories (168 clone groups) packages/core/src/gateway/features/hosted-web-search/discovery.ts:568— 168 duplicated blocks under packages/core/src/ have copies in at least two of the sibling directories agents, config, contracts, gateway, mcp, media (+10 more sibling(s) not listed) — 116 of them are reported below, and 52 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 168 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 168 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 168 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 4 sibling directories (150 clone groups) REDACTED:936— 150 duplicated blocks under packages/ have copies in at least two of the sibling directories cli, core, electron, ui — 113 of them are reported below, and 37 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 150 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 150 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 150 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 3 sibling directories (29 clone groups) packages/ui/src/pages/home/shared/common.ts:176— 29 duplicated blocks under packages/ui/src/pages/ have copies in at least two of the sibling directories browser, home, tray — 22 of them are reported below, and 7 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 29 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 29 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 29 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 8 sibling directories (12 clone groups) REDACTED:17— 12 of the duplicated blocks reported below have copies in at least two of the sibling directories claude-app, claude-code, codex, kilo, local-providers, opencode (+2 more sibling(s) not listed) under packages/core/src/agents/. That concentration is one structural fact, not 12 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 12 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 2 sibling directories (10 clone groups) packages/core/src/observability/request-log-store.ts:4243— 10 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, scripts — 4 of them are reported below, and 6 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 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 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 10 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 7 sibling directories (8 clone groups) packages/core/src/gateway/request/pipeline.ts:74— 8 of the duplicated blocks reported below have copies in at least two of the sibling directories auth, context-archive, core-runtime, features, http, request (+1 more sibling(s) not listed) under packages/core/src/gateway/. That concentration is one structural fact, not 8 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 8 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 2 sibling directories (7 clone groups) packages/ui/src/pages/home/components/dashboard.tsx:2228— 7 duplicated blocks under packages/ui/src/pages/home/ have copies in at least two of the sibling directories components, shared — 2 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 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplicated block (229 lines × 2 locations) REDACTED:936— REDACTED:936 · packages/electron/src/main/ipc.ts:1147 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (201 matched lines × 2 locations) · ×1
Duplicated block with local edits (201 matched lines × 2 locations) REDACTED:18— REDACTED:18 · REDACTED:34 — the two spans are one implementation copied and then locally edited — 1322 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 (161 matched lines × 2 locations) · ×1
Duplicated block with local edits (161 matched lines × 2 locations) REDACTED:1878— REDACTED:1878 · packages/ui/src/pages/home/shared/routing.ts:58 — the two spans are one implementation copied and then locally edited — 1165 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 (140 matched lines × 2 locations) · ×1
Duplicated block with local edits (140 matched lines × 2 locations) packages/core/src/gateway/features/codex-multi-agent-bridge.ts:16— packages/core/src/gateway/features/codex-multi-agent-bridge.ts:16 · packages/core/src/gateway/features/codex-patch-bridge.ts:18 — the two spans are one implementation copied and then locally edited — 899 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 (138 matched lines × 2 locations) · ×1
Duplicated block with local edits (138 matched lines × 2 locations) REDACTED:17— REDACTED:17 · REDACTED:29 — the two spans are one implementation copied and then locally edited — 1065 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 (134 matched lines × 2 locations) · ×1
Duplicated block with local edits (134 matched lines × 2 locations) packages/core/src/gateway/features/codex-multi-agent-bridge.ts:242— packages/core/src/gateway/features/codex-multi-agent-bridge.ts:242 · packages/core/src/gateway/features/codex-patch-bridge.ts:289 — the two spans are one implementation copied and then locally edited — 954 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 (123 lines × 2 locations) packages/ui/src/pages/home/shared/common.ts:176— packages/ui/src/pages/home/shared/common.ts:176 · packages/ui/src/pages/tray/shared.tsx:386 — the 2 copies are spread across 2 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 (120 matched lines × 2 locations) · ×1
Duplicated block with local edits (120 matched lines × 2 locations) packages/core/src/agents/claude-app/launch.ts:220— packages/core/src/agents/claude-app/launch.ts:220 · REDACTED:1074 — the two spans are one implementation copied and then locally edited — 752 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 (111 matched lines × 2 locations) · ×1
Duplicated block with local edits (111 matched lines × 2 locations) REDACTED:22— REDACTED:22 · REDACTED:26 — the two spans are one implementation copied and then locally edited — 748 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (96 matched lines × 2 locations) · ×1
Duplicated block with local edits (96 matched lines × 2 locations) packages/ui/src/pages/home/components/profiles.tsx:554— packages/ui/src/pages/home/components/profiles.tsx:554 · packages/ui/src/pages/home/components/virtual-models.tsx:1042 — the two spans are one implementation copied and then locally edited — 638 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 (88 matched lines × 2 locations) · ×1
Duplicated block with local edits (88 matched lines × 2 locations) packages/ui/src/pages/home/shared/provider-accounts.ts:9— packages/ui/src/pages/home/shared/provider-accounts.ts:9 · packages/ui/src/pages/tray/shared.tsx:772 — the two spans are one implementation copied and then locally edited — 677 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 (79 matched lines × 2 locations) · ×1
Duplicated block with local edits (79 matched lines × 2 locations) packages/core/src/gateway/features/hosted-web-search/discovery.ts:568— packages/core/src/gateway/features/hosted-web-search/discovery.ts:568 · packages/core/src/mcp/fusion-vision-mcp.ts:713 — the two spans are one implementation copied and then locally edited — 954 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 (76 lines × 2 locations) packages/core/src/observability/request-log-store.ts:6344— packages/core/src/observability/request-log-store.ts:6344 · packages/core/src/usage/store.ts:1136 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (70 matched lines × 2 locations) · ×1
Duplicated block with local edits (70 matched lines × 2 locations) packages/ui/src/pages/tray/TrayApp.tsx:25— packages/ui/src/pages/tray/TrayApp.tsx:25 · packages/ui/src/pages/tray/TrayDetailApp.tsx:16 — the two spans are one implementation copied and then locally edited — 527 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 (66 lines × 2 locations) packages/core/src/agents/bot-gateway/env.ts:204— packages/core/src/agents/bot-gateway/env.ts:204 · REDACTED:173 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (66 matched lines × 2 locations) · ×1
Duplicated block with local edits (66 matched lines × 2 locations) packages/ui/src/pages/home/components/settings.tsx:865— packages/ui/src/pages/home/components/settings.tsx:865 · packages/ui/src/pages/home/components/virtual-models.tsx:729 — the two spans are one implementation copied and then locally edited — 582 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 (65 matched lines × 2 locations) · ×1
Duplicated block with local edits (65 matched lines × 2 locations) packages/core/src/contracts/i18n.ts:79— packages/core/src/contracts/i18n.ts:79 · packages/core/src/contracts/i18n.ts:223 — the two spans are one implementation copied and then locally edited — 259 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 (61 matched lines × 2 locations) · ×1
Duplicated block with local edits (61 matched lines × 2 locations) REDACTED:1107— REDACTED:1107 · packages/ui/src/pages/home/shared/common.ts:361 — the two spans are one implementation copied and then locally edited — 420 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 (60 lines × 2 locations) REDACTED:3168— REDACTED:3168 · packages/core/src/plugins/marketplace.ts:404 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (58 lines × 2 locations) packages/core/src/plugins/marketplace.ts:528— packages/core/src/plugins/marketplace.ts:528 · packages/ui/src/pages/home/shared/extensions.ts:185 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (57 lines × 2 locations) packages/ui/src/pages/home/components/dashboard.tsx:2228— packages/ui/src/pages/home/components/dashboard.tsx:2228 · packages/ui/src/pages/home/shared/common.ts:449 — the 2 copies are spread across 2 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.
Duplicated block (56 lines × 2 locations) packages/core/src/gateway/features/hosted-web-search/response-transform.ts:74— packages/core/src/gateway/features/hosted-web-search/response-transform.ts:74 · packages/core/src/gateway/features/hosted-web-search/response-transform.ts:278 — 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 (55 lines × 2 locations) packages/core/src/contracts/deep-link.ts:123— packages/core/src/contracts/deep-link.ts:123 · packages/core/src/contracts/deep-link.ts:198 — 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 (54 matched lines × 2 locations) · ×1
Duplicated block with local edits (54 matched lines × 2 locations) packages/ui/src/pages/home/shared/provider-accounts.ts:150— packages/ui/src/pages/home/shared/provider-accounts.ts:150 · packages/ui/src/pages/tray/shared.tsx:868 — the two spans are one implementation copied and then locally edited — 401 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 (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) packages/ui/src/pages/home/shared/logs.ts:1036— packages/ui/src/pages/home/shared/logs.ts:1036 · packages/ui/src/pages/home/shared/logs.ts:1216 — the two spans are one implementation copied and then locally edited — 311 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 (45 lines × 2 locations) REDACTED:1276— REDACTED:1276 · packages/electron/src/main/ipc.ts:1424 — 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 (44 lines × 2 locations) packages/core/src/providers/account-service.ts:2017— packages/core/src/providers/account-service.ts:2017 · packages/electron/src/main/provider-account-webcontent.ts:238 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (43 matched lines × 2 locations) · ×1
Duplicated block with local edits (43 matched lines × 2 locations) packages/core/src/mcp/network-capture-mcp.ts:363— packages/core/src/mcp/network-capture-mcp.ts:363 · packages/electron/src/main/electron-web-search-mcp.ts:1239 — the two spans are one implementation copied and then locally edited — 329 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Complex function proxyRequest (cyclomatic 152, cognitive 172) packages/core/src/gateway/request/pipeline.ts:123— proxyRequest has cyclomatic complexity 152 and cognitive complexity 172; 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 handleOmeletteConnectRpc (cyclomatic 112, cognitive 20) REDACTED:2235— handleOmeletteConnectRpc has cyclomatic complexity 112 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 91, cognitive 71) REDACTED:3622— (anonymous) has cyclomatic complexity 91 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 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 updateFromRawTrace (cyclomatic 90, cognitive 87) packages/core/src/observability/request-log-store.ts:822— updateFromRawTrace has cyclomatic complexity 90 and cognitive complexity 87; 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 normalizeUnknownProfileItem (cyclomatic 84, cognitive 64) packages/ui/src/pages/home/shared/profiles.ts:1540— normalizeUnknownProfileItem has cyclomatic complexity 84 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function runTool (cyclomatic 76, cognitive 52) REDACTED:773— runTool has cyclomatic complexity 76 and cognitive complexity 52; 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 setup (cyclomatic 68, cognitive 57) REDACTED:530— setup has cyclomatic complexity 68 and cognitive complexity 57; 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 handleDesignRestApi (cyclomatic 67, cognitive 81) REDACTED:9815— handleDesignRestApi has cyclomatic complexity 67 and cognitive complexity 81; 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 App (cyclomatic 66, cognitive 59) packages/ui/src/pages/home/App.tsx:182— App has cyclomatic complexity 66 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 routeMockRequest (cyclomatic 64, cognitive 63) REDACTED:895— routeMockRequest has cyclomatic complexity 64 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function pickConfig (cyclomatic 62, cognitive 64) REDACTED:769— pickConfig has cyclomatic complexity 62 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 parseBotGateway (cyclomatic 61, cognitive 54) REDACTED:2221— parseBotGateway has cyclomatic complexity 61 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 parseProfile (cyclomatic 57, cognitive 77) REDACTED:3480— parseProfile has cyclomatic complexity 57 and cognitive complexity 77; 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 AddProfileForm (cyclomatic 55, cognitive 49) packages/ui/src/pages/home/components/profiles.tsx:710— AddProfileForm has cyclomatic complexity 55 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleRequest (cyclomatic 54, cognitive 75) packages/core/src/gateway/http/request-handler.ts:54— handleRequest has cyclomatic complexity 54 and cognitive complexity 75; 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 loadAppConfig (cyclomatic 54, cognitive 56) REDACTED:245— loadAppConfig has cyclomatic complexity 54 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 inferAgentFromText (cyclomatic 54, cognitive 33) packages/core/src/observability/request-log-store.ts:2043— inferAgentFromText has cyclomatic complexity 54 and cognitive complexity 33; 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.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 49, cognitive 53) · ×1
Complex function main (cyclomatic 49, cognitive 53) packages/cli/src/cli.ts:74— main has cyclomatic complexity 49 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 49, cognitive 34) packages/ui/src/pages/home/components/providers.tsx:4889— (anonymous) has cyclomatic complexity 49 and cognitive complexity 34; 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 fetchUpstreamWithFallback (cyclomatic 48, cognitive 91) packages/core/src/gateway/upstream/executor.ts:291— fetchUpstreamWithFallback has cyclomatic complexity 48 and cognitive complexity 91; 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 assistantFullTextCandidates (cyclomatic 48, cognitive 77) packages/core/src/observability/request-log-store.ts:2746— assistantFullTextCandidates has cyclomatic complexity 48 and cognitive complexity 77; 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 waitForReadiness (cyclomatic 48, cognitive 77) REDACTED:1653— waitForReadiness has cyclomatic complexity 48 and cognitive complexity 77; 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 submitProviderDraft (cyclomatic 48, cognitive 48) packages/ui/src/pages/home/App.tsx:1705— submitProviderDraft has cyclomatic complexity 48 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 normalizeProfileItem (cyclomatic 47, cognitive 50) packages/ui/src/pages/home/shared/profiles.ts:1395— normalizeProfileItem has cyclomatic complexity 47 and cognitive complexity 50; 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 waitForNextReadinessEvent (cyclomatic 45, cognitive 64) REDACTED:1772— waitForNextReadinessEvent has cyclomatic complexity 45 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ProviderAccountSummaryCard (cyclomatic 44, cognitive 57) packages/ui/src/pages/home/components/dashboard.tsx:2929— ProviderAccountSummaryCard has cyclomatic complexity 44 and cognitive complexity 57; 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 profileSummaryItems (cyclomatic 44, cognitive 37) packages/ui/src/pages/home/shared/profiles.ts:1285— profileSummaryItems has cyclomatic complexity 44 and cognitive complexity 37; 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 parseOpenRouterDiscountRouting (cyclomatic 42, cognitive 34) REDACTED:1572— parseOpenRouterDiscountRouting has cyclomatic complexity 42 and cognitive complexity 34; 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 extractUsageSnapshot (cyclomatic 41, cognitive 26) packages/core/src/observability/request-log-store.ts:6348— extractUsageSnapshot has cyclomatic complexity 41 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 aggregateOpenAiResponsesStreamPayloads (cyclomatic 40, cognitive 78) packages/ui/src/pages/home/shared/logs.ts:659— aggregateOpenAiResponsesStreamPayloads has cyclomatic complexity 40 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleAdminRequest (cyclomatic 40, cognitive 44) REDACTED:4102— handleAdminRequest has cyclomatic complexity 40 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 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 handleClaudeShipSessionApi (cyclomatic 40, cognitive 44) REDACTED:5197— handleClaudeShipSessionApi has cyclomatic complexity 40 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 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 normalizeBotGatewayRuntimeConfig (cyclomatic 40, cognitive 38) packages/ui/src/pages/home/shared/profiles.ts:1171— normalizeBotGatewayRuntimeConfig has cyclomatic complexity 40 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.
Complex function AddProviderDialog (cyclomatic 40, cognitive 34) packages/ui/src/pages/home/components/providers.tsx:3466— AddProviderDialog has cyclomatic complexity 40 and cognitive complexity 34; 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 commentFromRequest (cyclomatic 40, cognitive 25) REDACTED:9472— commentFromRequest has cyclomatic complexity 40 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function synthesizeWeatherWebSearchAnswer (cyclomatic 39, cognitive 40) packages/core/src/gateway/features/hosted-web-search/evidence.ts:358— synthesizeWeatherWebSearchAnswer has cyclomatic complexity 39 and cognitive complexity 40; 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 parseProfileAgent (cyclomatic 39, cognitive 20) REDACTED:3801— parseProfileAgent has cyclomatic complexity 39 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 applyPluginRegistration (cyclomatic 38, cognitive 36) packages/core/src/plugins/service.ts:554— applyPluginRegistration has cyclomatic complexity 38 and cognitive complexity 36; 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 createVirtualModelDraftFromProfile (cyclomatic 38, cognitive 36) packages/ui/src/pages/home/shared/virtual-models.ts:99— createVirtualModelDraftFromProfile has cyclomatic complexity 38 and cognitive complexity 36; 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 AddProviderForm (cyclomatic 38, cognitive 35) packages/ui/src/pages/home/components/providers.tsx:1961— AddProviderForm has cyclomatic complexity 38 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
REDACTED: 15598 lines of code REDACTED:1— REDACTED has 15598 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: 6922 lines of code REDACTED:1— REDACTED has 6922 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/observability/request-log-store.ts · ×1
packages/core/src/observability/request-log-store.ts: 6113 lines of code packages/core/src/observability/request-log-store.ts:1— packages/core/src/observability/request-log-store.ts has 6113 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/components/dashboard.tsx · ×1
packages/ui/src/pages/home/components/dashboard.tsx: 6045 lines of code packages/ui/src/pages/home/components/dashboard.tsx:1— packages/ui/src/pages/home/components/dashboard.tsx has 6045 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/components/providers.tsx · ×1
packages/ui/src/pages/home/components/providers.tsx: 4874 lines of code packages/ui/src/pages/home/components/providers.tsx:1— packages/ui/src/pages/home/components/providers.tsx has 4874 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: 3964 lines of code REDACTED:1— REDACTED has 3964 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: 3954 lines of code REDACTED:1— REDACTED has 3954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/App.tsx · ×1
packages/ui/src/pages/home/App.tsx: 3382 lines of code packages/ui/src/pages/home/App.tsx:1— packages/ui/src/pages/home/App.tsx has 3382 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: 3340 lines of code REDACTED:1— REDACTED has 3340 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/components/settings.tsx · ×1
packages/ui/src/pages/home/components/settings.tsx: 3284 lines of code packages/ui/src/pages/home/components/settings.tsx:1— packages/ui/src/pages/home/components/settings.tsx has 3284 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/mcp/toolhub-mcp.ts · ×1
packages/core/src/mcp/toolhub-mcp.ts: 2712 lines of code packages/core/src/mcp/toolhub-mcp.ts:1— packages/core/src/mcp/toolhub-mcp.ts has 2712 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/components/network-logs.tsx · ×1
packages/ui/src/pages/home/components/network-logs.tsx: 2666 lines of code packages/ui/src/pages/home/components/network-logs.tsx:1— packages/ui/src/pages/home/components/network-logs.tsx has 2666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/shared/i18n.tsx · ×1
packages/ui/src/pages/home/shared/i18n.tsx: 2556 lines of code packages/ui/src/pages/home/shared/i18n.tsx:1— packages/ui/src/pages/home/shared/i18n.tsx has 2556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/providers/account-service.ts · ×1
packages/core/src/providers/account-service.ts: 2456 lines of code packages/core/src/providers/account-service.ts:1— packages/core/src/providers/account-service.ts has 2456 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/contracts/app.ts · ×1
packages/core/src/contracts/app.ts: 2361 lines of code packages/core/src/contracts/app.ts:1— packages/core/src/contracts/app.ts has 2361 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/shared/providers.ts · ×1
packages/ui/src/pages/home/shared/providers.ts: 2286 lines of code packages/ui/src/pages/home/shared/providers.ts:1— packages/ui/src/pages/home/shared/providers.ts has 2286 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/components/profiles.tsx · ×1
packages/ui/src/pages/home/components/profiles.tsx: 2205 lines of code packages/ui/src/pages/home/components/profiles.tsx:1— packages/ui/src/pages/home/components/profiles.tsx has 2205 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/profiles/launch-service.ts · ×1
packages/core/src/profiles/launch-service.ts: 1982 lines of code packages/core/src/profiles/launch-service.ts:1— packages/core/src/profiles/launch-service.ts has 1982 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/providers/probe.ts · ×1
packages/core/src/providers/probe.ts: 1951 lines of code packages/core/src/providers/probe.ts:1— packages/core/src/providers/probe.ts has 1951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/observability/raw-trace-sync.ts · ×1
packages/core/src/observability/raw-trace-sync.ts: 1742 lines of code packages/core/src/observability/raw-trace-sync.ts:1— packages/core/src/observability/raw-trace-sync.ts 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.
REDACTED: 1730 lines of code REDACTED:1— REDACTED has 1730 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/shared/profiles.ts · ×1
packages/ui/src/pages/home/shared/profiles.ts: 1721 lines of code packages/ui/src/pages/home/shared/profiles.ts:1— packages/ui/src/pages/home/shared/profiles.ts has 1721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/gateway/claude-code-router-plugin.ts · ×1
packages/core/src/gateway/claude-code-router-plugin.ts: 1583 lines of code packages/core/src/gateway/claude-code-router-plugin.ts:1— packages/core/src/gateway/claude-code-router-plugin.ts has 1583 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: 1461 lines of code REDACTED:1— REDACTED has 1461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/electron/src/main/ipc.ts · ×1
packages/electron/src/main/ipc.ts: 1441 lines of code packages/electron/src/main/ipc.ts:1— packages/electron/src/main/ipc.ts has 1441 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/components/virtual-models.tsx · ×1
packages/ui/src/pages/home/components/virtual-models.tsx: 1338 lines of code packages/ui/src/pages/home/components/virtual-models.tsx:1— packages/ui/src/pages/home/components/virtual-models.tsx has 1338 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: 1317 lines of code REDACTED:1— REDACTED has 1317 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/gateway/request/pipeline.ts · ×1
packages/core/src/gateway/request/pipeline.ts: 1293 lines of code packages/core/src/gateway/request/pipeline.ts:1— packages/core/src/gateway/request/pipeline.ts has 1293 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/usage/store.ts · ×1
packages/core/src/usage/store.ts: 1287 lines of code packages/core/src/usage/store.ts:1— packages/core/src/usage/store.ts has 1287 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/shared/logs.ts · ×1
packages/ui/src/pages/home/shared/logs.ts: 1235 lines of code packages/ui/src/pages/home/shared/logs.ts:1— packages/ui/src/pages/home/shared/logs.ts has 1235 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/plugins/service.ts · ×1
packages/core/src/plugins/service.ts: 1231 lines of code packages/core/src/plugins/service.ts:1— packages/core/src/plugins/service.ts has 1231 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/electron/src/main/electron-web-search-mcp.ts · ×1
packages/electron/src/main/electron-web-search-mcp.ts: 1212 lines of code packages/electron/src/main/electron-web-search-mcp.ts:1— packages/electron/src/main/electron-web-search-mcp.ts has 1212 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts · ×1
packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts: 1163 lines of code packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts:1— packages/core/src/plugins/built-ins/openrouter-discount-provider-router.ts has 1163 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/mcp/fusion-vision-mcp.ts · ×1
packages/core/src/mcp/fusion-vision-mcp.ts: 1161 lines of code packages/core/src/mcp/fusion-vision-mcp.ts:1— packages/core/src/mcp/fusion-vision-mcp.ts has 1161 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/pages/home/shared/virtual-models.ts · ×1
packages/ui/src/pages/home/shared/virtual-models.ts: 1150 lines of code packages/ui/src/pages/home/shared/virtual-models.ts:1— packages/ui/src/pages/home/shared/virtual-models.ts has 1150 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/gateway/upstream/executor.ts · ×1
packages/core/src/gateway/upstream/executor.ts: 1147 lines of code packages/core/src/gateway/upstream/executor.ts:1— packages/core/src/gateway/upstream/executor.ts has 1147 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/observability/request-log-runtime.ts · ×1
packages/core/src/observability/request-log-runtime.ts: 1146 lines of code packages/core/src/observability/request-log-runtime.ts:1— packages/core/src/observability/request-log-runtime.ts has 1146 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: 1126 lines of code REDACTED:1— REDACTED has 1126 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/gateway/features/hosted-web-search/response-transform.ts · ×1
packages/core/src/gateway/features/hosted-web-search/response-transform.ts: 1059 lines of code packages/core/src/gateway/features/hosted-web-search/response-transform.ts:1— packages/core/src/gateway/features/hosted-web-search/response-transform.ts has 1059 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/cli/src/cli.ts: 1006 lines of code packages/cli/src/cli.ts:1— packages/cli/src/cli.ts has 1006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
Dead file (~1264 LoC) packages/core/src/mcp/fusion-vision-mcp.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~395 LoC) packages/core/src/routing/route-script-worker.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~238 LoC) packages/core/src/mcp/fusion-tool-fallback-mcp.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~214 LoC) packages/electron/src/main/preload.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~205 LoC) packages/core/src/mcp/media-tools-proxy-mcp.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~188 LoC) packages/ui/src/web-client-bridge.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~146 LoC) packages/core/src/mcp/browser-web-search-proxy-mcp.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~115 LoC) packages/core/src/gateway/core-runtime/gateway-bootstrap.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~99 LoC) packages/ui/src/pages/home/shared/log-body.worker.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~22 LoC) packages/electron/src/main/browser-preload.ts— no import path from any entry point (22 application, 10 tooling, 182 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 (~1 LoC) packages/core/src/proxy/undici-proxy-agent.ts— no import path from any entry point (22 application, 10 tooling, 182 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 'pm2' — 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.
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 packages/core/src/media/executors.ts:305— This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 308) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 305 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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap REDACTED:4192— `interpolateRawAppConfigEnvVars` is exported, takes a document from its caller (line 4179) and hands it to `interpolateEnvVars`, which calls itself at line 4192 (`interpolateEnvVars`) with a piece of `value` (and at line 4198) — and nowhere in `interpolateEnvVars` 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 `interpolateEnvVars` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Duplicated predicate REDACTED:714— `!Number.isInteger(part) || part < 0 || part > 255` appears character-identically in 2 files — REDACTED, packages/core/src/providers/manifest-service.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 packages/cli/src/cli.ts:1031— `!Number.isInteger(port) || port <= 0 || port > 65535` appears character-identically in 2 files — packages/cli/src/cli.ts, packages/core/src/entrypoints/server.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 packages/core/src/agents/claude-app/gateway-routes.ts:241— `!attribution.provider || !attribution.model` appears character-identically in 2 files — packages/core/src/agents/claude-app/gateway-routes.ts, packages/core/src/gateway/features/model-discovery.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 packages/ui/src/pages/home/components/network-logs.tsx:1771— `!body || (!body.text && body.sizeBytes === 0)` appears character-identically in 3 files — packages/ui/src/pages/home/components/network-logs.tsx, packages/ui/src/pages/home/shared/log-body-worker-protocol.ts, packages/ui/src/pages/home/shared/logs.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 REDACTED:45— `!body.job || body.job.status !== "pending"` appears character-identically in 2 files — REDACTED, 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 packages/core/src/agents/claude-app/launch.ts:222— `!candidate || checked.includes(candidate)` appears character-identically in 3 files — packages/core/src/agents/claude-app/launch.ts, REDACTED, packages/core/src/agents/opencode/app-launch.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 packages/core/src/gateway/request/pipeline.ts:298— `!config || !shouldRecordRequestLogs(config)` appears character-identically in 2 files — packages/core/src/gateway/request/pipeline.ts, packages/core/src/observability/raw-trace-sync.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 packages/core/src/agents/local-providers/codex.ts:418— `!connector.endpoint?.trim() && !connector.endpoints?.length && !connector.headers && !connector.id` appears character-identically in 2 files — packages/core/src/agents/local-providers/codex.ts, packages/core/src/agents/local-providers/grok.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 packages/core/src/agents/codex/model-catalog.ts:89— `!isGatewayProviderEnabled(provider) || !providerName || !Array.isArray(provider.models)` appears character-identically in 4 files — packages/core/src/agents/codex/model-catalog.ts, packages/core/src/contracts/app.ts, packages/core/src/gateway/claude-code-router-plugin.ts, packages/core/src/gateway/features/model-discovery.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 packages/core/src/gateway/claude-code-router-plugin.ts:1159— `!isRecord(message) || message.role !== "user"` appears character-identically in 2 files — packages/core/src/gateway/claude-code-router-plugin.ts, packages/core/src/observability/request-log-store.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/core/src/mcp/fusion-vision-mcp.ts:228— `!isRecord(params) || typeof params.name !== "string"` appears character-identically in 5 files — packages/core/src/mcp/fusion-vision-mcp.ts, packages/core/src/mcp/grok-media-mcp.ts, packages/core/src/mcp/network-capture-mcp.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 packages/core/src/models/pricing-service.ts:334— `!isRecord(payload) || !Array.isArray(payload.data)` appears character-identically in 2 files — packages/core/src/models/pricing-service.ts, scripts/generate-models-json.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/core/src/gateway/core-runtime/config-compiler.ts:292— `!isRecord(plugin) || plugin.enabled !== false` appears character-identically in 2 files — packages/core/src/gateway/core-runtime/config-compiler.ts, packages/core/src/providers/model-auto-refresh.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 packages/core/src/gateway/features/hosted-web-search/discovery.ts:417— `!isRecord(profile) || profile.enabled === false` appears character-identically in 2 files — packages/core/src/gateway/features/hosted-web-search/discovery.ts, packages/core/src/mcp/fusion-config.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 packages/core/src/models/pricing-service.ts:305— `!isRecord(provider) || !isRecord(provider.models)` appears character-identically in 2 files — packages/core/src/models/pricing-service.ts, scripts/generate-models-json.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:81— `!isRecord(provider) || !isRecord(provider.options)` appears character-identically in 2 files — REDACTED, 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 REDACTED:1312— `!key || key === "__proto__" || key === "constructor" || key === "prototype"` appears character-identically in 2 files — REDACTED, packages/ui/src/pages/home/shared/profiles.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 packages/core/src/agents/bot-gateway/env.ts:263— `!key.trim() || isWebhookRelatedBotGatewayKey(key)` appears character-identically in 3 files — packages/core/src/agents/bot-gateway/env.ts, packages/core/src/agents/bot-gateway/qr-login-service.ts, packages/ui/src/pages/home/shared/profiles.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 packages/ui/src/pages/home/shared/provider-accounts.ts:49— `!manualResetMeter || meters.includes(manualResetMeter) || meters.length < maxCount` appears character-identically in 2 files — packages/ui/src/pages/home/shared/provider-accounts.ts, packages/ui/src/pages/tray/shared.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 packages/ui/src/pages/home/shared/provider-accounts.ts:56— `!meter.limit || meter.limit <= 0 || meter.remaining === undefined` appears character-identically in 2 files — packages/ui/src/pages/home/shared/provider-accounts.ts, packages/ui/src/pages/tray/shared.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 packages/core/src/gateway/features/codex-multi-agent-bridge.ts:202— `!modelName || modelName.toLowerCase().includes("gpt")` appears character-identically in 2 files — packages/core/src/gateway/features/codex-multi-agent-bridge.ts, packages/core/src/gateway/features/codex-patch-bridge.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 packages/core/src/agents/bot-gateway/env.ts:208— `!normalized || normalized === "default" || normalized === "auto" || normalized === "webhook" || normalized === "webhook_secret" || normalize…` appears character-identically in 2 files — packages/core/src/agents/bot-gateway/env.ts, packages/ui/src/pages/home/shared/profiles.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 packages/core/src/agents/bot-gateway/env.ts:185— `!normalized || normalized === "off" || normalized === "disabled"` appears character-identically in 3 files — packages/core/src/agents/bot-gateway/env.ts, packages/core/src/agents/bot-gateway/qr-login-service.ts, packages/ui/src/pages/home/shared/profiles.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 packages/core/src/agents/codex/model-catalog.ts:727— `!normalizedPrefix || !selectedModelLower.startsWith(normalizedPrefix.toLowerCase())` appears character-identically in 2 files — packages/core/src/agents/codex/model-catalog.ts, packages/core/src/gateway/features/model-discovery.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 packages/core/src/agents/codex/model-catalog.ts:738— `!normalizedSuffix || !selectedModelLower.endsWith(normalizedSuffix.toLowerCase())` appears character-identically in 2 files — packages/core/src/agents/codex/model-catalog.ts, packages/core/src/gateway/features/model-discovery.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.
Silent fallback default in catch REDACTED:235— `normalizeImportUrl` 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 REDACTED:291— `normalizeImportUrl` 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 packages/cli/src/cli.ts:799— `activeProfileGatewayLeaseCount` swallows every exception into `return 0` — 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 packages/cli/src/cli.ts:1009— `serviceAuthToken` 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 packages/core/src/agents/bot-gateway/env.ts:153— `resolveBotGatewaySdkModule` 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 packages/core/src/agents/claude-app/cdp.ts:274— `normalizeClaudeAppDesignUrl` 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 packages/core/src/agents/claude-app/vm-storage.ts:359— `readDirEntries` 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 REDACTED:126— `readJsoncObject` 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 packages/core/src/agents/local-providers/claude-code.ts:353— `discoverClaudeCodeKeychainItems` 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 packages/core/src/agents/local-providers/kimi.ts:259— `readKimiConfiguredProviders` 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 REDACTED:211— `readJsoncObject` 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 REDACTED:264— `readJsonObject` 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 packages/core/src/gateway/auth/api-key-authorizer.ts:195— `parseClaudeCodeWifTokenRequestBody` 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 REDACTED:1217— `readJsonObjectBody` 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 packages/core/src/gateway/features/context-archive-continuation.ts:294— `parseFunctionCallArguments` 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 packages/core/src/mcp/fusion-tool-fallback-mcp.ts:161— `readFallbackTools` 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 packages/core/src/mcp/fusion-vision-mcp.ts:490— `readJsonStringArrayEnv` 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 packages/core/src/mcp/media-tools-proxy-mcp.ts:126— `readTools` 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 packages/core/src/mcp/toolhub-mcp.ts:1847— `readBackendServers` 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 packages/core/src/mcp/toolhub-mcp.ts:2171— `parseToolArguments` 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 packages/core/src/media/models.ts:131— `urlHost` 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 packages/core/src/observability/raw-trace-sync.ts:1566— `rawTraceUsageBodyText` 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 packages/core/src/observability/request-log-runtime.ts:1136— `jsonBytes` swallows every exception into `return 0` — 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 packages/core/src/observability/request-log-store.ts:1781— `rawTraceBodyText` 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 packages/core/src/observability/request-log-store.ts:4383— `stringifyForSearch` 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.
+ 15 more in this group — see findings.md.
P2 · Observability· Console output used as the logging channel · ×39
Console output used as the logging channel REDACTED:163— `REDACTED` reports through `console.*` at line 163 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:496— `REDACTED` reports through `console.*` at line 496 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:500— `REDACTED` reports through `console.*` at line 500 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:510— `REDACTED` reports through `console.*` at line 510 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:515— `REDACTED` reports through `console.*` at line 515 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:522— `REDACTED` reports through `console.*` at line 522 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:527— `REDACTED` reports through `console.*` at line 527 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:552— `REDACTED` reports through `console.*` at line 552 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:856— `REDACTED` reports through `console.*` at line 856 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/usage/store.ts:405— `packages/core/src/usage/store.ts` reports through `console.*` at line 405 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/usage/store.ts:530— `packages/core/src/usage/store.ts` reports through `console.*` at line 530 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/usage/store.ts:539— `packages/core/src/usage/store.ts` reports through `console.*` at line 539 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/usage/store.ts:548— `packages/core/src/usage/store.ts` reports through `console.*` at line 548 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/usage/store.ts:557— `packages/core/src/usage/store.ts` reports through `console.*` at line 557 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/usage/store.ts:566— `packages/core/src/usage/store.ts` reports through `console.*` at line 566 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/usage/store.ts:578— `packages/core/src/usage/store.ts` reports through `console.*` at line 578 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/core/src/storage/migration.ts:13— `packages/core/src/storage/migration.ts` reports through `console.*` at line 13 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:709— `REDACTED` reports through `console.*` at line 709 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:1891— `REDACTED` reports through `console.*` at line 1891 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:140— `REDACTED` reports through `console.*` at line 140 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:168— `REDACTED` reports through `console.*` at line 168 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:180— `REDACTED` reports through `console.*` at line 180 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:520— `REDACTED` reports through `console.*` at line 520 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:559— `REDACTED` reports through `console.*` at line 559 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel REDACTED:756— `REDACTED` reports through `console.*` at line 756 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Deprecated: glob REDACTED:226— glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: boolean REDACTED:3027— boolean 3.2.0 is resolved in REDACTED and is marked deprecated by its publisher: "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: core-js REDACTED:3401— core-js 2.6.12 is resolved in REDACTED and is marked deprecated by its publisher: "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: inflight REDACTED:5429— inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: lodash.isequal REDACTED:6056— lodash.isequal 4.5.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: popper.js REDACTED:7015— popper.js 1.16.1 is resolved in REDACTED and is marked deprecated by its publisher: "You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: prebuild-install REDACTED:7062— prebuild-install 7.1.3 is resolved in REDACTED and is marked deprecated by its publisher: "No longer maintained. Please contact the author of the relevant native addon; alternatives are available.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: rimraf REDACTED:7764— rimraf 2.6.3 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: glob REDACTED:7799— glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: viewport-mercator-project REDACTED:8825— viewport-mercator-project 7.0.4 is resolved in REDACTED and is marked deprecated by its publisher: "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
No app-layer HTTPS enforcement detected REDACTED:542— `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
No app-layer HTTPS enforcement detected REDACTED:356— `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
No app-layer HTTPS enforcement detected REDACTED:796— `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
D21 · Naming Consistency· `baseURL` spells `URL` where 292 names in the project spell it `Url` · ×2
`baseURL` spells `URL` where 292 names in the project spell it `Url` packages/core/src/mcp/toolhub-mcp.ts:1712— 292 of 294 names in project claude-code-router-monorepo spell the token `Url` (292 of 294; unit: names in project claude-code-router-monorepo containing `Url`). Peers: cli.openManagementUrl (packages/cli/src/cli.ts:470); qr-login-service.qrCodeUrlFromAuth (packages/core/src/agents/bot-gateway/qr-login-service.ts:450); cdp.claudeAppDesktopDesignUrl (packages/core/src/agents/claude-app/cdp.ts:193); cdp.claudeAppDesktopDesignUrl(designUrl) (packages/core/src/agents/claude-app/cdp.ts:193); cdp.claudeAppDesignFrameScript(designUrl) (packages/core/src/agents/claude-app/cdp.ts:244). Rename to `baseUrl`. [rule N6]
`baseURL` spells `URL` where 292 names in the project spell it `Url` packages/core/src/mcp/toolhub-mcp.ts:1742— 292 of 294 names in project claude-code-router-monorepo spell the token `Url` (292 of 294; unit: names in project claude-code-router-monorepo containing `Url`). Peers: cli.openManagementUrl (packages/cli/src/cli.ts:470); qr-login-service.qrCodeUrlFromAuth (packages/core/src/agents/bot-gateway/qr-login-service.ts:450); cdp.claudeAppDesktopDesignUrl (packages/core/src/agents/claude-app/cdp.ts:193); cdp.claudeAppDesktopDesignUrl(designUrl) (packages/core/src/agents/claude-app/cdp.ts:193); cdp.claudeAppDesignFrameScript(designUrl) (packages/core/src/agents/claude-app/cdp.ts:244). Rename to `baseUrl`. [rule N6]
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 104 significant file(s) lose their only recent owner: REDACTED, REDACTED, REDACTED, packages/ui/src/pages/home/components/settings.tsx, REDACTED, packages/core/src/mcp/toolhub-mcp.ts, packages/ui/src/pages/home/components/profiles.tsx, packages/core/src/providers/account-service.ts (+96 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 3 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 (107 single-owned of 223 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; 223 of the 318 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: packages/core/src/agents/local-providers/kimi.ts, packages/core/src/agents/local-providers/opencode-freetier.ts, packages/core/src/gateway/core-runtime/responses-tool-strictness.ts.
No ADRs found packages/core/package.json:7— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `packages/core/package.json` makes this repository a deployable product (line 7).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 7 project(s) overshoot their size bounds, lowering Project Cohesion to 4.3/10. The most over is `packages/core` (95519 LoC, 303 module-visible types across 44 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.
Disabled test tests/e2e/electron-cdp.spec.ts:35— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 2/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `packages/cli`.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 3 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation package.json:79— `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code· Unused export 'findInstalledZcodeAppExecutable' · ×1
Unused export 'findInstalledZcodeAppExecutable' REDACTED:242— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'zcodeModelCatalogJson' · ×1
Unused export 'zcodeModelCatalogJson' packages/core/src/agents/zcode/model-catalog.ts:77— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'GROK_MEDIA_MCP_SERVER_NAME' · ×1
Unused export 'GROK_MEDIA_MCP_SERVER_NAME' packages/core/src/contracts/app.ts:130— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'providerDeepLinkHost' · ×1
Unused export 'providerDeepLinkHost' packages/core/src/contracts/deep-link.ts:16— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CcrLiveTokenRateConfigMessage' · ×1
Unused export 'CcrLiveTokenRateConfigMessage' packages/core/src/gateway/core-runtime/router-plugin-contract.ts:20— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CcrLiveTokenRateSnapshotMessage' · ×1
Unused export 'CcrLiveTokenRateSnapshotMessage' packages/core/src/gateway/core-runtime/router-plugin-contract.ts:26— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CcrRouterPluginRouteResponse' · ×1
Unused export 'CcrRouterPluginRouteResponse' packages/core/src/gateway/core-runtime/router-plugin-contract.ts:66— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'decodeCcrRouteFallbackHeader' · ×1
Unused export 'decodeCcrRouteFallbackHeader' packages/core/src/gateway/core-runtime/router-plugin-contract.ts:83— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'DEFAULT_RETRY_AFTER_MS' · ×1
Unused export 'DEFAULT_RETRY_AFTER_MS' packages/core/src/gateway/internal/clock.ts:1— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'apiKeyLimitCounterRetentionWindows' · ×1
Unused export 'apiKeyLimitCounterRetentionWindows' packages/core/src/gateway/internal/shared.ts:292— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'privateDirMode' · ×1
Unused export 'privateDirMode' packages/core/src/gateway/internal/shared.ts:353— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'privateFileMode' · ×1
Unused export 'privateFileMode' packages/core/src/gateway/internal/shared.ts:355— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'claudeCodeEffectiveMaxInputTokens' · ×1
Unused export 'claudeCodeEffectiveMaxInputTokens' packages/core/src/gateway/model-catalog.ts:164— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'modelCatalogReasoningEffortConfig' · ×1
Unused export 'modelCatalogReasoningEffortConfig' packages/core/src/gateway/model-catalog.ts:184— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'broadcastWindowsEnvironmentChanged' · ×1
Unused export 'broadcastWindowsEnvironmentChanged' packages/core/src/platform/windows-system.ts:30— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ProfileModelAllowlistConfig' · ×1
Unused export 'ProfileModelAllowlistConfig' packages/core/src/profiles/model-allowlist.ts:6— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'readProxyCertificateSerialNumber' · ×1
Unused export 'readProxyCertificateSerialNumber' packages/core/src/proxy/certificates.ts:132— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isSafeRouteReadPath' · ×1
Unused export 'isSafeRouteReadPath' packages/core/src/routing/rewrite.ts:210— Nothing imports this binding — it is safe to review for removal.
Unused export 'formatJson' packages/ui/src/pages/home/shared/common.ts:39— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'metricToneStroke' · ×1
Unused export 'metricToneStroke' packages/ui/src/pages/home/shared/common.ts:624— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists.
Unused export 'MetricCard' packages/ui/src/pages/home/shared/controls.tsx:253— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'systemStatusIconClass' · ×1
Unused export 'systemStatusIconClass' packages/ui/src/pages/home/shared/controls.tsx:327— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'systemStatusSegmentClass' · ×1
Unused export 'systemStatusSegmentClass' packages/ui/src/pages/home/shared/controls.tsx:334— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'pluginRuntimeSurfacesEnabled' · ×1
Unused export 'pluginRuntimeSurfacesEnabled' packages/ui/src/pages/home/shared/extensions.ts:638— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'providerSelectOptions' · ×1
Unused export 'providerSelectOptions' packages/ui/src/pages/home/shared/extensions.ts:692— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/ui/src/pages/home/shared/index.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/ui/src/pages/home/shared/index.tsx in the same commit, or the barrel will import a name that no longer exists.
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 29/37 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 5/7 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Null assertions (`!`) override strict null checking — ~0.1 `!` null assertions per 1k TypeScript source lines — 23 assertion(s) across the 169989 source line(s) of the 317 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: packages/core/src/media/service.ts (4), docs/src/docs-structure.ts (3), docs/src/pages/search-index-[locale].json.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Outdated (npm): @astrojs/react — @astrojs/react is pinned at 6.0.2; registry.npmjs.org publishes 7.1.9 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @musistudio/lucide-morph-react — @musistudio/lucide-morph-react is pinned at 1.0.0; registry.npmjs.org publishes 1.0.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @types/react — @types/react is pinned at 18.3.31; registry.npmjs.org publishes 19.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @types/react-dom — @types/react-dom is pinned at 18.3.7; registry.npmjs.org publishes 19.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): baseui — baseui is pinned at 16.1.1; registry.npmjs.org publishes 18.2.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): better-sqlite3 — better-sqlite3 is pinned at 12.11.1; registry.npmjs.org publishes 13.2.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): electron-updater — electron-updater is pinned at 6.8.9; registry.npmjs.org publishes 6.8.11 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): lucide-react — lucide-react is pinned at 1.20.0; registry.npmjs.org publishes 1.73.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): motion — motion is pinned at 12.40.0; registry.npmjs.org publishes 14.14.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): node-forge — node-forge is pinned at 1.4.0; registry.npmjs.org publishes 1.4.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): openai — openai is pinned at 6.49.0; registry.npmjs.org publishes 7.57.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): pm2 — pm2 is pinned at 7.0.4; registry.npmjs.org publishes 7.1.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): react — react is pinned at 18.3.1; registry.npmjs.org publishes 19.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): react-dom — react-dom is pinned at 18.3.1; registry.npmjs.org publishes 19.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): recharts — recharts is pinned at 3.8.1; registry.npmjs.org publishes 3.10.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): tailwind-merge — tailwind-merge is pinned at 3.6.0; registry.npmjs.org publishes 3.7.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): undici — undici is pinned at 7.29.0; registry.npmjs.org publishes 8.12.4 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Skipped (documented): Fusion vision MCP sends the core API key and retries a body-free lightweight usage event packages/core/test/integration/mcp/fusion-vision-mcp.test.mjs:11— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Fusion vision MCP retries and falls back between configured vision models packages/core/test/integration/mcp/fusion-vision-mcp.test.mjs:140— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Fusion vision MCP preserves billing headers and status from non-JSON provider errors packages/core/test/integration/mcp/fusion-vision-mcp.test.mjs:240— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Fusion vision MCP preserves slash-containing model IDs for external runtimes packages/core/test/integration/mcp/fusion-vision-mcp.test.mjs:331— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): media tools stdio proxy exposes its compiled catalog and forwards calls with CCR auth packages/core/test/integration/mcp/media-tools-proxy-mcp.test.mjs:7— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): built ToolHub MCP runtime accepts newline JSON stdio used by MCP Inspector packages/core/test/integration/mcp/toolhub-mcp-runtime.test.mjs:14— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): built ToolHub MCP runtime waits for local CCR resolver readiness packages/core/test/integration/mcp/toolhub-mcp-runtime.test.mjs:86— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): built ToolHub MCP runtime expands browser automation bundles with handoff tools packages/core/test/integration/mcp/toolhub-mcp-runtime.test.mjs:188— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): built ToolHub MCP runtime deterministically resolves Chrome login import tools packages/core/test/integration/mcp/toolhub-mcp-runtime.test.mjs:305— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): built ToolHub MCP runtime does not add CCR handoff tools for non-CCR browser tools packages/core/test/integration/mcp/toolhub-mcp-runtime.test.mjs:410— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): built ToolHub MCP runtime keeps resolve cache scoped by task packages/core/test/integration/mcp/toolhub-mcp-runtime.test.mjs:542— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): gateway treats downstream client aborts as expected stream cleanup packages/core/test/integration/gateway/gateway-client-disconnect.test.mjs:11— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): gateway HTTP model discovery and request access honor profile model allowlists packages/core/test/integration/gateway/profile-model-allowlist-http.test.mjs:11— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 6 file(s) — `packages/core/src/contracts/app.ts`, `REDACTED`, `packages/core/src/plugins/service.ts`, `REDACTED`, `packages/electron/src/main/ipc.ts`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1d9ee-f70e-7d7c-b317-7d78539bee34 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 78 · Warnings: 1200 · Recommendations: 178 · Info: 30 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 12:01 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.