Public report of banmu123/BrewPing, published 16 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, 16 November 2026, 21:00 UTC · Survey ID cd_b8cd37cd54c943f5b1b5b3e86e4c2174
banmu123/BrewPing
Measured 16 November 2026, 20:57 UTC, at code version 4eec31d
Code coverage is not measured: JavaScript/TypeScript and Swift suite (CouldNotMeasureNoCollector, Unclassified).
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 72,803 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 0.5 person-years · Weakest lens: Accessibility, 40.4
Findings by how serious they are
58 critical548 serious29 minor
20 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
16 November 2026, 20:57 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 ▸
73of 73 dimensions measured by tools.
625of 635 findings point to an exact file and line, so you can open each one in the code. The other 10 concern the repository as a whole, such as missing documentation.
73dimensions across 8 lenses, read from 72,803 lines of product code in 11 projects.
banmu123/BrewPing is rated At risk because critical security findings are open. Its score is held back because it has controls that only work with a mouse. It scores 52.5 out of 100, which the At risk rating leaves unchanged.
Accessibility, at 40.4, is the weakest lens and counts most in the score. The best first step is making the controls keyboard-usable, worth about 6.6 points. Labelling the form fields and buttons comes next, worth about 4.3 points. Raising Accessibility to 70 would lift the score to about 60.5.
Thirty-eight form fields can't be read by a screen reader. Eight known security holes in the packages the code depends on can be used by attackers. Labelling the form fields and updating the vulnerable packages would close both risks. Pinning each tool to an exact version would fix the seven pipeline tools referenced by a changeable name, and setting a waiting period for automatic updates would deal with the automatic dependency update that takes a new release at once. The button or link with no name needs a name, even when it only shows an icon.
The product code is 72,803 lines, about €74,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Accessibility rose from 40.4 to 70, the lowest score rated Strong, the score would rise from 52.5 to about 60.5.
Code composition: what the lines of code are
Product code 95%Tests 5%
Rebuild cost: about €74,000 · Estimate
Cost to rebuild
€25,000 to €120,000, for 411 to 1,305 hours of work, about 0.5 person-years for one engineer
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 53. 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
Medium: 72,803 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
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 6.6 points · Medium effort · Keyboard semantics
2
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Raises the score by about 4.3 points · Medium effort · Forms & labels
3
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €74,000 to build again, about 0.5 person-years of work. Its weakest lens is Accessibility, at 40.4 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. Of all the actions in this report, it raises the score most for the work it takes: about 6.6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 6% on every change. The history of the code shows how much it changes: about 132,062 lines over the last 90 days, which is about 535,585 lines a year. At that pace, the extra work comes to an estimated 36 to 215.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
118 modules, with 113 dependencies between them. One loop runs through 8 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 78 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.
Sources.BrewPingwinDesktop.src.lib uses Sources.BrewPingwinDesktop.src.api.types, so a change to Sources.BrewPingwinDesktop.src.api.types can break Sources.BrewPingwinDesktop.src.lib, while a change to Sources.BrewPingwinDesktop.src.lib can't break Sources.BrewPingwinDesktop.src.api.types.
Position
Below the diagonal: Sources.BrewPingwinDesktop.src.lib uses a module listed above it, which is the healthy direction.
brewping_desktop.services.model_prefs uses brewping_desktop.services.approval_gate, so a change to brewping_desktop.services.approval_gate can break brewping_desktop.services.model_prefs, while a change to brewping_desktop.services.model_prefs can't break brewping_desktop.services.approval_gate.
Position
Below the diagonal: brewping_desktop.services.model_prefs uses a module listed above it, which is the healthy direction.
brewping_desktop.services.model_provider_store uses brewping_desktop.services.approval_gate, so a change to brewping_desktop.services.approval_gate can break brewping_desktop.services.model_provider_store, while a change to brewping_desktop.services.model_provider_store can't break brewping_desktop.services.approval_gate.
Position
Below the diagonal: brewping_desktop.services.model_provider_store uses a module listed above it, which is the healthy direction.
brewping_desktop.services.pairing_store uses brewping_desktop.services.approval_gate, so a change to brewping_desktop.services.approval_gate can break brewping_desktop.services.pairing_store, while a change to brewping_desktop.services.pairing_store can't break brewping_desktop.services.approval_gate.
Position
Below the diagonal: brewping_desktop.services.pairing_store uses a module listed above it, which is the healthy direction.
com.brewping.android.discovery uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.android.discovery, while a change to com.brewping.android.discovery can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.android.discovery uses a module listed above it, which is the healthy direction.
com.brewping.core.api uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.core.api, while a change to com.brewping.core.api can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.core.api uses a module listed above it, which is the healthy direction.
com.brewping.core.api uses com.brewping.core.store, so a change to com.brewping.core.store can break com.brewping.core.api, while a change to com.brewping.core.api can't break com.brewping.core.store.
Position
Below the diagonal: com.brewping.core.api uses a module listed above it, which is the healthy direction.
com.brewping.wear.data.WearProvisionStore uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.wear.data.WearProvisionStore, while a change to com.brewping.wear.data.WearProvisionStore can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.wear.data.WearProvisionStore uses a module listed above it, which is the healthy direction.
experimental.relay-server.src.websocket.connection uses experimental.relay-server.src.types.message, so a change to experimental.relay-server.src.types.message can break experimental.relay-server.src.websocket.connection, while a change to experimental.relay-server.src.websocket.connection can't break experimental.relay-server.src.types.message.
Position
Below the diagonal: experimental.relay-server.src.websocket.connection uses a module listed above it, which is the healthy direction.
brewping_desktop.services.http_server uses brewping_desktop.services.approval_gate, so a change to brewping_desktop.services.approval_gate can break brewping_desktop.services.http_server, while a change to brewping_desktop.services.http_server can't break brewping_desktop.services.approval_gate.
Position
Below the diagonal: brewping_desktop.services.http_server uses a module listed above it, which is the healthy direction.
brewping_desktop.services.http_server uses brewping_desktop.services.conversation_store, so a change to brewping_desktop.services.conversation_store can break brewping_desktop.services.http_server, while a change to brewping_desktop.services.http_server can't break brewping_desktop.services.conversation_store.
Position
Below the diagonal: brewping_desktop.services.http_server uses a module listed above it, which is the healthy direction.
brewping_desktop.services.http_server uses brewping_desktop.services.terminal_state, so a change to brewping_desktop.services.terminal_state can break brewping_desktop.services.http_server, while a change to brewping_desktop.services.http_server can't break brewping_desktop.services.terminal_state.
Position
Below the diagonal: brewping_desktop.services.http_server uses a module listed above it, which is the healthy direction.
brewping_desktop.services.http_server uses brewping_desktop.services.model_prefs, so a change to brewping_desktop.services.model_prefs can break brewping_desktop.services.http_server, while a change to brewping_desktop.services.http_server can't break brewping_desktop.services.model_prefs.
Position
Below the diagonal: brewping_desktop.services.http_server uses a module listed above it, which is the healthy direction.
brewping_desktop.services.http_server uses brewping_desktop.services.pairing_store, so a change to brewping_desktop.services.pairing_store can break brewping_desktop.services.http_server, while a change to brewping_desktop.services.http_server can't break brewping_desktop.services.pairing_store.
Position
Below the diagonal: brewping_desktop.services.http_server uses a module listed above it, which is the healthy direction.
brewping_desktop.services.model_proxy uses brewping_desktop.services.model_provider_store, so a change to brewping_desktop.services.model_provider_store can break brewping_desktop.services.model_proxy, while a change to brewping_desktop.services.model_proxy can't break brewping_desktop.services.model_provider_store.
Position
Below the diagonal: brewping_desktop.services.model_proxy uses a module listed above it, which is the healthy direction.
com.brewping.android.repository uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.android.repository, while a change to com.brewping.android.repository can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.android.repository uses a module listed above it, which is the healthy direction.
com.brewping.android.repository uses com.brewping.android.discovery, so a change to com.brewping.android.discovery can break com.brewping.android.repository, while a change to com.brewping.android.repository can't break com.brewping.android.discovery.
Position
Below the diagonal: com.brewping.android.repository uses a module listed above it, which is the healthy direction.
com.brewping.android.repository uses com.brewping.core.api, so a change to com.brewping.core.api can break com.brewping.android.repository, while a change to com.brewping.android.repository can't break com.brewping.core.api.
Position
Below the diagonal: com.brewping.android.repository uses a module listed above it, which is the healthy direction.
com.brewping.android.store uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.android.store, while a change to com.brewping.android.store can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.android.store uses a module listed above it, which is the healthy direction.
com.brewping.android.store uses com.brewping.core.api, so a change to com.brewping.core.api can break com.brewping.android.store, while a change to com.brewping.android.store can't break com.brewping.core.api.
Position
Below the diagonal: com.brewping.android.store uses a module listed above it, which is the healthy direction.
com.brewping.core.transport uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.core.transport, while a change to com.brewping.core.transport can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.core.transport uses a module listed above it, which is the healthy direction.
com.brewping.core.transport uses com.brewping.core.api, so a change to com.brewping.core.api can break com.brewping.core.transport, while a change to com.brewping.core.transport can't break com.brewping.core.api.
Position
Below the diagonal: com.brewping.core.transport uses a module listed above it, which is the healthy direction.
experimental.relay-server.src.websocket.manager uses experimental.relay-server.src.types.message, so a change to experimental.relay-server.src.types.message can break experimental.relay-server.src.websocket.manager, while a change to experimental.relay-server.src.websocket.manager can't break experimental.relay-server.src.types.message.
Position
Below the diagonal: experimental.relay-server.src.websocket.manager uses a module listed above it, which is the healthy direction.
experimental.relay-server.src.websocket.manager uses experimental.relay-server.src.websocket.connection, so a change to experimental.relay-server.src.websocket.connection can break experimental.relay-server.src.websocket.manager, while a change to experimental.relay-server.src.websocket.manager can't break experimental.relay-server.src.websocket.connection.
Position
Below the diagonal: experimental.relay-server.src.websocket.manager uses a module listed above it, which is the healthy direction.
63 pairs of types, where a type in BrewPingDesktop uses a type in App. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
BrewPingDesktop uses App, so a change to App can break BrewPingDesktop, while a change to BrewPingDesktop can't break App.
Position
Below the diagonal: BrewPingDesktop uses a module listed above it, which is the healthy direction.
26→37 BrewPingDesktop uses repositorypart of a loop✕
Connections
50 pairs of types, where a type in BrewPingDesktop uses a type in repository. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
brewping_desktop uses brewping_desktop.services.terminal_state, so a change to brewping_desktop.services.terminal_state can break brewping_desktop, while a change to brewping_desktop can't break brewping_desktop.services.terminal_state.
Position
Below the diagonal: brewping_desktop uses a module listed above it, which is the healthy direction.
brewping_desktop uses brewping_desktop.services.model_provider_store, so a change to brewping_desktop.services.model_provider_store can break brewping_desktop, while a change to brewping_desktop can't break brewping_desktop.services.model_provider_store.
Position
Below the diagonal: brewping_desktop uses a module listed above it, which is the healthy direction.
brewping_desktop uses brewping_desktop.services.http_server, so a change to brewping_desktop.services.http_server can break brewping_desktop, while a change to brewping_desktop can't break brewping_desktop.services.http_server.
Position
Below the diagonal: brewping_desktop uses a module listed above it, which is the healthy direction.
brewping_desktop uses brewping_desktop.services.model_proxy, so a change to brewping_desktop.services.model_proxy can break brewping_desktop, while a change to brewping_desktop can't break brewping_desktop.services.model_proxy.
Position
Below the diagonal: brewping_desktop uses a module listed above it, which is the healthy direction.
com.brewping.android uses com.brewping.core.store, so a change to com.brewping.core.store can break com.brewping.android, while a change to com.brewping.android can't break com.brewping.core.store.
Position
Below the diagonal: com.brewping.android uses a module listed above it, which is the healthy direction.
com.brewping.android uses com.brewping.android.discovery, so a change to com.brewping.android.discovery can break com.brewping.android, while a change to com.brewping.android can't break com.brewping.android.discovery.
Position
Below the diagonal: com.brewping.android uses a module listed above it, which is the healthy direction.
com.brewping.android uses com.brewping.core.api, so a change to com.brewping.core.api can break com.brewping.android, while a change to com.brewping.android can't break com.brewping.core.api.
Position
Below the diagonal: com.brewping.android uses a module listed above it, which is the healthy direction.
com.brewping.android uses com.brewping.android.repository, so a change to com.brewping.android.repository can break com.brewping.android, while a change to com.brewping.android can't break com.brewping.android.repository.
Position
Below the diagonal: com.brewping.android uses a module listed above it, which is the healthy direction.
com.brewping.android uses com.brewping.android.store, so a change to com.brewping.android.store can break com.brewping.android, while a change to com.brewping.android can't break com.brewping.android.store.
Position
Below the diagonal: com.brewping.android uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in com.brewping.android.ui uses a type in com.brewping.core.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com.brewping.android.ui uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.android.ui, while a change to com.brewping.android.ui can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.android.ui uses a module listed above it, which is the healthy direction.
com.brewping.android.ui uses com.brewping.core.store, so a change to com.brewping.core.store can break com.brewping.android.ui, while a change to com.brewping.android.ui can't break com.brewping.core.store.
Position
Below the diagonal: com.brewping.android.ui uses a module listed above it, which is the healthy direction.
com.brewping.android.ui uses com.brewping.core.api, so a change to com.brewping.core.api can break com.brewping.android.ui, while a change to com.brewping.android.ui can't break com.brewping.core.api.
Position
Below the diagonal: com.brewping.android.ui uses a module listed above it, which is the healthy direction.
com.brewping.android.ui uses com.brewping.android.repository, so a change to com.brewping.android.repository can break com.brewping.android.ui, while a change to com.brewping.android.ui can't break com.brewping.android.repository.
Position
Below the diagonal: com.brewping.android.ui uses a module listed above it, which is the healthy direction.
com.brewping.android.ui uses com.brewping.android.store, so a change to com.brewping.android.store can break com.brewping.android.ui, while a change to com.brewping.android.ui can't break com.brewping.android.store.
Position
Below the diagonal: com.brewping.android.ui uses a module listed above it, which is the healthy direction.
com.brewping.android.ui.HomeViewModel uses com.brewping.android.repository, so a change to com.brewping.android.repository can break com.brewping.android.ui.HomeViewModel, while a change to com.brewping.android.ui.HomeViewModel can't break com.brewping.android.repository.
Position
Below the diagonal: com.brewping.android.ui.HomeViewModel uses a module listed above it, which is the healthy direction.
com.brewping.android.ui.HomeViewModel uses com.brewping.android.store, so a change to com.brewping.android.store can break com.brewping.android.ui.HomeViewModel, while a change to com.brewping.android.ui.HomeViewModel can't break com.brewping.android.store.
Position
Below the diagonal: com.brewping.android.ui.HomeViewModel uses a module listed above it, which is the healthy direction.
com.brewping.wear.data uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.wear.data, while a change to com.brewping.wear.data can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.wear.data uses a module listed above it, which is the healthy direction.
com.brewping.wear.data uses com.brewping.wear.data.WearProvisionStore, so a change to com.brewping.wear.data.WearProvisionStore can break com.brewping.wear.data, while a change to com.brewping.wear.data can't break com.brewping.wear.data.WearProvisionStore.
Position
Below the diagonal: com.brewping.wear.data uses a module listed above it, which is the healthy direction.
com.brewping.wear.data uses com.brewping.core.transport, so a change to com.brewping.core.transport can break com.brewping.wear.data, while a change to com.brewping.wear.data can't break com.brewping.core.transport.
Position
Below the diagonal: com.brewping.wear.data uses a module listed above it, which is the healthy direction.
experimental.relay-server.src.websocket.heartbeat uses experimental.relay-server.src.websocket.manager, so a change to experimental.relay-server.src.websocket.manager can break experimental.relay-server.src.websocket.heartbeat, while a change to experimental.relay-server.src.websocket.heartbeat can't break experimental.relay-server.src.websocket.manager.
Position
Below the diagonal: experimental.relay-server.src.websocket.heartbeat uses a module listed above it, which is the healthy direction.
com.brewping.wear uses com.brewping.core.store, so a change to com.brewping.core.store can break com.brewping.wear, while a change to com.brewping.wear can't break com.brewping.core.store.
Position
Below the diagonal: com.brewping.wear uses a module listed above it, which is the healthy direction.
com.brewping.wear uses com.brewping.core.api, so a change to com.brewping.core.api can break com.brewping.wear, while a change to com.brewping.wear can't break com.brewping.core.api.
Position
Below the diagonal: com.brewping.wear uses a module listed above it, which is the healthy direction.
com.brewping.wear uses com.brewping.core.transport, so a change to com.brewping.core.transport can break com.brewping.wear, while a change to com.brewping.wear can't break com.brewping.core.transport.
Position
Below the diagonal: com.brewping.wear uses a module listed above it, which is the healthy direction.
com.brewping.wear uses com.brewping.wear.data, so a change to com.brewping.wear.data can break com.brewping.wear, while a change to com.brewping.wear can't break com.brewping.wear.data.
Position
Below the diagonal: com.brewping.wear uses a module listed above it, which is the healthy direction.
com.brewping.wear.ui uses com.brewping.core.model, so a change to com.brewping.core.model can break com.brewping.wear.ui, while a change to com.brewping.wear.ui can't break com.brewping.core.model.
Position
Below the diagonal: com.brewping.wear.ui uses a module listed above it, which is the healthy direction.
com.brewping.wear.ui uses com.brewping.core.store, so a change to com.brewping.core.store can break com.brewping.wear.ui, while a change to com.brewping.wear.ui can't break com.brewping.core.store.
Position
Below the diagonal: com.brewping.wear.ui uses a module listed above it, which is the healthy direction.
com.brewping.wear.ui uses com.brewping.wear.data.WearProvisionStore, so a change to com.brewping.wear.data.WearProvisionStore can break com.brewping.wear.ui, while a change to com.brewping.wear.ui can't break com.brewping.wear.data.WearProvisionStore.
Position
Below the diagonal: com.brewping.wear.ui uses a module listed above it, which is the healthy direction.
com.brewping.wear.ui uses com.brewping.wear.data, so a change to com.brewping.wear.data can break com.brewping.wear.ui, while a change to com.brewping.wear.ui can't break com.brewping.wear.data.
Position
Below the diagonal: com.brewping.wear.ui uses a module listed above it, which is the healthy direction.
experimental.relay-server.src.server uses experimental.relay-server.src.websocket.connection, so a change to experimental.relay-server.src.websocket.connection can break experimental.relay-server.src.server, while a change to experimental.relay-server.src.server can't break experimental.relay-server.src.websocket.connection.
Position
Below the diagonal: experimental.relay-server.src.server uses a module listed above it, which is the healthy direction.
experimental.relay-server.src.server uses experimental.relay-server.src.websocket.manager, so a change to experimental.relay-server.src.websocket.manager can break experimental.relay-server.src.server, while a change to experimental.relay-server.src.server can't break experimental.relay-server.src.websocket.manager.
Position
Below the diagonal: experimental.relay-server.src.server uses a module listed above it, which is the healthy direction.
experimental.relay-server.src.server uses experimental.relay-server.src.websocket.heartbeat, so a change to experimental.relay-server.src.websocket.heartbeat can break experimental.relay-server.src.server, while a change to experimental.relay-server.src.server can't break experimental.relay-server.src.websocket.heartbeat.
Position
Below the diagonal: experimental.relay-server.src.server uses a module listed above it, which is the healthy direction.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2025 — Software Supply Chain Failures
28
High / Critical
A05:2025 — Injection
10
High / Critical
A02:2025 — Security Misconfiguration
5
High / Critical
Roadmap
Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label; Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Code Duplication: Edited copy of a member (10 corresponding lines)
How the grades work
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 — 58
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 — 548
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 — 29
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 20
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 73 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 — 73 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, 625 of 635 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.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 184 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 7 test source file(s) (.kt, .ts) that it cannot: it reads the test types the .swift frontend declared, so a suite in any other language is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .swift, and the swift executor ran against the .swift half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in experimental/relay-server/ (11 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 34 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Gradle dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 303 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — 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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
D24 Comment Value — 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
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. `Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt`, `Android/app/src/main/java/com/brewping/android/ui/HelpScreen.kt`, `Sources/App/AttachCLI.swift`, `Sources/App/DangerPattern.swift`, `Sources/PTY/PTYSession.swift`, … (+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.
AX1 Captive dependencies — 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in Android/wear/src/main/java/com/brewping/wear/WearApp.kt, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
AXB2 Runtime readiness — 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. The image build failed, and its output does not match a cause we recognise. (rule: unrecognised-build-failure). The renderer reported: docker build failed (exit -1) — #5 extracting sha256:b2cbbfe903b0821005780971ddc5892edcc4ce74c5a48d82e1d2b382edac3122 0.0s done #5 extracting sha256:fff4e2c1b189bf87d63ad8bd07f7f4eb288d6f2b6a07a8bb44c60e8c075d2096 done #5 DONE 1.6s #6 [builder 2/7] WORKDIR /app #6 DONE 0.0s #7 [builder 3/7] COPY package.json REDACTED* ./ #7 DONE 0.0s #8 [builder 4/7] RUN npm install -g pnpm && pnpm install --frozen-lockfile || pnpm install; likely cause (not identified): the image build failed, and its output does not match a cause we recognise; runtime evidence skipped.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (Android/app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConn…; runtime evidence skipped (launch chosen because Android/app/build.gradle.kts applies the Android application plugin and Android/gradlew builds it).
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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
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. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
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. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
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. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Kotlin, Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Kotlin, Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 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.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X12 Unreachable branch — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X16 Unfloored truncation loop — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X18 Disposal-pattern correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X19 Unrestored process-global state — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X2 Cancellation propagation — 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, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
X21 Side-effecting pattern guard — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X23 Unguarded diagnostic materialisation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X25 Inert configuration knob — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X26 Unsynchronised callback handoff — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X29 Per-element action decided by a fixed element — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X30 Support guard that admits what it rejects — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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, Rust, Go, Swift, Erlang, F# and Visual Basic 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.
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.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
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.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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".
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.
51 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was model-config-card.ModelConfigCard at 178. A further 1 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 HTTPAPI.handle at 33 — they are counted neither in the figure above nor in this dimension's score.
+ 40 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 model-config-card.ModelConfigCard (cyclomatic 178). — Refactoring it lifts Cyclomatic Complexity from 5.4 to about 5.8/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.
+ 67 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 60 down to 60 or less in Cognitive Complexity — start with model-config-card.ModelConfigCard (cognitive 147), App.App (cognitive 130), DemoBackend.handle (cognitive 116). — 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 6 together lifts Cognitive Complexity from 4.6 to about 5.9/10, projected with the scoring formula itself and assuming each lands exactly at 60; 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.1 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 20 FileTooLong finding(s) in God Classes — start with model-config-card.tsx, CLIProviderPanels.swift, DesktopStrings.swift. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 18 FunctionTooLong finding(s) in God Classes — start with App.tsx (3), model-config-card.tsx, setup-wizard.tsx. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 15 ClassTooLong finding(s) in God Classes — start with DesktopStrings.swift (2), ContentView.swift, App.tsx. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
83 duplicated block group(s) detected. 5.0 % of the production lines (3,639 of 72,803) are in a reported copy. A further 71 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 154 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
Edited copy of a member (10 corresponding lines) · ×6Sources/App/RelayBridge.swift:37
+ 71 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with agent_config.rs (4), DesktopCommands.swift, HTTPAPI.swift. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 8 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with HTTPAPI.swift (2), CLIProviderPanels.swift, TerminalDockView.swift. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 7 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with CLIProviderPanels.swift (2), WorkdirPickerView.swift, ContentView.swift. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.5 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
11 production modules (Gradle+Cargo+npm+SwiftPM+Xcode), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; a workspace's implicit (product-name) dependency is not visible there; 2 module(s) off the main sequence, with abstractness counted on 10 of the 11 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: BrewPingCore · ×2
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with WatchConnectivityManager.swift. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 184 tests. Measured on the .swift suite only — at least 7 test source file(s) (.kt, .ts) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 515 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved and a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: Sources/BrewPingwinDesktop/src/App.tsx (15×110=1650); ios/BrewPing/ContentView.swift (32×22=704); ios/BrewPing/DemoBackend.swift (8×80=640) Repeated repair below the complexity floor: ios/BrewPing/BonjourDiscovery.swift (7 of 12 changes were fixes); ios/Watch/VoiceCommandView.swift (7 of 11 changes were fixes); Sources/BrewPingDesktop/SetupWizardView.swift (4 of 6 changes were fixes)
Resolve the 17 Hotspot finding(s) in Churn × Complexity Hotspots — start with App.tsx, ContentView.swift, DemoBackend.swift. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 7 Repeated repair finding(s) in Churn × Complexity Hotspots — start with BonjourDiscovery.swift, VoiceCommandView.swift, SetupWizardView.swift. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 72803 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.
1 of 1 documentation facets pass in full. 20 document(s) read across 3 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.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
1 naming inconsistencies among 41 declarations measured against a convention their peers follow.
`additionalPATHEntries` spells `PATH` where 40 names in the project spell it `Path`Sources/Agents/AgentDiscovery.swift:81
What to do
Resolve the 1 `additionalPATHEntries` spells `PATH` where 40 names in the project… finding(s) in Naming Consistency — start with AgentDiscovery.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
2 of 8 build units (Cargo, Gradle, SwiftPM, Xcode, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×2Package.swift:1
What to do
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Package.swift, Cargo.toml. — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
10 finding(s): 0 critical, 8 high, 2 medium, 0 low. 7 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 4 file(s) — `REDACTED`, `Android/gradlew` (line 74, line 180), `Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs` (line 281, line 309), `ios/BrewPing/RemoteAccess.swift` (line 167, line 168) — 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
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
No action in Static Analysis (SAST) — all 7 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (7 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 6 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (6). — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 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).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 196 of the 254 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.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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 3 platform declaration(s) and 37 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.
AC2 · Forms & labels4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — Sources/BrewPingwinDesktop/src/App.tsx:1408
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×29) — Sources/BrewPingwinDesktop/src/components/chat/chat-view.tsx:194, Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:247, Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:168, …
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×9) — Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:255, Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:942, Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1009, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — Sources/BrewPingwinDesktop/index.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×2) — Sources/BrewPingwinDesktop/src/App.tsx:1129, Sources/BrewPingwinDesktop/src/App.tsx:1408
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.
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:247, Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:333
`*:focus` 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. — Sources/BrewPingwinDesktop/src/styles/app.css:157
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.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.2 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 2 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. — REDACTED:6
`REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, `cargo`, `gradle`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:2
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Dependabot is configured but does not watch `npm`, `cargo`, `gradle` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
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.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release. — REDACTED:86
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
Do you agree with this assessment?
R10 · Code Duplication3.6 / 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.
Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:80 · Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:63 — the two spans are one implementation copied and then locally edited — 1244 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. — Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:80
Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:28 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:29 — the two spans are one implementation copied and then locally edited — 1167 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. — Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:28
Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:74 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:110 — 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. — Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:74
Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:177 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:202 — 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. — Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:177
Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:107 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:175 — 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. — Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:107
Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:142 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:183 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:208 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:142
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1557 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1625 — 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. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1557
Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:256 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:372 — 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. — Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:256
Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx:55 · Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:69 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx:55
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:607 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:763 — 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. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:607
Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:330 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:327 — 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. — Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:330
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1670 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1759 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1670
Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:28 · Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:33 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:34 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:28
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1390 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1590 — 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. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1390
Sources/BrewPingwinDesktop/src/App.tsx:122 · Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx:62 · Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:76 — the 3 copies are spread across 3 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. — Sources/BrewPingwinDesktop/src/App.tsx:122
Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:309 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:47 · Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:47 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:313 · +1 more site(s) not listed — the 5 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:309
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:446 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:607 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:763 — all 3 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. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:446
Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:227 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:171 — 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. — Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:227
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1012 · Sources/BrewPingwinDesktop/src/components/settings/vendor-preset-select.tsx:106 — 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. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1012
Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:382 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:561 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:645 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:714 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:382
Sources/BrewPingwinDesktop/src/api/tauri.ts:188 · Sources/BrewPingwinDesktop/src/api/tauri.ts:208 — 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. — Sources/BrewPingwinDesktop/src/api/tauri.ts:188
Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:112 · Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:307 — 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. — Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:112
Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:391 · Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:449 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:391
Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:724 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:798 — 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. — Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:724
Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:404 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:421 — 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. — Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:404
Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:86 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:134 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:136 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:86
Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:240 · Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:248 — 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. — Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:240
Sources/BrewPingwinDesktop/src/components/ui/card.tsx:6 · Sources/BrewPingwinDesktop/src/components/ui/card.tsx:17 · Sources/BrewPingwinDesktop/src/components/ui/card.tsx:24 · Sources/BrewPingwinDesktop/src/components/ui/card.tsx:35 — all 4 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — Sources/BrewPingwinDesktop/src/components/ui/card.tsx:6
Sources/BrewPingwinDesktop/src/App.tsx:91 · Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:41 — 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. — Sources/BrewPingwinDesktop/src/App.tsx:91
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.
ModelConfigCard has cyclomatic complexity 96 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. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:176
App has cyclomatic complexity 67 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. — Sources/BrewPingwinDesktop/src/App.tsx:230
SetupWizard has cyclomatic complexity 50 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. — Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:118
EnvironmentCard has cyclomatic complexity 32 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:48
SettingsView has cyclomatic complexity 21 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. — Sources/BrewPingwinDesktop/src/App.tsx:1349
CodexProviderForm has cyclomatic complexity 21 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:84
OpenCodeProviderForm has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:67
PiProviderForm has cyclomatic complexity 19 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:93
WorkdirPicker has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:47
(anonymous) has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1780
(anonymous) has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:132
(anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×3) — Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:89, Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:405, Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:125
applyPreset has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:151, Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:185
(anonymous) has cyclomatic complexity 11 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1691
Do you agree with this assessment?
R3 · Large Files3.2 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx has 1799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1
Sources/BrewPingwinDesktop/src/App.tsx has 1521 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/BrewPingwinDesktop/src/App.tsx:1
Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx has 789 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:1
Sources/BrewPingwinDesktop/src/api/tauri.ts has 480 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/BrewPingwinDesktop/src/api/tauri.ts:1
Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx has 473 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage1.8 / 10Critical✓ 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. (×31) — Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1, Sources/BrewPingwinDesktop/src/App.tsx:1, Sources/BrewPingwinDesktop/src/i18n/locales.ts: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 Code9.8 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 2 application, 3 tooling and 1 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (2 application, 3 tooling, 1 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 — Sources/BrewPingwinDesktop/src/components/ui/card.tsx
Nothing imports this binding — it is safe to review for removal. (×2) — experimental/relay-server/src/types/message.ts:62, experimental/relay-server/src/utils/auth.ts:18
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in Sources/BrewPingwinDesktop/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. (×2) — Sources/BrewPingwinDesktop/package.json:16, Sources/BrewPingwinDesktop/package.json:19
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · 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.
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.
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.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`std::mem::forget(mdns)` (line 1512) takes `mdns` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:1512
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
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.
`ClaudeProviderEntry.other_keys` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:95
`CodexProviderEntry.active` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:83
`PairBody.device_name` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:237
`PiProviderEntry.is_default` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:98
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
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.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — ios/BrewPing/CommandReceiver.swift:705, ios/BrewPing/CommandReceiver.swift:722, ios/BrewPing/ContentView.swift:1576, …
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. (×15) — experimental/relay-server/src/websocket/connection.ts:56, Sources/BrewPingwinDesktop/src/App.tsx:309, Sources/BrewPingwinDesktop/src/App.tsx:318, …
`.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) — Sources/BrewPingwinDesktop/src/components/error-boundary.tsx:53, Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:317, Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:347, …
`catch (t: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — Android/core/src/main/java/com/brewping/core/store/PairingStore.kt:73, Android/core/src/main/java/com/brewping/core/store/PairingStore.kt:103, Android/core/src/main/java/com/brewping/core/store/PairingStore.kt:120
`catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — Android/app/src/main/java/com/brewping/android/ui/QrScanScreen.kt:192, Android/app/src/main/java/com/brewping/android/ui/QrScanScreen.kt:209, Android/app/src/main/java/com/brewping/android/store/DeviceStore.kt:149
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
`tauri::Builder::default().plugin(tauri_plugin_shell::init()).setup(|app|{let setup_started=std::time::Instant::now();let identity=services::device_identity::load_or_create();let device_name=services::device_identity::get_device_name();let lan_ip=services::lan_address::detect_primary_lan().map(|info|info.ip.to_string()).unwrap_or_else(||"0.0.0.0".to_string());log::info!("Device: {} ({}) on {}",device_name,identity.device_id,lan_ip);let agents:Vec<AgentEntry>=Vec::new();let default_agent="opencode".to_string();let terminal=TerminalManager::new();let command_store=CommandStore::new();let pairing=Arc::new(PairingStore::new());let approval=Arc::new(ApprovalGate::new());let model_prefs=Arc::new(ModelPrefs::new());let workdir_prefs=Arc::new(WorkdirPrefs::new());let conversations=Arc::new(ConversationStore::new());let env_setup=Arc::new(services::env_setup::EnvSetupState::new());let model_providers=Arc::new(ModelProviderStore::new());let model_proxy=Arc::new(ModelProxyManager::new(model_providers.clone()));let proxy_app=app.handle().clone();model_proxy.set_event_sink(Arc::new(move|event,payload|{let _=proxy_app.emit(event,payload);}));let event_app=app.handle().clone();let event_sink:services::http_server::EventSink=Arc::new(move|event,payload|{use tauri::Emitter;let _=event_app.emit(event,payload);});let app_state=AppState{identity:identity.clone(),lan_ip:lan_ip.clone(),port:DEFAULT_PORT,agents:Arc::new(RwLock::new(agents.clone())),default_agent:Arc::new(RwLock::new(default_agent.clone())),conversations:conversations.clone(),active_conversation_id:Arc::new(RwLock::new(None)),terminal:terminal.clone(),command_store:command_store.clone(),pairing:pairing.clone(),approval:approval.clone(),model_prefs:model_prefs.clone(),workdir_prefs:workdir_prefs.clone(),app_events:Some(event_sink),exec_lock:Arc::new(tokio::sync::Mutex::new(())),};let core=DesktopCore{state:app_state.clone(),http_port:Arc::new(RwLock::new(DEFAULT_PORT)),mdns_running:Arc::new(RwLock::new(false)),server_handle:Arc::new(RwLock::new(None)),lan_ip:Arc::new(RwLock::new(lan_ip.clone())),terminal:terminal.clone(),runtime_state:Arc::new(std::sync::RwLock::new(RuntimeState::Starting)),env_setup,model_providers:model_providers.clone(),model_proxy:model_proxy.clone(),};let port_handle=core.http_port.clone();let server_handle=core.server_handle.clone();let mdns_flag=core.mdns_running.clone();let runtime_state_handle=core.runtime_state.clone();app.manage(core);if let Some(window)=app.get_webview_window("main"){use tauri::window::Color;let _=window.set_background_color(Some(Color(0xFB,0xF8,0xF4,0xFF)));}let state_for_discovery=app_state.clone();let terminal_for_discovery=terminal.clone();let handle_for_discovery=app.handle().clone();tauri::async_runtime::spawn(async move{let started=std::time::Instant::now();let discovered=tauri::async_runtime::spawn_blocking(services::agent_discovery::discover).await.unwrap_or_default();log::info!("Discovered {} installed agent(s) in {:?}",discovered.iter().filter(|a|a.installed).count(),started.elapsed());let default_agent=discovered.iter().find(|a|a.installed&&a.id=="opencode").or_else(||discovered.iter().find(|a|a.installed)).map(|a|a.id.clone()).unwrap_or_else(||"opencode".to_string());{let mut w=state_for_discovery.agents.write().await;*w=discovered.clone();}{let mut w=state_for_discovery.default_agent.write().await;*w=default_agent;}let term=terminal_for_discovery.clone();let ags=discovered.clone();tauri::async_runtime::spawn(async move{term.init_from_agents(&ags).await;});use tauri::Emitter;let _=handle_for_discovery.emit("refresh-agents",());});let proxy_manager=model_proxy.clone();let proxy_snapshot=model_providers.snapshot();tauri::async_runtime::spawn(async move{let st=proxy_manager.apply(proxy_snapshot.proxy_enabled,proxy_snapshot.proxy_port).await;if let Some(e)=st.error{log::warn!("[ModelProxy] auto-start issue: {e}");}});services::tray::setup_system_tray(app.handle())?;services::tray::update_tray_status(app.handle(),"正在启动…",DEFAULT_PORT,&device_name,&lan_ip);services::tray::update_tray_pairing(app.handle(),app_state.pairing.current_code().as_deref());let state_for_server=app_state.clone();let identity_clone=identity.clone();let device_name_clone=device_name.clone();let lan_ip_clone=lan_ip.clone();let default_agent_clone=default_agent.clone();let handle=app.handle().clone();tauri::async_runtime::spawn(async move{let lan_for_server=if lan_ip_clone!="0.0.0.0"{Some(lan_ip_clone.as_str())}else{None};match services::http_server::start_server(state_for_server.clone(),DEFAULT_PORT,lan_for_server,).await{Ok((bound_port,srv_handle))=>{{let mut p=port_handle.write().await;*p=bound_port;}{let mut h=server_handle.write().await;*h=Some(srv_handle);}let mut mdns=services::mdns_broadcast::MdnsBroadcaster::new();let lan_for_mdns=if lan_ip_clone!="0.0.0.0"{lan_ip_clone.clone()}else{"127.0.0.1".to_string()};let mdns_ok=match mdns.start(bound_port,&identity_clone.device_id,&device_name_clone,&lan_for_mdns,&default_agent_clone,){Ok(())=>{let mut flag=mdns_flag.write().await;*flag=true;log::info!("mDNS broadcasting started");true}Err(e)=>{log::error!("mDNS start failed: {}",e);false}};{let mut state=runtime_state_handle.write().expect("runtime state poisoned");*state=RuntimeState::Online;}services::tray::update_tray_status(&handle,if mdns_ok{"在线"}else{"在线(mDNS 失败)"},bound_port,&device_name_clone,&lan_ip_clone,);let _=handle.emit("runtime-state-changed","online");std::mem::forget(mdns);}Err(e)=>{log::error!("HTTP server failed: {}",e);{let mut state=runtime_state_handle.write().expect("runtime state poisoned");*state=RuntimeState::Offline;}services::tray::update_tray_status(&handle,"启动失败",0,&device_name_clone,"0.0.0.0");let _=handle.emit("runtime-state-changed","offline");}}});log::info!("setup completed in {:?} (agent discovery runs in background)",setup_started.elapsed());Ok(())}).on_window_event(|window,event|{if let tauri::WindowEvent::CloseRequested{api,..}=event{let _=window.hide();api.prevent_close();}}).invoke_handler(tauri::generate_handler![get_status,get_agents,set_default_agent,get_lan_ip,get_port,get_pairing_info,reveal_pairing_code,regenerate_pairing_code,get_approval_mode,set_approval_mode,get_terminal_state,get_active_agent_id,switch_active_agent,send_command,clear_terminal,get_agent_models,set_default_model,get_agent_workdir,set_agent_workdir,browse_roots,browse_folder,list_conversations,get_conversation,rename_conversation,set_conversation_archived,delete_conversation,activate_conversation,toggle_pin_conversation,set_conversation_workdir,set_conversation_approval_mode,set_conversation_model,check_environment,get_node_versions,install_nvm,install_node,installed_node_versions,switch_node_default,install_agent_cli,update_agent_cli,get_model_providers,save_model_provider,delete_model_provider,switch_model_provider,set_model_proxy,set_model_failover,get_cli_takeover,set_cli_takeover,get_provider_catalog,fetch_provider_models,get_opencode_providers,save_opencode_provider,delete_opencode_provider,get_claude_provider,save_claude_provider,delete_claude_provider,get_codex_providers,save_codex_provider,delete_codex_provider,activate_codex_provider,get_pi_providers,save_pi_provider,delete_pi_provider,activate_pi_provider,]).run(tauri::generate_context!())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:1611
`root.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `apply_entry` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:213
`obj.get_mut("env").and_then(Value::as_object_mut)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `apply_entry` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:228
`doc.get_mut("model_providers").and_then(|i|i.as_table_like_mut())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `save_provider_at` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:399
`Regex::new(r"^\d+(\.\d+){0,2}$")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `validate_version_input` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/env_setup.rs:386
`format!("0.0.0.0:{}",port).parse()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `start_server` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:412
`reqwest::Client::builder().connect_timeout(Duration::from_secs(15)).pool_idle_timeout(Duration::from_secs(90)).build()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `http_client` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/model_proxy.rs:82
`self.open_block` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_chunk` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:732, Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:748
`self.tools.get_mut(&openai_idx)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handle_tool_call` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:836
`self.tools.get(&openai_idx)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handle_tool_call` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:870
`root.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `normalize_provider_section` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:259
`obj.get_mut("provider").and_then(Value::as_object_mut)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `normalize_provider_section` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:265
`root.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `providers_mut` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:294
`entry.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `providers_mut` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:306
What to do
Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 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 — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
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.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AX1 Captive dependencies — 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
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
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
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConn…; runtime evidence skipped (launch chosen because Android/app/build.gradle.kts applies the Android application plugin and Android/gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D12 Dependency Hygiene — Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 34 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D16 Bus Factor — single-contributor repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — 479 of 562 comment blocks were not judged (467 in a non-Latin script, 12 in a language other than English): redundancy is judged by word overlap with the code's identifiers, which cannot be measured across languages.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 reads resolved call sites in the languages it reads only — this repository's production source is .kt, .py, .rs, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 6 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — experimental/relay-server/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency; the Swift half could not be measured — the Swift suite in . produced no coverage export. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 36 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Fold determinism — not applicable — the code was read and holds no event-replay fold, so there is nothing for this check to judge
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — 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 `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, 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.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — 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
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — X27 reached only 40% of this repository's production lines — swift (32,574 lines), typescript (10,845 lines), javascript (7 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
Critical — 58 finding(s)
AC2 · Forms & labels· <input> without a programmatic label · ×30
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:247— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:168— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:178— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:191— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:214— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:220— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:210— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:220— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:242— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:273— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:312— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:333— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:942— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1044— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1054— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1077— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1136— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1158— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:220— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:230— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:272— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:282— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:333— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:339— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:235— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
+ 5 more in this group — see findings.md.
AC2 · Forms & labels· <select> without a programmatic label · ×7
<select> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:255— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1009— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1095— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1114— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:257— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:280— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label Sources/BrewPingwinDesktop/src/components/settings/vendor-preset-select.tsx:99— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×2
Click handler on a non-interactive <div> Sources/BrewPingwinDesktop/src/App.tsx:1129— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> Sources/BrewPingwinDesktop/src/App.tsx:1408— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC2 · Forms & labels· Custom control with no accessible name on <div> · ×1
Custom control with no accessible name on <div> Sources/BrewPingwinDesktop/src/App.tsx:1408— This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label Sources/BrewPingwinDesktop/src/components/chat/chat-view.tsx:194— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
R4 · Test Coverage· No test reaches this file · ×31
No test reaches this file Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/BrewPingwinDesktop/src/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 Sources/BrewPingwinDesktop/src/i18n/locales.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 Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.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 Sources/BrewPingwinDesktop/src/api/tauri.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 Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.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 Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.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 Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.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 Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.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 Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.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 Sources/BrewPingwinDesktop/src/components/chat/chat-view.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 Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.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 Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.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 Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.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 Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.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 Sources/BrewPingwinDesktop/src/components/error-boundary.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 Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.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 Sources/BrewPingwinDesktop/src/components/settings/vendor-preset-select.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 Sources/BrewPingwinDesktop/src/components/chat/markdown-renderer.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 Sources/BrewPingwinDesktop/src/components/chat/linkify-plain-urls.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 Sources/BrewPingwinDesktop/src/lib/setup-state.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 Sources/BrewPingwinDesktop/src/i18n/index.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 Sources/BrewPingwinDesktop/src/components/ui/button.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 Sources/BrewPingwinDesktop/src/components/settings/agent-model-tabs.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file Sources/BrewPingwinDesktop/src/components/ui/card.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
FileTooLong: settings/model-config-card.tsx Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx— FileTooLong — 1495 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: ModelConfigCard (176-1899). The bar is 500 significant lines; this is 995 over it, 2.99× 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: BrewPingDesktop/CLIProviderPanels.swift Sources/BrewPingDesktop/CLIProviderPanels.swift— FileTooLong — 1251 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 751 over it, 2.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: BrewPingDesktop/DesktopStrings.swift Sources/BrewPingDesktop/DesktopStrings.swift— FileTooLong — 1247 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: DesktopStrings (431-1268). The bar is 500 significant lines; this is 747 over it, 2.49× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/App.tsx Sources/BrewPingwinDesktop/src/App.tsx— FileTooLong — 1201 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: App (230-1345). The bar is 500 significant lines; this is 701 over it, 2.40× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/lib.rs Sources/BrewPingwinDesktop/src-tauri/src/lib.rs— FileTooLong — 1054 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 67 free functions. The bar is 500 significant lines; this is 554 over it, 2.11× 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: BrewPing/ContentView.swift ios/BrewPing/ContentView.swift— FileTooLong — 1037 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: ContentView (49-1605). The bar is 500 significant lines; this is 537 over it, 2.07× 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: services/http_server.rs Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs— FileTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 298 over it, 1.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/env_setup.rs Sources/BrewPingwinDesktop/src-tauri/src/services/env_setup.rs— FileTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 274 over it, 1.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ui/HomeScreen.kt Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt— FileTooLong — 737 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 237 over it, 1.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: BrewPingDesktop/SetupWizardView.swift Sources/BrewPingDesktop/SetupWizardView.swift— FileTooLong — 702 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: SetupWizardView (14-996). The bar is 500 significant lines; this is 202 over it, 1.40× 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: setup/setup-wizard.tsx Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx— FileTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SetupWizard (118-838). The bar is 500 significant lines; this is 147 over it, 1.29× 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: services/model_transform.rs Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs— FileTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 134 over it, 1.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: api/DesktopApiClient.kt Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt— FileTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: DesktopApiClient (38-892). The bar is 500 significant lines; this is 109 over it, 1.22× 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: BrewPingDesktop/DesktopAppState.swift Sources/BrewPingDesktop/DesktopAppState.swift— FileTooLong — 604 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: DesktopAppState (90-1056). The bar is 500 significant lines; this is 104 over it, 1.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: BrewPing/ConversationDetailView.swift ios/BrewPing/ConversationDetailView.swift— FileTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: ConversationDetailView (11-571). The bar is 500 significant lines; this is 85 over it, 1.17× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: App/HTTPAPI.swift Sources/App/HTTPAPI.swift— FileTooLong — 574 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: HTTPAPI (3-866). The bar is 500 significant lines; this is 74 over it, 1.15× 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: ui/ConversationDetailScreen.kt Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt— FileTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 52 over it, 1.10× 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: BrewPingDesktop/ChatView.swift Sources/BrewPingDesktop/ChatView.swift— FileTooLong — 544 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 44 over it, 1.09× 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: BrewPing/WatchConnectivityManager.swift ios/BrewPing/WatchConnectivityManager.swift— FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: WatchConnectivityManager (7-832). The bar is 500 significant lines; this is 41 over it, 1.08× 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: BrewPingDesktop/ModelProvidersView.swift Sources/BrewPingDesktop/ModelProvidersView.swift— FileTooLong — 506 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ModelProvidersView (16-734). The bar is 500 significant lines; this is 6 over it, 1.01× 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.
Swallowed exception (empty catch) experimental/relay-server/src/websocket/connection.ts:56— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Sources/BrewPingwinDesktop/src/App.tsx:309— 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) Sources/BrewPingwinDesktop/src/App.tsx:318— 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) Sources/BrewPingwinDesktop/src/App.tsx:333— 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) Sources/BrewPingwinDesktop/src/App.tsx:342— 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) Sources/BrewPingwinDesktop/src/App.tsx:389— 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) Sources/BrewPingwinDesktop/src/lib/setup-state.ts:39— 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) Sources/BrewPingwinDesktop/src/lib/setup-state.ts:64— 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) Sources/BrewPingwinDesktop/src/lib/setup-state.ts:83— 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) Sources/BrewPingwinDesktop/src/i18n/index.tsx:40— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) Sources/BrewPingwinDesktop/src/i18n/index.tsx:68— 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) Sources/BrewPingwinDesktop/src/components/error-boundary.tsx:53— `.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) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:173— 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) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:689— 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) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:214— 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) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:317— `.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) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:347— `.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) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:842— `.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) Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:103— 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.
FunctionTooLong: model-config-card.ModelConfigCard Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:176— FunctionTooLong — ModelConfigCard runs 1368 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1268 over it, 13.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: App.App Sources/BrewPingwinDesktop/src/App.tsx:230— FunctionTooLong — App runs 785 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 685 over it, 7.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: setup-wizard.SetupWizard Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:118— FunctionTooLong — SetupWizard runs 580 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 480 over it, 5.80× 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: environment-card.EnvironmentCard Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:48— FunctionTooLong — EnvironmentCard runs 374 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 274 over it, 3.74× 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: opencode-provider-form.OpenCodeProviderForm Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:67— FunctionTooLong — OpenCodeProviderForm runs 275 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pi-provider-form.PiProviderForm Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:93— FunctionTooLong — PiProviderForm runs 255 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: brewping_desktop::run Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:1239— FunctionTooLong — brewping_desktop::run runs 248 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: workdir-picker.WorkdirPicker Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:47— FunctionTooLong — WorkdirPicker runs 243 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 143 over it, 2.43× 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: brewping_desktop::services::command_runner::execute_agent_command Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:226— FunctionTooLong — brewping_desktop::services::command_runner::execute_agent_command runs 234 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 134 over it, 2.34× 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: codex-provider-form.CodexProviderForm Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:84— FunctionTooLong — CodexProviderForm runs 229 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 129 over it, 2.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: App.SettingsView Sources/BrewPingwinDesktop/src/App.tsx:1349— FunctionTooLong — SettingsView runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.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.
FunctionTooLong: claude-provider-form.ClaudeProviderForm Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:65— FunctionTooLong — ClaudeProviderForm runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pi-provider-panel.PiProviderPanel Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:33— FunctionTooLong — PiProviderPanel runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: agent-provider-panel.AgentProviderPanel Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:68— FunctionTooLong — AgentProviderPanel runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codex-provider-panel.CodexProviderPanel Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:21— FunctionTooLong — CodexProviderPanel runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: PTYSession.swift.brewping_forkpty Sources/PTY/PTYSession.swift:4— FunctionTooLong — brewping_forkpty runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.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: opencode-provider-panel.OpenCodeProviderPanel Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:26— FunctionTooLong — OpenCodeProviderPanel runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: App.DirFilterMenu Sources/BrewPingwinDesktop/src/App.tsx:98— FunctionTooLong — DirFilterMenu runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: Sources/BrewPingwinDesktop/src/App.tsx Sources/BrewPingwinDesktop/src/App.tsx:230— Sources/BrewPingwinDesktop/src/App.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in App.App at line 230. 2 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingwinDesktop/src/App.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: ios/BrewPing/ContentView.swift ios/BrewPing/ContentView.swift:131— ios/BrewPing/ContentView.swift changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ContentView.body at line 131. 12 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/BrewPing/ContentView.swift`: 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: ios/BrewPing/DemoBackend.swift ios/BrewPing/DemoBackend.swift:106— ios/BrewPing/DemoBackend.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in DemoBackend.handle at line 106. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/BrewPing/DemoBackend.swift`: 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: Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:176— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 178 in model-config-card.ModelConfigCard at line 176. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingwinDesktop/src/components/settings/model-config-card.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: Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:98— Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in HomeScreenKt.HomeScreen at line 98. 4 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt`: 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: Sources/App/HTTPAPI.swift Sources/App/HTTPAPI.swift:632— Sources/App/HTTPAPI.swift changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in HTTPAPI.commandResponse at line 632. 5 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/App/HTTPAPI.swift`: 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: ios/Watch/WatchSessionManager.swift ios/Watch/WatchSessionManager.swift:568— ios/Watch/WatchSessionManager.swift changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in WatchSessionManager.requestStatusSync at line 568. 6 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/Watch/WatchSessionManager.swift`: 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: ios/BrewPing/WatchConnectivityManager.swift ios/BrewPing/WatchConnectivityManager.swift:224— ios/BrewPing/WatchConnectivityManager.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in WatchConnectivityManager.handleWatchMessage at line 224. 7 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/BrewPing/WatchConnectivityManager.swift`: 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: Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:226— Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in brewping_desktop::services::command_runner::execute_agent_command at line 226. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: ios/BrewPing/CommandReceiver.swift ios/BrewPing/CommandReceiver.swift:531— ios/BrewPing/CommandReceiver.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in CommandSubmitter.poll at line 531. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/BrewPing/CommandReceiver.swift`: 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: Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt:89— Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in ConversationDetailScreenKt.ConversationDetailScreen at line 89. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt`: 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: ios/BrewPing/ConversationStore.swift ios/BrewPing/ConversationStore.swift:187— ios/BrewPing/ConversationStore.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in ConversationStore.refresh at line 187. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/BrewPing/ConversationStore.swift`: 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: Sources/App/BrewPingAgent.swift Sources/App/BrewPingAgent.swift:31— Sources/App/BrewPingAgent.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in BrewPingAgent.run at line 31. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/App/BrewPingAgent.swift`: 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: Sources/App/HTTPServer.swift Sources/App/HTTPServer.swift:301— Sources/App/HTTPServer.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in HTTPServer.parseHead at line 301. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/App/HTTPServer.swift`: 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: Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs:228— Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in brewping_desktop::services::conversation_api::handle_patch_conversation at line 228. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: Sources/BrewPingwinDesktop/src/components/chat/chat-view.tsx Sources/BrewPingwinDesktop/src/components/chat/chat-view.tsx:119— Sources/BrewPingwinDesktop/src/components/chat/chat-view.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in chat-view.ChatView at line 119. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingwinDesktop/src/components/chat/chat-view.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: ios/BrewPing/ModelCatalog.swift ios/BrewPing/ModelCatalog.swift:134— ios/BrewPing/ModelCatalog.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in ModelStore.refresh at line 134. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/BrewPing/ModelCatalog.swift`: 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.
brewping_desktop::services::command_runner::execute_agent_command (cognitive 53) Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:226— brewping_desktop::services::command_runner::execute_agent_command has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (39 pts), match/switch 6 (7 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::model_transform::convert_message (cognitive 48) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:152— brewping_desktop::services::model_transform::convert_message has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (38 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::conversation_api::handle_patch_conversation (cognitive 37) Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs:228— brewping_desktop::services::conversation_api::handle_patch_conversation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (36 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::command_runner::pump_pipe (cognitive 35) Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:93— brewping_desktop::services::command_runner::pump_pipe has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 3 (11 pts), loops 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::model_transform::openai_to_anthropic (cognitive 35) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:393— brewping_desktop::services::model_transform::openai_to_anthropic has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::folder_browser::browse_directory (cognitive 34) Sources/BrewPingwinDesktop/src-tauri/src/services/folder_browser.rs:141— brewping_desktop::services::folder_browser::browse_directory has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 5, match/switch 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::model_transform::anthropic_to_openai (cognitive 34) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:47— brewping_desktop::services::model_transform::anthropic_to_openai has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::model_proxy::proxy_fallback (cognitive 27) Sources/BrewPingwinDesktop/src-tauri/src/services/model_proxy.rs:190— brewping_desktop::services::model_proxy::proxy_fallback has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::model_proxy::attempt_forward (cognitive 26) Sources/BrewPingwinDesktop/src-tauri/src/services/model_proxy.rs:275— brewping_desktop::services::model_proxy::attempt_forward has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
brewping_desktop::services::http_server::handle_decide_approval (cognitive 25) Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:1154— brewping_desktop::services::http_server::handle_decide_approval has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::agent_discovery::extract_version (cognitive 23) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:222— brewping_desktop::services::agent_discovery::extract_version has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::http_server::handle_get_approval (cognitive 18) Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:1101— brewping_desktop::services::http_server::handle_get_approval has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::services::pi_config::save_provider_at (cognitive 18) Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:464— brewping_desktop::services::pi_config::save_provider_at has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::set_conversation_archived (cognitive 16) Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:645— brewping_desktop::set_conversation_archived has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brewping_desktop::run (cognitive 16) Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:1239— brewping_desktop::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
brewping_desktop::services::codex_provider_config::save_provider_at (cognitive 16) Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:337— brewping_desktop::services::codex_provider_config::save_provider_at has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
brewping_desktop::services::model_transform::clean_schema_inner (cognitive 16) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:286— brewping_desktop::services::model_transform::clean_schema_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClassTooLong: ContentView ios/BrewPing/ContentView.swift:49— ClassTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 606 over it, 2.52× 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: DesktopStrings Sources/BrewPingDesktop/DesktopStrings.swift:431— ClassTooLong — 831 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 431 over it, 2.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: App Sources/BrewPingwinDesktop/src/App.tsx:1— ClassTooLong — 785 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 385 over it, 1.96× 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: SetupWizardView Sources/BrewPingDesktop/SetupWizardView.swift:14— ClassTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 300 over it, 1.75× 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: DesktopApiClient Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:38— ClassTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 183 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HTTPAPI Sources/App/HTTPAPI.swift:3— ClassTooLong — 573 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 173 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.
ClassTooLong: DesktopAppState Sources/BrewPingDesktop/DesktopAppState.swift:89— ClassTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 162 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WatchConnectivityManager ios/BrewPing/WatchConnectivityManager.swift:7— ClassTooLong — 507 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 107 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: ModelProvidersView Sources/BrewPingDesktop/ModelProvidersView.swift:16— ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 104 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DemoBackend ios/BrewPing/DemoBackend.swift:17— ClassTooLong — 497 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 97 over it, 1.24× 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: WatchSessionManager ios/Watch/WatchSessionManager.swift:77— ClassTooLong — 446 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 46 over it, 1.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EnvironmentCardView Sources/BrewPingDesktop/EnvironmentCardView.swift:31— ClassTooLong — 438 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 38 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EnvironmentSetup Sources/App/EnvironmentSetup.swift:16— ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 25 over it, 1.06× 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: LKey Sources/BrewPingDesktop/DesktopStrings.swift:12— ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 15 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DemoBackend Android/core/src/main/java/com/brewping/core/demo/DemoBackend.kt:25— ClassTooLong — 410 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 10 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×15
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:1611— `tauri::Builder::default().plugin(tauri_plugin_shell::init()).setup(|app|{let setup_started=std::time::Instant::now();let identity=services::device_identity::load_or_create();let device_name=services::device_identity::get_device_name();let lan_ip=services::lan_address::detect_primary_lan().map(|info|info.ip.to_string()).unwrap_or_else(||"0.0.0.0".to_string());log::info!("Device: {} ({}) on {}",device_name,identity.device_id,lan_ip);let agents:Vec<AgentEntry>=Vec::new();let default_agent="opencode".to_string();let terminal=TerminalManager::new();let command_store=CommandStore::new();let pairing=Arc::new(PairingStore::new());let approval=Arc::new(ApprovalGate::new());let model_prefs=Arc::new(ModelPrefs::new());let workdir_prefs=Arc::new(WorkdirPrefs::new());let conversations=Arc::new(ConversationStore::new());let env_setup=Arc::new(services::env_setup::EnvSetupState::new());let model_providers=Arc::new(ModelProviderStore::new());let model_proxy=Arc::new(ModelProxyManager::new(model_providers.clone()));let proxy_app=app.handle().clone();model_proxy.set_event_sink(Arc::new(move|event,payload|{let _=proxy_app.emit(event,payload);}));let event_app=app.handle().clone();let event_sink:services::http_server::EventSink=Arc::new(move|event,payload|{use tauri::Emitter;let _=event_app.emit(event,payload);});let app_state=AppState{identity:identity.clone(),lan_ip:lan_ip.clone(),port:DEFAULT_PORT,agents:Arc::new(RwLock::new(agents.clone())),default_agent:Arc::new(RwLock::new(default_agent.clone())),conversations:conversations.clone(),active_conversation_id:Arc::new(RwLock::new(None)),terminal:terminal.clone(),command_store:command_store.clone(),pairing:pairing.clone(),approval:approval.clone(),model_prefs:model_prefs.clone(),workdir_prefs:workdir_prefs.clone(),app_events:Some(event_sink),exec_lock:Arc::new(tokio::sync::Mutex::new(())),};let core=DesktopCore{state:app_state.clone(),http_port:Arc::new(RwLock::new(DEFAULT_PORT)),mdns_running:Arc::new(RwLock::new(false)),server_handle:Arc::new(RwLock::new(None)),lan_ip:Arc::new(RwLock::new(lan_ip.clone())),terminal:terminal.clone(),runtime_state:Arc::new(std::sync::RwLock::new(RuntimeState::Starting)),env_setup,model_providers:model_providers.clone(),model_proxy:model_proxy.clone(),};let port_handle=core.http_port.clone();let server_handle=core.server_handle.clone();let mdns_flag=core.mdns_running.clone();let runtime_state_handle=core.runtime_state.clone();app.manage(core);if let Some(window)=app.get_webview_window("main"){use tauri::window::Color;let _=window.set_background_color(Some(Color(0xFB,0xF8,0xF4,0xFF)));}let state_for_discovery=app_state.clone();let terminal_for_discovery=terminal.clone();let handle_for_discovery=app.handle().clone();tauri::async_runtime::spawn(async move{let started=std::time::Instant::now();let discovered=tauri::async_runtime::spawn_blocking(services::agent_discovery::discover).await.unwrap_or_default();log::info!("Discovered {} installed agent(s) in {:?}",discovered.iter().filter(|a|a.installed).count(),started.elapsed());let default_agent=discovered.iter().find(|a|a.installed&&a.id=="opencode").or_else(||discovered.iter().find(|a|a.installed)).map(|a|a.id.clone()).unwrap_or_else(||"opencode".to_string());{let mut w=state_for_discovery.agents.write().await;*w=discovered.clone();}{let mut w=state_for_discovery.default_agent.write().await;*w=default_agent;}let term=terminal_for_discovery.clone();let ags=discovered.clone();tauri::async_runtime::spawn(async move{term.init_from_agents(&ags).await;});use tauri::Emitter;let _=handle_for_discovery.emit("refresh-agents",());});let proxy_manager=model_proxy.clone();let proxy_snapshot=model_providers.snapshot();tauri::async_runtime::spawn(async move{let st=proxy_manager.apply(proxy_snapshot.proxy_enabled,proxy_snapshot.proxy_port).await;if let Some(e)=st.error{log::warn!("[ModelProxy] auto-start issue: {e}");}});services::tray::setup_system_tray(app.handle())?;services::tray::update_tray_status(app.handle(),"正在启动…",DEFAULT_PORT,&device_name,&lan_ip);services::tray::update_tray_pairing(app.handle(),app_state.pairing.current_code().as_deref());let state_for_server=app_state.clone();let identity_clone=identity.clone();let device_name_clone=device_name.clone();let lan_ip_clone=lan_ip.clone();let default_agent_clone=default_agent.clone();let handle=app.handle().clone();tauri::async_runtime::spawn(async move{let lan_for_server=if lan_ip_clone!="0.0.0.0"{Some(lan_ip_clone.as_str())}else{None};match services::http_server::start_server(state_for_server.clone(),DEFAULT_PORT,lan_for_server,).await{Ok((bound_port,srv_handle))=>{{let mut p=port_handle.write().await;*p=bound_port;}{let mut h=server_handle.write().await;*h=Some(srv_handle);}let mut mdns=services::mdns_broadcast::MdnsBroadcaster::new();let lan_for_mdns=if lan_ip_clone!="0.0.0.0"{lan_ip_clone.clone()}else{"127.0.0.1".to_string()};let mdns_ok=match mdns.start(bound_port,&identity_clone.device_id,&device_name_clone,&lan_for_mdns,&default_agent_clone,){Ok(())=>{let mut flag=mdns_flag.write().await;*flag=true;log::info!("mDNS broadcasting started");true}Err(e)=>{log::error!("mDNS start failed: {}",e);false}};{let mut state=runtime_state_handle.write().expect("runtime state poisoned");*state=RuntimeState::Online;}services::tray::update_tray_status(&handle,if mdns_ok{"在线"}else{"在线(mDNS 失败)"},bound_port,&device_name_clone,&lan_ip_clone,);let _=handle.emit("runtime-state-changed","online");std::mem::forget(mdns);}Err(e)=>{log::error!("HTTP server failed: {}",e);{let mut state=runtime_state_handle.write().expect("runtime state poisoned");*state=RuntimeState::Offline;}services::tray::update_tray_status(&handle,"启动失败",0,&device_name_clone,"0.0.0.0");let _=handle.emit("runtime-state-changed","offline");}}});log::info!("setup completed in {:?} (agent discovery runs in background)",setup_started.elapsed());Ok(())}).on_window_event(|window,event|{if let tauri::WindowEvent::CloseRequested{api,..}=event{let _=window.hide();api.prevent_close();}}).invoke_handler(tauri::generate_handler![get_status,get_agents,set_default_agent,get_lan_ip,get_port,get_pairing_info,reveal_pairing_code,regenerate_pairing_code,get_approval_mode,set_approval_mode,get_terminal_state,get_active_agent_id,switch_active_agent,send_command,clear_terminal,get_agent_models,set_default_model,get_agent_workdir,set_agent_workdir,browse_roots,browse_folder,list_conversations,get_conversation,rename_conversation,set_conversation_archived,delete_conversation,activate_conversation,toggle_pin_conversation,set_conversation_workdir,set_conversation_approval_mode,set_conversation_model,check_environment,get_node_versions,install_nvm,install_node,installed_node_versions,switch_node_default,install_agent_cli,update_agent_cli,get_model_providers,save_model_provider,delete_model_provider,switch_model_provider,set_model_proxy,set_model_failover,get_cli_takeover,set_cli_takeover,get_provider_catalog,fetch_provider_models,get_opencode_providers,save_opencode_provider,delete_opencode_provider,get_claude_provider,save_claude_provider,delete_claude_provider,get_codex_providers,save_codex_provider,delete_codex_provider,activate_codex_provider,get_pi_providers,save_pi_provider,delete_pi_provider,activate_pi_provider,]).run(tauri::generate_context!())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `run` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:213— `root.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `apply_entry` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:228— `obj.get_mut("env").and_then(Value::as_object_mut)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `apply_entry` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:399— `doc.get_mut("model_providers").and_then(|i|i.as_table_like_mut())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `save_provider_at` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/env_setup.rs:386— `Regex::new(r"^\d+(\.\d+){0,2}$")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `validate_version_input` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:412— `format!("0.0.0.0:{}",port).parse()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `start_server` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/model_proxy.rs:82— `reqwest::Client::builder().connect_timeout(Duration::from_secs(15)).pool_idle_timeout(Duration::from_secs(90)).build()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `http_client` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:732— `self.open_block` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_chunk` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:748— `self.open_block` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_chunk` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:836— `self.tools.get_mut(&openai_idx)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handle_tool_call` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:870— `self.tools.get(&openai_idx)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handle_tool_call` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:259— `root.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `normalize_provider_section` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:265— `obj.get_mut("provider").and_then(Value::as_object_mut)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `normalize_provider_section` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:294— `root.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `providers_mut` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:306— `entry.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `providers_mut` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Duplicated block (7 lines × 2) Sources/App/DesktopCommands.swift:596— Sources/App/DesktopCommands.swift:596-602 | Sources/BrewPingDesktop/CLIProviderPanels.swift:838-844 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Sources/App/HTTPAPI.swift:479— Sources/App/HTTPAPI.swift:479-485 | Sources/App/HTTPAPI.swift:609-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/HTTPAPI.swift:479` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Sources/BrewPingDesktop/AppLanguage.swift:108— Sources/BrewPingDesktop/AppLanguage.swift:108-114 | Sources/BrewPingDesktop/AppLanguage.swift:118-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Sources/BrewPingDesktop/CLIProviderPanels.swift:601— Sources/BrewPingDesktop/CLIProviderPanels.swift:601-607 | Sources/BrewPingDesktop/CLIProviderPanels.swift:741-747 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) Sources/BrewPingDesktop/EnvironmentCardView.swift:257— Sources/BrewPingDesktop/EnvironmentCardView.swift:257-263 | Sources/BrewPingDesktop/WorkdirPickerView.swift:176-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/EnvironmentCardView.swift:257` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) ios/BrewPing/ConversationListView.swift:36— ios/BrewPing/ConversationListView.swift:36-42 | ios/Watch/ContentView.swift:178-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/ConversationListView.swift:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `8` in one and `6` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) Sources/BrewPingDesktop/DesktopRootView.swift:171— Sources/BrewPingDesktop/DesktopRootView.swift:171-177 | Sources/BrewPingDesktop/MenuBarContentView.swift:102-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:221— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:221-227 | Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:118-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:320— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:320-326 | Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:167-173 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:409— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:409-415 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:190-196 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:417— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:417-423 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:181-187 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Swallowed exception (caught, then discarded) ios/BrewPing/CommandReceiver.swift:705— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) ios/BrewPing/CommandReceiver.swift:722— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) ios/BrewPing/ContentView.swift:1576— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/App/HTTPAPI.swift:761— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Sources/Agents/AgentDiscovery.swift:139— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Android/core/src/main/java/com/brewping/core/store/PairingStore.kt:73— `catch (t: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Android/core/src/main/java/com/brewping/core/store/PairingStore.kt:103— `catch (t: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Android/core/src/main/java/com/brewping/core/store/PairingStore.kt:120— `catch (t: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Android/app/src/main/java/com/brewping/android/ui/QrScanScreen.kt:192— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Android/app/src/main/java/com/brewping/android/ui/QrScanScreen.kt:209— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) Android/app/src/main/java/com/brewping/android/store/DeviceStore.kt:149— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
MethodTooLong: HomeScreenKt.HomeScreen Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:98— MethodTooLong — HomeScreen runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DemoBackend.handle ios/BrewPing/DemoBackend.swift:106— MethodTooLong — handle runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DemoBackend.handle Android/core/src/main/java/com/brewping/core/demo/DemoBackend.kt:143— MethodTooLong — handle runs 200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× 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: FolderBrowserSheetKt.FolderBrowserSheet Android/app/src/main/java/com/brewping/android/ui/FolderBrowserSheet.kt:58— MethodTooLong — FolderBrowserSheet runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× 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: WorkdirPickerView.popup Sources/BrewPingDesktop/WorkdirPickerView.swift:95— MethodTooLong — popup runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FolderBrowserView.browsingList ios/BrewPing/FolderBrowserView.swift:97— MethodTooLong — browsingList runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.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.
MethodTooLong: ConversationListView.body ios/BrewPing/ConversationListView.swift:32— MethodTooLong — body runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ModelProviderFormView.body Sources/BrewPingDesktop/ModelProviderFormView.swift:42— MethodTooLong — body runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (5 lines × 2) Sources/BrewPingDesktop/CLIProviderPanels.swift:27— Sources/BrewPingDesktop/CLIProviderPanels.swift:27-31 | Sources/BrewPingDesktop/ModelProvidersView.swift:722-726 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/CLIProviderPanels.swift:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/BrewPingDesktop/TerminalDockView.swift:121— Sources/BrewPingDesktop/TerminalDockView.swift:121-125 | Sources/BrewPingDesktop/TerminalDockView.swift:140-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) Sources/App/HTTPAPI.swift:434— Sources/App/HTTPAPI.swift:434-438 | Sources/App/HTTPAPI.swift:576-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Sources/App/HTTPAPI.swift:833— Sources/App/HTTPAPI.swift:833-837 | Sources/App/HTTPAPI.swift:849-853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/HTTPAPI.swift:833` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/App/RelayBridge.swift:42— Sources/App/RelayBridge.swift:42-46 | ios/BrewPing/RemoteAccess.swift:141-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/RelayBridge.swift:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:144— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:144-148 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:179-183 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:144` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/cli_takeover.rs:271— Sources/BrewPingwinDesktop/src-tauri/src/services/cli_takeover.rs:271-275 | Sources/BrewPingwinDesktop/src-tauri/src/services/cli_takeover.rs:323-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) tools/verify-cli-config.swift:87— tools/verify-cli-config.swift:87-91 | tools/verify-cli-config.swift:92-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
brewping_desktop::services::command_runner::execute_agent_command (cyclomatic 33) Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:226— brewping_desktop::services::command_runner::execute_agent_command 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.
brewping_desktop::services::model_transform::convert_message (cyclomatic 29) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:152— brewping_desktop::services::model_transform::convert_message 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.
brewping_desktop::services::folder_browser::browse_directory (cyclomatic 22) Sources/BrewPingwinDesktop/src-tauri/src/services/folder_browser.rs:141— brewping_desktop::services::folder_browser::browse_directory 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.
brewping_desktop::services::model_transform::anthropic_to_openai (cyclomatic 22) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:47— brewping_desktop::services::model_transform::anthropic_to_openai 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.
brewping_desktop::services::conversation_api::handle_patch_conversation (cyclomatic 21) Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs:228— brewping_desktop::services::conversation_api::handle_patch_conversation 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.
brewping_desktop::services::model_proxy::attempt_forward (cyclomatic 19) Sources/BrewPingwinDesktop/src-tauri/src/services/model_proxy.rs:275— brewping_desktop::services::model_proxy::attempt_forward 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.
brewping_desktop::services::model_transform::openai_to_anthropic (cyclomatic 19) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:393— brewping_desktop::services::model_transform::openai_to_anthropic 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.
Repeated repair: ios/BrewPing/BonjourDiscovery.swift ios/BrewPing/BonjourDiscovery.swift:360— ios/BrewPing/BonjourDiscovery.swift changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is BonjourDiscovery.handleConnectionState at line 360), 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(ios): 探测连接固定 IPv4 —— 避免 remoteEndpoint 给 IPv6 链路本地地址”; “fix(ios): didResolveAddress 首帧不完整即收尾 —— 58ms 失败的真正修复”; “fix(ios): TestFlight 自动发现三轮取证 —— resolve 生命周期 + PolicyDenied 码 + 影子期 SKIP + 全链路诊断”; “fix(ios): TestFlight 首装自动发现被 UserDefaults 门禁锁死 —— 移除门禁 + 8 秒竞态”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/BrewPing/BonjourDiscovery.swift`: 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: ios/Watch/VoiceCommandView.swift ios/Watch/VoiceCommandView.swift:23— ios/Watch/VoiceCommandView.swift changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is WatchComposer.body at line 23), 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(watch): 刷新时收起上一条命令的失败提示,并去掉重复渲染”; “fix(watch): 清理重写残留的重复属性声明(hasDraft/isCompletedState/inFlight)”; “fix(watch): 麦克风改为透明输入框的视觉层——点击走系统原生聚焦弹键盘(含听写),修复点麦克风无反应”; “fix(watch): 修复点麦克风弹不出键盘——聚焦与渲染条件互锁,改为先渲染输入框再聚焦”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/Watch/VoiceCommandView.swift`: 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: Sources/BrewPingDesktop/SetupWizardView.swift Sources/BrewPingDesktop/SetupWizardView.swift:34— Sources/BrewPingDesktop/SetupWizardView.swift changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is SetupWizardView.body at line 34), 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(mac): 配对成功无反馈 + QR 永久转圈 → 成功态并自动进入主界面”; “fix(mac): 配对 QR 带过期 LAN IP 导致扫码后一直转圈”; “fix(mac): Node 步按场景重构信息层级 —— 已装过旧时「切换」是主操作”; “fix(mac): Node 探测对齐 nvm default + 多版本检测与切换”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingDesktop/SetupWizardView.swift`: 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: Sources/BrewPingDesktop/ChatView.swift Sources/BrewPingDesktop/ChatView.swift:542— Sources/BrewPingDesktop/ChatView.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is RunStatusIndicator.primaryText at line 542), 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(mac): composer 首字母被吞 —— updateNSView 回写前校验 AppKit 无在途编辑”; “fix(mac): 按钮全局补内边距 + 空态问候垂直居中(用户审核反馈,仅 Mac)”; “fix: chat view, root view, theme improvements”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingDesktop/ChatView.swift`: 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: Sources/BrewPingDesktop/CLIProviderPanels.swift Sources/BrewPingDesktop/CLIProviderPanels.swift:1238— Sources/BrewPingDesktop/CLIProviderPanels.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is OpenCodeProviderForm.applyPreset at line 1238), 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(mac): 点 OpenCode tab 不再自动弹出「添加厂商」表单”; “fix(mac): i18n 语言切换实时生效 —— 11 处自建 I18n 实例改为共享 EnvironmentObject”; “fix(mac): 按钮全局补内边距 + 空态问候垂直居中(用户审核反馈,仅 Mac)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingDesktop/CLIProviderPanels.swift`: 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: Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs:359— Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is ApprovalGate::decide at line 359), 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(approval): 审批状态改为原子快照,决定响应回传 conversationId”; “fix: 三端消息链路对齐 + Android 配对/鉴权语义修复”; “fix(windows): 对话级 Agent / 模型 / 授权,窗口按钮不再静默失败”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: ios/Watch/WatchConversationViews.swift ios/Watch/WatchConversationViews.swift:20— ios/Watch/WatchConversationViews.swift 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 8 (its worst body is WatchConversationListView.body at line 20), 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(watch): 刷新时收起上一条命令的失败提示,并去掉重复渲染”; “fix(watch): 对话页自动刷新 —— Mac 已回复但手表停在 loading / 旧转录”; “fix(watch): 咖啡棕底主题+激活自愈+结果兜底截断+目录只取最近一次”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 12:22:23 +08:00' --until='2026-11-10 12:22:23 +08:00' --full-history --no-merges -- ios/Watch/WatchConversationViews.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (9 lines × 2) Sources/BrewPingDesktop/CLIProviderPanels.swift:914— Sources/BrewPingDesktop/CLIProviderPanels.swift:914-922 | Sources/BrewPingDesktop/ModelProviderFormView.swift:224-232 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) Sources/BrewPingDesktop/CLIProviderPanels.swift:1182— Sources/BrewPingDesktop/CLIProviderPanels.swift:1182-1190 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1582-1590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/BrewPingDesktop/CLIProviderPanels.swift:1580` calls `TextField`, `t`, `cliInput` and `Sources/BrewPingDesktop/CLIProviderPanels.swift:1181` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Sources/BrewPingDesktop/WorkdirPickerView.swift:189— Sources/BrewPingDesktop/WorkdirPickerView.swift:189-197 | Sources/BrewPingDesktop/WorkdirPickerView.swift:208-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/WorkdirPickerView.swift:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) ios/BrewPing/ContentView.swift:542— ios/BrewPing/ContentView.swift:542-550 | ios/BrewPing/ContentView.swift:698-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/ContentView.swift:542` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) ios/BrewPing/WatchConnectivityManager.swift:484— ios/BrewPing/WatchConnectivityManager.swift:484-492 | ios/BrewPing/WatchConnectivityManager.swift:556-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/WatchConnectivityManager.swift:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:279— Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:279-287 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:391-399 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/env_setup.rs:599— Sources/BrewPingwinDesktop/src-tauri/src/services/env_setup.rs:599-607 | Sources/BrewPingwinDesktop/src-tauri/src/services/env_setup.rs:680-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/env_setup.rs:599` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) Sources/BrewPingDesktop/SettingsView.swift:357— Sources/BrewPingDesktop/SettingsView.swift:357-364 | Sources/BrewPingDesktop/SetupWizardView.swift:726-733 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) ios/BrewPing/ConversationStore.swift:378— ios/BrewPing/ConversationStore.swift:378-385 | ios/BrewPing/ConversationStore.swift:427-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/ConversationStore.swift:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/BrewPingDesktop/MenuBarContentView.swift:110— Sources/BrewPingDesktop/MenuBarContentView.swift:110-117 | Sources/BrewPingDesktop/SettingsView.swift:279-286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:247— Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:247-254 | Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:295-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:158— Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:158-165 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:179-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:542— Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:542-549 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:741-748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:542` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:728— Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:728-737 | Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:746-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:728` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×6
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×6
Edited copy of a member (10 corresponding lines) Sources/App/RelayBridge.swift:37— Sources/App/RelayBridge.swift:37-46 | ios/BrewPing/RemoteAccess.swift:136-145 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:138— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:138-148 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:174-183 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/BrewPingDesktop/SidebarView.swift:301— Sources/BrewPingDesktop/SidebarView.swift:301-314 | ios/Watch/ContentView.swift:153-162 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) ios/BrewPing/LanguageManager.swift:129— ios/BrewPing/LanguageManager.swift:129-142 | ios/Watch/WatchLanguageManager.swift:57-66 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/BrewPingDesktop/EnvironmentCardView.swift:138— Sources/BrewPingDesktop/EnvironmentCardView.swift:138-147 | Sources/BrewPingDesktop/ModelProviderFormView.swift:290-299 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:861— Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:861-870 | Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:877-886 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×5
Edited copy of a member (8 corresponding lines) Sources/BrewPingDesktop/DesktopAppState.swift:1048— Sources/BrewPingDesktop/DesktopAppState.swift:1048-1055 | ios/BrewPing/LatteTheme.swift:60-69 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) ios/BrewPing/LatteTheme.swift:72— ios/BrewPing/LatteTheme.swift:72-79 | ios/Watch/WatchTheme.swift:85-93 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/App/DesktopCommands.swift:595— Sources/App/DesktopCommands.swift:595-602 | Sources/BrewPingDesktop/CLIProviderPanels.swift:837-844 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/App/ApprovalGate.swift:187— Sources/App/ApprovalGate.swift:187-196 | Sources/App/ApprovalGate.swift:199-206 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/model_prefs.rs:107— Sources/BrewPingwinDesktop/src-tauri/src/services/model_prefs.rs:107-114 | Sources/BrewPingwinDesktop/src-tauri/src/services/workdir_prefs.rs:81-88 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) Sources/App/CLIConfigSupport.swift:73— Sources/App/CLIConfigSupport.swift:73-85 | Sources/App/CLIConfigSupport.swift:100-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/App/CLIConfigSupport.swift:114` calls `appendingPathComponent` and `Sources/App/CLIConfigSupport.swift:86` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) ios/BrewPing/ConversationDetailView.swift:344— ios/BrewPing/ConversationDetailView.swift:344-356 | ios/BrewPing/ConversationDetailView.swift:449-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/ConversationDetailView.swift:344` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) ios/BrewPing/WatchConnectivityManager.swift:358— ios/BrewPing/WatchConnectivityManager.swift:358-370 | ios/BrewPing/WatchConnectivityManager.swift:410-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/WatchConnectivityManager.swift:358` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Sources/BrewPingDesktop/CLIProviderPanels.swift:1239— Sources/BrewPingDesktop/CLIProviderPanels.swift:1239-1251 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1790-1802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:350— Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:350-362 | Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:451-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:350` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/BrewPingDesktop/EnvironmentCardView.swift:342— Sources/BrewPingDesktop/EnvironmentCardView.swift:342-347 | Sources/BrewPingDesktop/SetupWizardView.swift:567-572 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/EnvironmentCardView.swift:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `0` in one and `6` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/BrewPingDesktop/EnvironmentCardView.swift:348` calls `truncationMode` and `Sources/BrewPingDesktop/SetupWizardView.swift:573` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) ios/BrewPing/ContentView.swift:1326— ios/BrewPing/ContentView.swift:1326-1331 | ios/BrewPing/ContentView.swift:1337-1342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/ContentView.swift:1326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ios/BrewPing/ContentView.swift:1343` calls `Text`, `font`, `foregroundStyle` and `ios/BrewPing/ContentView.swift:1332` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Sources/App/RelayBridge.swift:255— Sources/App/RelayBridge.swift:255-260 | ios/BrewPing/RemoteAccess.swift:342-347 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/RelayBridge.swift:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:396— Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:396-401 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:417-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:169— Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:169-174 | Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:101-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
TooManyMethods: DesktopAppState Sources/BrewPingDesktop/DesktopAppState.swift:89— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HomeViewModel Android/app/src/main/java/com/brewping/android/ui/HomeViewModel.kt:30— 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: DesktopApiClient Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:38— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WatchSessionManager ios/Watch/WatchSessionManager.swift:77— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×4
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×4
Edited copy of a member (11 corresponding lines) Sources/App/HTTPServer.swift:35— Sources/App/HTTPServer.swift:35-45 | ios/BrewPing/DemoBackend.swift:515-525 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs:539— Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs:539-554 | Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:634-644 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/BrewPingDesktop/DesktopComponents.swift:18— Sources/BrewPingDesktop/DesktopComponents.swift:18-29 | Sources/BrewPingDesktop/DesktopComponents.swift:65-75 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) Sources/App/CommandStore.swift:91— Sources/App/CommandStore.swift:91-101 | Sources/App/ConversationStore.swift:352-362 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×4
Edited copy of a member (12 corresponding lines) Sources/App/RelayBridge.swift:254— Sources/App/RelayBridge.swift:254-265 | ios/BrewPing/RemoteAccess.swift:341-352 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:958— Sources/BrewPingDesktop/CLIProviderPanels.swift:958-969 | Sources/BrewPingDesktop/EnvironmentCardView.swift:178-189 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:1515— Sources/BrewPingDesktop/CLIProviderPanels.swift:1515-1526 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1700-1712 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Sources/App/AttachService.swift:73— Sources/App/AttachService.swift:73-84 | Sources/PTY/PTYSession.swift:116-129 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Configuration option is read nowhere Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:95— `ClaudeProviderEntry.other_keys` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:83— `CodexProviderEntry.active` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:237— `PairBody.device_name` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:98— `PiProviderEntry.is_default` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) ios/BrewPing/BrewPingHTTP.swift:32— ios/BrewPing/BrewPingHTTP.swift:32-51 | ios/BrewPing/BrewPingHTTP.swift:59-82 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:146— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:146-165 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:239-258 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:475— Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:475-494 | Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:979-1002 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×3
Edited copy of a member (7 corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:1041— Sources/BrewPingDesktop/CLIProviderPanels.swift:1041-1047 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1048-1054 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:829— Sources/BrewPingDesktop/CLIProviderPanels.swift:829-835 | Sources/BrewPingDesktop/ModelProvidersView.swift:710-716 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) Sources/BrewPingDesktop/EnvironmentCardView.swift:448— Sources/BrewPingDesktop/EnvironmentCardView.swift:448-454 | Sources/BrewPingDesktop/ModelProvidersView.swift:346-352 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×3
Edited copy of a member (4 corresponding lines) Sources/App/CommandStore.swift:103— Sources/App/CommandStore.swift:103-106 | Sources/Session/SessionManager.swift:43-46 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs:558— Sources/BrewPingwinDesktop/src-tauri/src/services/approval_gate.rs:558-561 | Sources/BrewPingwinDesktop/src-tauri/src/services/pairing_store.rs:355-358 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/cli_takeover.rs:492— Sources/BrewPingwinDesktop/src-tauri/src/services/cli_takeover.rs:492-495 | Sources/BrewPingwinDesktop/src-tauri/src/services/device_identity.rs:77-80 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (11 lines × 2) Sources/BrewPingDesktop/MarkdownView.swift:55— Sources/BrewPingDesktop/MarkdownView.swift:55-65 | Sources/BrewPingDesktop/MarkdownView.swift:75-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/MarkdownView.swift:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) ios/BrewPing/BrewPingHTTP.swift:41— ios/BrewPing/BrewPingHTTP.swift:41-51 | ios/BrewPing/BrewPingHTTP.swift:72-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/BrewPingHTTP.swift:41` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) ios/BrewPing/DemoBackend.swift:446— ios/BrewPing/DemoBackend.swift:446-456 | ios/BrewPing/DemoBackend.swift:462-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/DemoBackend.swift:446` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) Sources/App/CodexProviderConfig.swift:181— Sources/App/CodexProviderConfig.swift:181-185 | Sources/App/OpenCodeProviderConfig.swift:158-162 | Sources/App/PiProviderConfig.swift:169-175 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/PiProviderConfig.swift:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:236— Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:236-241 | Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:480-484 | Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:987-991 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:485` calls `get` and `Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:241` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:179— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:179-183 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:242-246 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:276-280 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Complex function (anonymous) (cyclomatic 14, cognitive 13) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:89— (anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 14, cognitive 13) Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:405— (anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 14, cognitive 13) Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:125— (anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Focus outline removed inline Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:247— <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 Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:333— <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).
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×2
Edited copy of a member (36 corresponding lines) Sources/Agents/AgentConfigDiscovery.swift:85— Sources/Agents/AgentConfigDiscovery.swift:85-120 | Sources/Agents/AgentConfigDiscovery.swift:258-308 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) ios/BrewPing/WatchConnectivityManager.swift:469— ios/BrewPing/WatchConnectivityManager.swift:469-504 | ios/BrewPing/WatchConnectivityManager.swift:537-572 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) Sources/App/ModelProviderStore.swift:53— Sources/App/ModelProviderStore.swift:53-67 | ios/BrewPing/ConversationStore.swift:42-58 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Sources/BrewPingDesktop/MenuBarContentView.swift:119— Sources/BrewPingDesktop/MenuBarContentView.swift:119-133 | Sources/BrewPingDesktop/SettingsView.swift:294-308 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:1238— Sources/BrewPingDesktop/CLIProviderPanels.swift:1238-1255 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1789-1806 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Sources/App/FolderBrowser.swift:182— Sources/App/FolderBrowser.swift:182-199 | Sources/App/WorkdirPrefs.swift:60-79 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:495— Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:495-527 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:531-554 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) Sources/App/RelayBridge.swift:175— Sources/App/RelayBridge.swift:175-200 | ios/BrewPing/RemoteAccess.swift:237-260 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×2
Edited copy of a member (14 corresponding lines) Sources/App/CLIConfigSupport.swift:47— Sources/App/CLIConfigSupport.swift:47-64 | Sources/App/OpenCodeProviderConfig.swift:214-227 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:113— Sources/BrewPingDesktop/CLIProviderPanels.swift:113-128 | Sources/BrewPingDesktop/SetupWizardView.swift:833-846 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:153— Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:153-169 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:174-190 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) ios/BrewPing/CommandReceiver.swift:733— ios/BrewPing/CommandReceiver.swift:733-749 | ios/BrewPing/CommandReceiver.swift:751-768 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×2
Edited copies of one member (3 members, 7+ corresponding lines) Sources/App/CodexProviderConfig.swift:40— Sources/App/CodexProviderConfig.swift:40-46 | Sources/App/OpenCodeProviderConfig.swift:51-57 | Sources/App/PiProviderConfig.swift:49-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:178— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:178-186 | Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:193-199 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:241-249 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×2
Edited copies of one member (3 members, 8+ corresponding lines) Sources/BrewPingDesktop/AppLanguage.swift:107— Sources/BrewPingDesktop/AppLanguage.swift:107-114 | Sources/BrewPingDesktop/AppLanguage.swift:117-124 | ios/Watch/WatchTheme.swift:85-93 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:728— Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:728-735 | Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:745-752 | Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:762-769 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×2
Edited copy of a member (5 corresponding lines) ios/BrewPing/LanguageManager.swift:156— ios/BrewPing/LanguageManager.swift:156-160 | ios/Watch/WatchLocalized.swift:5-9 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) ios/Watch/WatchAudioRecorder.swift:150— ios/Watch/WatchAudioRecorder.swift:150-154 | ios/Watch/WatchSessionManager.swift:543-548 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×2
Edited copies of one member (4 members, 4+ corresponding lines) Sources/App/ClaudeProviderConfig.swift:103— Sources/App/ClaudeProviderConfig.swift:103-106 | Sources/App/CodexProviderConfig.swift:140-143 | Sources/App/OpenCodeProviderConfig.swift:118-121 | Sources/App/PiProviderConfig.swift:115-118 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:140— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:140-143 | Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:209-212 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:199-202 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:222-225 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (18 lines × 2) Sources/BrewPingDesktop/ChatView.swift:446— Sources/BrewPingDesktop/ChatView.swift:446-463 | Sources/BrewPingDesktop/ChatView.swift:577-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/ChatView.swift:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) Android/app/src/main/java/com/brewping/android/ui/ConversationListScreen.kt:295— Android/app/src/main/java/com/brewping/android/ui/ConversationListScreen.kt:295-312 | Android/app/src/main/java/com/brewping/android/ui/ConversationListScreen.kt:361-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Android/app/src/main/java/com/brewping/android/ui/ConversationListScreen.kt:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) ios/BrewPing/DemoURLProtocol.swift:60— ios/BrewPing/DemoURLProtocol.swift:60-76 | ios/BrewPing/RelayURLProtocol.swift:124-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (17 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:512— Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:512-529 | Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:555-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/command_runner.rs:512` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Sources/BrewPingDesktop/SettingsView.swift:223— Sources/BrewPingDesktop/SettingsView.swift:223-236 | Sources/BrewPingDesktop/SidebarView.swift:415-428 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/SettingsView.swift:223` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:147— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:147-160 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:240-253 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) ios/BrewPing/ContentView.swift:519— ios/BrewPing/ContentView.swift:519-529 | ios/BrewPing/ContentView.swift:614-624 | ios/BrewPing/ContentView.swift:717-727 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/ContentView.swift:519` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:155— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:155-165 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:218-228 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:248-258 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:155` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Sources/BrewPingDesktop/CLIProviderPanels.swift:1293— Sources/BrewPingDesktop/CLIProviderPanels.swift:1293-1298 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1659-1664 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1813-1818 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/CLIProviderPanels.swift:1293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Sources/BrewPingDesktop/CLIProviderPanels.swift:1303— Sources/BrewPingDesktop/CLIProviderPanels.swift:1303-1308 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1672-1677 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1823-1828 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/CLIProviderPanels.swift:1303` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/BrewPingDesktop/CLIProviderPanels.swift:1309` calls `t` and `Sources/BrewPingDesktop/CLIProviderPanels.swift:1678` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–11 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs:80— Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs:80-87 | Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_api.rs:274-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8–11 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/folder_browser.rs:162— Sources/BrewPingwinDesktop/src-tauri/src/services/folder_browser.rs:162-172 | Sources/BrewPingwinDesktop/src-tauri/src/services/folder_browser.rs:278-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/BrewPingwinDesktop/src-tauri/src/services/folder_browser.rs:277` calls `from` and `Sources/BrewPingwinDesktop/src-tauri/src/services/folder_browser.rs:159` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Off the main sequence: BrewPingCore — BrewPingCore: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: :core — :core: abstractness 0.03, instability 0.00, distance 0.97 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Duplicated block (19 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx:55— Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx:55 · Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:69 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (19 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:607— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:607 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:763 — 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 (14 lines × 3 locations) Sources/BrewPingwinDesktop/src/App.tsx:122— Sources/BrewPingwinDesktop/src/App.tsx:122 · Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx:62 · Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:76 — the 3 copies are spread across 3 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 (14 lines × 3 locations) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:446— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:446 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:607 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:763 — all 3 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 (13 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:227— Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:227 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:171 — 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 (13 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1012— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1012 · Sources/BrewPingwinDesktop/src/components/settings/vendor-preset-select.tsx:106 — 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 (10 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:391— Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:391 · Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:449 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (10 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:724— Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:724 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:798 — 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.
Complex function applyPreset (cyclomatic 11, cognitive 12) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:151— applyPreset has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyPreset (cyclomatic 11, cognitive 12) Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:185— applyPreset has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark Sources/BrewPingwinDesktop/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×1
Focus outline removed in CSS without a :focus replacement Sources/BrewPingwinDesktop/src/styles/app.css:157— `*:focus` 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.
model-config-card.ModelConfigCard (cyclomatic 178) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:176— model-config-card.ModelConfigCard has cyclomatic complexity 178 (threshold 15). Of this number, 93 points are the body's own statements and 85 belong to 52 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
App.App (cyclomatic 110) Sources/BrewPingwinDesktop/src/App.tsx:230— App.App has cyclomatic complexity 110 (threshold 15). Of this number, 46 points are the body's own statements and 64 belong to 34 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.
setup-wizard.SetupWizard (cyclomatic 96) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:118— setup-wizard.SetupWizard has cyclomatic complexity 96 (threshold 15). Of this number, 50 points are the body's own statements and 46 belong to 21 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DemoBackend.handle (cyclomatic 80) ios/BrewPing/DemoBackend.swift:106— DemoBackend.handle 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.
DemoBackend.handle (cyclomatic 75) Android/core/src/main/java/com/brewping/core/demo/DemoBackend.kt:143— DemoBackend.handle has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
environment-card.EnvironmentCard (cyclomatic 67) Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:48— environment-card.EnvironmentCard has cyclomatic complexity 67 (threshold 15). Of this number, 33 points are the body's own statements and 34 belong to 11 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HomeScreenKt.HomeScreen (cyclomatic 35) Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:98— HomeScreenKt.HomeScreen 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.
pi-provider-form.PiProviderForm (cyclomatic 34) Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:93— pi-provider-form.PiProviderForm has cyclomatic complexity 34 (threshold 15). Of this number, 18 points are the body's own statements and 16 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
codex-provider-form.CodexProviderForm (cyclomatic 32) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:84— codex-provider-form.CodexProviderForm has cyclomatic complexity 32 (threshold 15). Of this number, 20 points are the body's own statements and 12 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.
opencode-provider-form.OpenCodeProviderForm (cyclomatic 32) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:67— opencode-provider-form.OpenCodeProviderForm has cyclomatic complexity 32 (threshold 15). Of this number, 19 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScreenRenderer.handleCSI (cyclomatic 29) Sources/PTY/ScreenRenderer.swift:119— ScreenRenderer.handleCSI has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ConversationDetailScreenKt.ConversationDetailScreen (cyclomatic 29) Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt:89— ConversationDetailScreenKt.ConversationDetailScreen has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CliTakeover::disable (cyclomatic 29) Sources/BrewPingwinDesktop/src-tauri/src/services/cli_takeover.rs:364— CliTakeover::disable 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.
HTTPAPI.conversationPatchResponse (cyclomatic 27) Sources/App/HTTPAPI.swift:768— HTTPAPI.conversationPatchResponse 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. This is NOT this file's highest cyclomatic complexity: HTTPAPI.handle (cyclomatic 33) 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.
ConversationSettingsSheetKt.ConversationSettingsSheet (cyclomatic 27) Android/app/src/main/java/com/brewping/android/ui/ConversationSettingsSheet.kt:68— ConversationSettingsSheetKt.ConversationSettingsSheet 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.
workdir-picker.WorkdirPicker (cyclomatic 26) Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:47— workdir-picker.WorkdirPicker has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 belong to 8 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HTTPServer.parseHead (cyclomatic 25) Sources/App/HTTPServer.swift:301— HTTPServer.parseHead 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.
MarkdownBlock.parse (cyclomatic 25) Sources/BrewPingDesktop/MarkdownView.swift:223— MarkdownBlock.parse has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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.
WatchSessionManager.requestStatusSync (cyclomatic 25) ios/Watch/WatchSessionManager.swift:568— WatchSessionManager.requestStatusSync 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.
check_localization.find_L_calls (cyclomatic 24) ios/Scripts/check_localization.py:55— check_localization.find_L_calls 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.
BrewPingCLI.cmdStart (cyclomatic 22) Sources/App/BrewPingCLI.swift:62— BrewPingCLI.cmdStart 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.
ContentView.body (cyclomatic 22) ios/BrewPing/ContentView.swift:131— ContentView.body 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.
SseState::parse_chunk (cyclomatic 22) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:673— SseState::parse_chunk 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.
App.SettingsView (cyclomatic 22) Sources/BrewPingwinDesktop/src/App.tsx:1349— App.SettingsView has cyclomatic complexity 22 (threshold 15). Of this number, 20 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.
MarkdownInline.attributed (cyclomatic 21) Sources/BrewPingDesktop/MarkdownView.swift:392— MarkdownInline.attributed has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
CommandSubmitter.poll (cyclomatic 21) ios/BrewPing/CommandReceiver.swift:531— CommandSubmitter.poll 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.
WatchSessionManager.applyContext (cyclomatic 21) ios/Watch/WatchSessionManager.swift:239— WatchSessionManager.applyContext 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.
check_localization.main (cyclomatic 21) ios/Scripts/check_localization.py:122— check_localization.main has cyclomatic complexity 21 (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.
pi-provider-panel.PiProviderPanel (cyclomatic 21) Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:33— pi-provider-panel.PiProviderPanel has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 125). 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.
HTTPAPI.commandResponse (cyclomatic 19) Sources/App/HTTPAPI.swift:632— HTTPAPI.commandResponse 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: HTTPAPI.handle (cyclomatic 33) 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.
ScreenRenderer.handleEscape (cyclomatic 19) Sources/PTY/ScreenRenderer.swift:78— ScreenRenderer.handleEscape 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.
WatchConnectivityManager.handleWatchMessage (cyclomatic 19) ios/BrewPing/WatchConnectivityManager.swift:224— WatchConnectivityManager.handleWatchMessage 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.
claude-provider-form.ClaudeProviderForm (cyclomatic 19) Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:65— claude-provider-form.ClaudeProviderForm has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (applyPreset, a function literal at line 123, a function literal at line 88, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AttachService.run (cyclomatic 18) Sources/App/AttachService.swift:21— AttachService.run 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.
ModelStore.refresh (cyclomatic 18) ios/BrewPing/ModelCatalog.swift:134— ModelStore.refresh 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.
codex-provider-panel.CodexProviderPanel (cyclomatic 18) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:21— codex-provider-panel.CodexProviderPanel has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 89). 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.
BrewPingAgent.run (cyclomatic 17) Sources/App/BrewPingAgent.swift:31— BrewPingAgent.run has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ResponseExtractor.extract (cyclomatic 17) Sources/App/ResponseExtractor.swift:7— ResponseExtractor.extract 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.
ResponseExtractor.fallbackRaw (cyclomatic 17) Sources/App/ResponseExtractor.swift:80— ResponseExtractor.fallbackRaw 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.
ConversationStore.refresh (cyclomatic 17) ios/BrewPing/ConversationStore.swift:187— ConversationStore.refresh 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.
agent-provider-panel.AgentProviderPanel (cyclomatic 17) Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:68— agent-provider-panel.AgentProviderPanel 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 132). 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.
CommandSubmitter.post (cyclomatic 16) ios/BrewPing/CommandReceiver.swift:477— CommandSubmitter.post 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.
FolderBrowserSheetKt.FolderBrowserSheet (cyclomatic 16) Android/app/src/main/java/com/brewping/android/ui/FolderBrowserSheet.kt:58— FolderBrowserSheetKt.FolderBrowserSheet 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.
chat-view.ChatView (cyclomatic 16) Sources/BrewPingwinDesktop/src/components/chat/chat-view.tsx:119— chat-view.ChatView has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, 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-config-card.ModelConfigCard (cognitive 147) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:176— model-config-card.ModelConfigCard has cognitive complexity 147 (threshold 15). Drivers by points: boolean chains 70, if/else 41 (44 pts), ternaries 16 (25 pts), error handling 8 (nesting depth added 12). Of this number, 74 points are the body's own statements and 73 belong to 52 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
App.App (cognitive 130) Sources/BrewPingwinDesktop/src/App.tsx:230— App.App has cognitive complexity 130 (threshold 15). Drivers by points: ternaries 38 (56 pts), boolean chains 35, if/else 26 (28 pts), error handling 9, loops 2 (nesting depth added 20). Of this number, 53 points are the body's own statements and 77 belong to 34 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DemoBackend.handle (cognitive 116) ios/BrewPing/DemoBackend.swift:106— DemoBackend.handle has cognitive complexity 116 (threshold 15). Drivers by points: if/else 47 (79 pts), boolean chains 24, ternaries 4 (12 pts), match/switch 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setup-wizard.SetupWizard (cognitive 111) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:118— setup-wizard.SetupWizard has cognitive complexity 111 (threshold 15). Drivers by points: ternaries 44 (67 pts), boolean chains 27, if/else 11, error handling 5 (6 pts) (nesting depth added 24). Of this number, 68 points are the body's own statements and 43 belong to 21 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DemoBackend.handle (cognitive 107) Android/core/src/main/java/com/brewping/core/demo/DemoBackend.kt:143— DemoBackend.handle has cognitive complexity 107 (threshold 15). Drivers by points: if/else 47 (76 pts), boolean chains 27, loops 1 (2 pts), error handling 1, match/switch 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CliTakeover::disable (cognitive 67) Sources/BrewPingwinDesktop/src-tauri/src/services/cli_takeover.rs:364— CliTakeover::disable has cognitive complexity 67 (threshold 15). Drivers by points: if/else 25 (66 pts), match/switch 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeScreenKt.HomeScreen (cognitive 58) Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:98— HomeScreenKt.HomeScreen has cognitive complexity 58 (threshold 15). Drivers by points: if/else 28 (48 pts), boolean chains 8, match/switch 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_localization.main (cognitive 57) ios/Scripts/check_localization.py:122— check_localization.main has cognitive complexity 57 (threshold 15). Drivers by points: loops 11 (30 pts), if/else 6 (24 pts), boolean chains 2, ternaries 1 (nesting depth added 37). 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.
environment-card.EnvironmentCard (cognitive 54) Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:48— environment-card.EnvironmentCard has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 19 (23 pts), boolean chains 20, if/else 9, error handling 2 (nesting depth added 4). Of this number, 26 points are the body's own statements and 28 belong to 11 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.
ConversationSettingsSheetKt.ConversationSettingsSheet (cognitive 45) Android/app/src/main/java/com/brewping/android/ui/ConversationSettingsSheet.kt:68— ConversationSettingsSheetKt.ConversationSettingsSheet has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (38 pts), boolean chains 6, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandSubmitter.poll (cognitive 43) ios/BrewPing/CommandReceiver.swift:531— CommandSubmitter.poll has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (23 pts), ternaries 3 (12 pts), match/switch 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SseState::parse_chunk (cognitive 43) Sources/BrewPingwinDesktop/src-tauri/src/services/model_transform.rs:673— SseState::parse_chunk has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 2 (7 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkdownBlock.parse (cognitive 42) Sources/BrewPingDesktop/MarkdownView.swift:223— MarkdownBlock.parse has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 6 (16 pts), boolean chains 9 (nesting depth added 18). Of this number, 41 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.
ConversationDetailScreenKt.ConversationDetailScreen (cognitive 41) Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt:89— ConversationDetailScreenKt.ConversationDetailScreen has cognitive complexity 41 (threshold 15). Drivers by points: if/else 36 (37 pts), boolean chains 4 (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.
AttachCLI.streamLoop (cognitive 37) Sources/App/AttachCLI.swift:88— AttachCLI.streamLoop has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pi-provider-form.PiProviderForm (cognitive 37) Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:93— pi-provider-form.PiProviderForm has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 14, if/else 7 (8 pts) (nesting depth added 4). Of this number, 18 points are the body's own statements and 19 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AttachService.run (cognitive 36) Sources/App/AttachService.swift:21— AttachService.run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 2, loops 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.
codex-provider-form.CodexProviderForm (cognitive 36) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:84— codex-provider-form.CodexProviderForm has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 13, if/else 4 (nesting depth added 6). Of this number, 23 points are the body's own statements and 13 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.
BrewPingCLI.cmdStart (cognitive 35) Sources/App/BrewPingCLI.swift:62— BrewPingCLI.cmdStart has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 8, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPServer.parseHead (cognitive 34) Sources/App/HTTPServer.swift:301— HTTPServer.parseHead has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opencode-provider-form.OpenCodeProviderForm (cognitive 34) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:67— opencode-provider-form.OpenCodeProviderForm has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 13, if/else 5 (6 pts) (nesting depth added 4). Of this number, 18 points are the body's own statements and 16 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ScreenRenderer.handleCSI (cognitive 33) Sources/PTY/ScreenRenderer.swift:119— ScreenRenderer.handleCSI has cognitive complexity 33 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 8 (11 pts), boolean chains 7, ternaries 2, match/switch 1 (nesting depth added 11). Of this number, 31 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.
pi-provider-panel.PiProviderPanel (cognitive 33) Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:33— pi-provider-panel.PiProviderPanel has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 9 (24 pts), boolean chains 9 (nesting depth added 15). Most of this is not in the body itself: 7 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 125). 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.
HTTPAPI.conversationPatchResponse (cognitive 32) Sources/App/HTTPAPI.swift:768— HTTPAPI.conversationPatchResponse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 11, error handling 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-provider-panel.CodexProviderPanel (cognitive 31) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:21— codex-provider-panel.CodexProviderPanel has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (24 pts), boolean chains 7 (nesting depth added 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 89). 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.
HTTPAPI.commandResponse (cognitive 30) Sources/App/HTTPAPI.swift:632— HTTPAPI.commandResponse has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 1 (4 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkdownInline.attributed (cognitive 30) Sources/BrewPingDesktop/MarkdownView.swift:392— MarkdownInline.attributed has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 11, loops 1 (nesting depth added 10). Of this number, 29 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.
check_localization.find_L_calls (cognitive 30) ios/Scripts/check_localization.py:55— check_localization.find_L_calls has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenRenderer.handleEscape (cognitive 29) Sources/PTY/ScreenRenderer.swift:78— ScreenRenderer.handleEscape has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, loops 3 (6 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchSessionManager.requestStatusSync (cognitive 29) ios/Watch/WatchSessionManager.swift:568— WatchSessionManager.requestStatusSync has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BrewPingAgent.run (cognitive 28) Sources/App/BrewPingAgent.swift:31— BrewPingAgent.run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2 (4 pts), error handling 3, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResponseExtractor.fallbackRaw (cognitive 27) Sources/App/ResponseExtractor.swift:80— ResponseExtractor.fallbackRaw has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3, 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.
ContentView.body (cognitive 27) ios/BrewPing/ContentView.swift:131— ContentView.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 7 (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.
WatchConnectivityManager.handleWatchMessage (cognitive 26) ios/BrewPing/WatchConnectivityManager.swift:224— WatchConnectivityManager.handleWatchMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResponseExtractor.extract (cognitive 25) Sources/App/ResponseExtractor.swift:7— ResponseExtractor.extract has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, 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.
ProtocolStateService.agentProjections (cognitive 25) Sources/Protocol/ProtocolStateService.swift:73— ProtocolStateService.agentProjections has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchSessionManager.applyContext (cognitive 24) ios/Watch/WatchSessionManager.swift:239— WatchSessionManager.applyContext has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6 (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.
DesktopApiClient.fetchAgentModels (cognitive 24) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:757— DesktopApiClient.fetchAgentModels has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (7 pts), error handling 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 15). 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.
ConversationStore.refresh (cognitive 23) ios/BrewPing/ConversationStore.swift:187— ConversationStore.refresh has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelStore.refresh (cognitive 23) ios/BrewPing/ModelCatalog.swift:134— ModelStore.refresh has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandRunner.watch (cognitive 22) Sources/App/CommandRunner.swift:216— CommandRunner.watch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opencode-provider-panel.OpenCodeProviderPanel (cognitive 22) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:26— opencode-provider-panel.OpenCodeProviderPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 4 (nesting depth added 11). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 90). 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.
EnvironmentSetup.installedNodeVersions (cognitive 21) Sources/App/EnvironmentSetup.swift:210— EnvironmentSetup.installedNodeVersions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContentView.refreshStatus (cognitive 21) ios/BrewPing/ContentView.swift:1465— ContentView.refreshStatus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (5 pts), boolean chains 1, 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.
FolderBrowserSheetKt.FolderBrowserSheet (cognitive 21) Android/app/src/main/java/com/brewping/android/ui/FolderBrowserSheet.kt:58— FolderBrowserSheetKt.FolderBrowserSheet has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CommandSubmitter.post (cognitive 20) ios/BrewPing/CommandReceiver.swift:477— CommandSubmitter.post has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConversationListView.body (cognitive 20) ios/BrewPing/ConversationListView.swift:32— ConversationListView.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WatchConnectivityManager.makeRecognizer (cognitive 20) ios/BrewPing/WatchConnectivityManager.swift:678— WatchConnectivityManager.makeRecognizer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 2 (nesting depth added 6). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (bestMatch). 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.
workdir-picker.WorkdirPicker (cognitive 20) Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:47— workdir-picker.WorkdirPicker has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 6, error handling 2, ternaries 1. Of this number, 11 points are the body's own statements and 9 belong to 8 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AgentConfigDiscovery.discoverPi (cognitive 19) Sources/Agents/AgentConfigDiscovery.swift:258— AgentConfigDiscovery.discoverPi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopCore.refreshStatus (cognitive 19) Sources/App/DesktopCore.swift:189— DesktopCore.refreshStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniTOML.parseValue (cognitive 19) Sources/App/MiniTOML.swift:225— MiniTOML.parseValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelProvidersView.agentPrefCard (cognitive 19) Sources/BrewPingDesktop/ModelProvidersView.swift:477— ModelProvidersView.agentPrefCard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (6 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AttachCLI.run (cognitive 18) Sources/App/AttachCLI.swift:22— AttachCLI.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HTTPAPI.approvalDecideResponse (cognitive 18) Sources/App/HTTPAPI.swift:572— HTTPAPI.approvalDecideResponse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, error handling 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.
ModelProviderStore.save (cognitive 18) Sources/App/ModelProviderStore.swift:215— ModelProviderStore.save has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (8 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.
ContentView.commitDeviceForm (cognitive 18) ios/BrewPing/ContentView.swift:1097— ContentView.commitDeviceForm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 1 (3 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.
WatchConnectivityManager.localeSubtags (cognitive 18) ios/BrewPing/WatchConnectivityManager.swift:722— WatchConnectivityManager.localeSubtags has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, 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.
WearViewModel.refreshInternal (cognitive 18) Android/wear/src/main/java/com/brewping/wear/ui/WearViewModel.kt:130— WearViewModel.refreshInternal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App.SettingsView (cognitive 18) Sources/BrewPingwinDesktop/src/App.tsx:1349— App.SettingsView has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, ternaries 4, if/else 1. 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, 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.
CommandRunner.runHeadless (cognitive 17) Sources/App/CommandRunner.swift:111— CommandRunner.runHeadless has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniTOML.reindex (cognitive 17) Sources/App/MiniTOML.swift:65— MiniTOML.reindex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SetupWizardView.doneStep (cognitive 17) Sources/BrewPingDesktop/SetupWizardView.swift:676— SetupWizardView.doneStep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
SidebarView.conversationRow (cognitive 17) Sources/BrewPingDesktop/SidebarView.swift:223— SidebarView.conversationRow has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5 (6 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.
PTYSession.readLoop (cognitive 17) Sources/PTY/PTYSession.swift:152— PTYSession.readLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandSubmitter.trackApprovalResolution (cognitive 17) ios/BrewPing/CommandReceiver.swift:629— CommandSubmitter.trackApprovalResolution has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent-provider-panel.AgentProviderPanel (cognitive 17) Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:68— agent-provider-panel.AgentProviderPanel has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (7 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 132). 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.
claude-provider-form.ClaudeProviderForm (cognitive 17) Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:65— claude-provider-form.ClaudeProviderForm has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (6 pts), if/else 3 (nesting depth added 1). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (applyPreset, a function literal at line 88, a function literal at line 123, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FolderBrowserView.browsingList (cognitive 16) ios/BrewPing/FolderBrowserView.swift:97— FolderBrowserView.browsingList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DesktopRepository.refreshStatus (cognitive 16) Android/app/src/main/java/com/brewping/android/repository/DesktopRepository.kt:142— DesktopRepository.refreshStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkdownTextKt.splitBlocks (cognitive 16) Android/app/src/main/java/com/brewping/android/ui/MarkdownText.kt:112— MarkdownTextKt.splitBlocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×1
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) ios/Watch/WatchSessionManager.swift:239— ios/Watch/WatchSessionManager.swift:239-292 | ios/Watch/WatchSessionManager.swift:568-616 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) ios/BrewPing/WatchConnectivityManager.swift:353— ios/BrewPing/WatchConnectivityManager.swift:353-399 | ios/BrewPing/WatchConnectivityManager.swift:402-455 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 47+ corresponding lines) · ×1
Edited copies of one member (3 members, 47+ corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:1130— Sources/BrewPingDesktop/CLIProviderPanels.swift:1130-1176 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1528-1574 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1714-1765 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 47 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 39+ corresponding lines) · ×1
Edited copies of one member (3 members, 39+ corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:338— Sources/BrewPingDesktop/CLIProviderPanels.swift:338-376 | Sources/BrewPingDesktop/CLIProviderPanels.swift:597-650 | Sources/BrewPingDesktop/CLIProviderPanels.swift:737-785 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:462— Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:462-525 | Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:510-565 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:309— Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:309-362 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:340-389 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 34+ corresponding lines) · ×1
Edited copies of one member (3 members, 34+ corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:296— Sources/BrewPingDesktop/CLIProviderPanels.swift:296-336 | Sources/BrewPingDesktop/CLIProviderPanels.swift:562-595 | Sources/BrewPingDesktop/CLIProviderPanels.swift:702-735 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:1293— Sources/BrewPingDesktop/CLIProviderPanels.swift:1293-1312 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1659-1680 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1813-1832 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) Sources/BrewPingDesktop/SettingsView.swift:206— Sources/BrewPingDesktop/SettingsView.swift:206-238 | Sources/BrewPingDesktop/SidebarView.swift:398-430 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) Sources/App/UnixSocket.swift:89— Sources/App/UnixSocket.swift:89-109 | Sources/App/UnixSocket.swift:111-132 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) Sources/BrewPingDesktop/SetupWizardView.swift:469— Sources/BrewPingDesktop/SetupWizardView.swift:469-497 | Sources/BrewPingDesktop/SetupWizardView.swift:501-534 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) Sources/App/RelayBridge.swift:143— Sources/App/RelayBridge.swift:143-167 | ios/BrewPing/RemoteAccess.swift:211-235 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:265— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:265-290 | Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:293-318 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:391— Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:391-409 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:411-430 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) ios/Watch/WatchSessionManager.swift:350— ios/Watch/WatchSessionManager.swift:350-372 | ios/Watch/WatchSessionManager.swift:386-411 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:26— Sources/BrewPingDesktop/CLIProviderPanels.swift:26-38 | Sources/BrewPingDesktop/CLIProviderPanels.swift:84-99 | Sources/BrewPingDesktop/ModelProvidersView.swift:720-733 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) ios/Watch/WatchConversationViews.swift:80— ios/Watch/WatchConversationViews.swift:80-93 | ios/Watch/WatchConversationViews.swift:205-217 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×1
Edited copy of a member (9 corresponding lines) Sources/App/ApprovalGate.swift:328— Sources/App/ApprovalGate.swift:328-340 | Sources/App/WorkdirPrefs.swift:81-89 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) Sources/BrewPingDesktop/CLIProviderPanels.swift:1215— Sources/BrewPingDesktop/CLIProviderPanels.swift:1215-1227 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1602-1612 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1768-1778 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:127— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:127-135 | Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:176-184 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:186-194 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:199-207 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:625— Sources/BrewPingwinDesktop/src-tauri/src/services/conversation_store.rs:625-632 | Sources/BrewPingwinDesktop/src-tauri/src/services/model_prefs.rs:116-122 | Sources/BrewPingwinDesktop/src-tauri/src/services/model_provider_store.rs:491-501 | Sources/BrewPingwinDesktop/src-tauri/src/services/workdir_prefs.rs:90-99 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) Sources/BrewPingwinDesktop/src-tauri/src/services/lan_address.rs:16— Sources/BrewPingwinDesktop/src-tauri/src/services/lan_address.rs:16-31 | Sources/BrewPingwinDesktop/src-tauri/src/services/lan_address.rs:69-84 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (1 corresponding lines) · ×1
Edited copy of a member (1 corresponding lines) Sources/App/OpenCodeProviderConfig.swift:31— Sources/App/OpenCodeProviderConfig.swift:31-31 | Sources/App/PiProviderConfig.swift:29-29 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (27–32 lines × 2) ios/Watch/WatchSessionManager.swift:261— ios/Watch/WatchSessionManager.swift:261-292 | ios/Watch/WatchSessionManager.swift:584-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/Watch/WatchSessionManager.swift:261` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 3) Sources/BrewPingDesktop/CLIProviderPanels.swift:349— Sources/BrewPingDesktop/CLIProviderPanels.swift:349-365 | Sources/BrewPingDesktop/CLIProviderPanels.swift:620-636 | Sources/BrewPingDesktop/CLIProviderPanels.swift:760-776 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/CLIProviderPanels.swift:349` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/BrewPingDesktop/CLIProviderPanels.swift:368` calls `keyBadge`, `t` and `Sources/BrewPingDesktop/CLIProviderPanels.swift:779` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) Sources/BrewPingDesktop/CLIProviderPanels.swift:1259— Sources/BrewPingDesktop/CLIProviderPanels.swift:1259-1274 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1634-1649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/CLIProviderPanels.swift:1259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/BrewPingDesktop/CLIProviderPanels.swift:1630` calls `trimmingCharacters` and `Sources/BrewPingDesktop/CLIProviderPanels.swift:1254` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) ios/BrewPing/FolderBrowserStore.swift:115— ios/BrewPing/FolderBrowserStore.swift:115-129 | ios/BrewPing/FolderBrowserStore.swift:172-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/BrewPing/FolderBrowserStore.swift:115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) Sources/App/ConversationStore.swift:368— Sources/App/ConversationStore.swift:368-381 | Sources/App/DesktopCommands.swift:571-583 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) Sources/App/FolderBrowser.swift:184— Sources/App/FolderBrowser.swift:184-193 | Sources/App/WorkdirPrefs.swift:64-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) Sources/App/CommandStore.swift:31— Sources/App/CommandStore.swift:31-39 | Sources/App/ConversationStore.swift:136-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 3) Sources/BrewPingDesktop/CLIProviderPanels.swift:1137— Sources/BrewPingDesktop/CLIProviderPanels.swift:1137-1143 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1535-1541 | Sources/BrewPingDesktop/CLIProviderPanels.swift:1721-1728 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/CLIProviderPanels.swift:1721` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `agentId` to `"opencode"` in one and `"codex"` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) Sources/BrewPingDesktop/ComposerDropdown.swift:101— Sources/BrewPingDesktop/ComposerDropdown.swift:101-111 | Sources/BrewPingDesktop/SettingsView.swift:227-234 | Sources/BrewPingDesktop/SidebarView.swift:419-426 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/ComposerDropdown.swift:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) Sources/BrewPingDesktop/EnvironmentCardView.swift:54— Sources/BrewPingDesktop/EnvironmentCardView.swift:54-60 | Sources/BrewPingDesktop/SettingsView.swift:430-436 | Sources/BrewPingDesktop/SetupWizardView.swift:603-609 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/EnvironmentCardView.swift:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/BrewPingDesktop/EnvironmentCardView.swift:61` calls `loadIfNeeded`, `onReceive`, `publisher` and `Sources/BrewPingDesktop/SettingsView.swift:437` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5–7 lines × 2) Sources/BrewPingDesktop/CLIProviderPanels.swift:86— Sources/BrewPingDesktop/CLIProviderPanels.swift:86-92 | Sources/BrewPingDesktop/CLIProviderPanels.swift:103-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingDesktop/CLIProviderPanels.swift:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–13 lines × 3) Sources/App/UnixSocket.swift:19— Sources/App/UnixSocket.swift:19-27 | Sources/App/UnixSocket.swift:92-104 | Sources/App/UnixSocket.swift:115-126 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/App/UnixSocket.swift:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Sources/App/UnixSocket.swift:114` calls `close` and `Sources/App/UnixSocket.swift:91` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:152— Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:152-163 | Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:422-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–9 lines × 2) Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:140— Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:140-148 | Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:414-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Android/app/src/main/java/com/brewping/android/ui/HomeScreen.kt:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–5 lines × 3) Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:534— Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:534-538 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:606-610 | Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:732-734 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Android/core/src/main/java/com/brewping/core/api/DesktopApiClient.kt:534` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:470— Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:470-497 | Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:524-551 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20–22 lines × 3) Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:114— Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:114-133 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:118-139 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:133-152 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:136` calls `is_reserved_provider_key`, `contains` and `Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:145` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 3) Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:142— Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:142-162 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:146-166 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:156-176 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:267— Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:267-288 | Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:295-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Sources/BrewPingwinDesktop/src-tauri/src/services/agent_discovery.rs:267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:477— Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:477-488 | Sources/BrewPingwinDesktop/src-tauri/src/services/http_server.rs:985-995 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:438— Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:438-447 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:471-478 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:167— Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:167-176 | Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs:230-239 | Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs:227-236 — before extracting anything, compare `Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs` and `Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Low cohesion: WatchConnectivityManager (LCOM4 4) ios/BrewPing/WatchConnectivityManager.swift:7— WatchConnectivityManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Coverage not measured — JavaScript/TypeScript and Swift suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — experimental/relay-server/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency; the Swift half could not be measured — the Swift suite in . produced no coverage export. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
R10 · Code Duplication· Duplicated block with local edits (202 matched lines × 2 locations) · ×1
Duplicated block with local edits (202 matched lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:80— Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:80 · Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:63 — the two spans are one implementation copied and then locally edited — 1244 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 (185 matched lines × 2 locations) · ×1
Duplicated block with local edits (185 matched lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:28— Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:28 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:29 — the two spans are one implementation copied and then locally edited — 1167 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 (107 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:74— Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:74 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:110 — 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 (97 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:177— Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:177 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:202 — 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) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:107— Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:107 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.tsx:175 — 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 (36 lines × 3 locations) Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:142— Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:142 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:183 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:208 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (35 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1557— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1557 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1625 — 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 (32 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:256— Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:256 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:372 — 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 (18 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:330— Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:330 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:327 — 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 (17 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1670— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1670 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1759 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (16 lines × 3 locations) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:28— Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:28 · Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:33 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:34 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (15 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1390— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1390 · Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1590 — 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 (14 lines × 5 locations) Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:309— Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:309 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx:47 · Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx:47 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:313 · +1 more site(s) not listed — the 5 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (13 lines × 4 locations) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:382— Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:382 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:561 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:645 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:714 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 2 locations) Sources/BrewPingwinDesktop/src/api/tauri.ts:188— Sources/BrewPingwinDesktop/src/api/tauri.ts:188 · Sources/BrewPingwinDesktop/src/api/tauri.ts:208 — 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 (11 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:112— Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:112 · Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:307 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:404— Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:404 · Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:421 — 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 (8 lines × 3 locations) Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:86— Sources/BrewPingwinDesktop/src/components/settings/claude-provider-form.tsx:86 · Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:134 · Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:136 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (7 lines × 2 locations) Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:240— Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:240 · Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:248 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 4 locations) Sources/BrewPingwinDesktop/src/components/ui/card.tsx:6— Sources/BrewPingwinDesktop/src/components/ui/card.tsx:6 · Sources/BrewPingwinDesktop/src/components/ui/card.tsx:17 · Sources/BrewPingwinDesktop/src/components/ui/card.tsx:24 · Sources/BrewPingwinDesktop/src/components/ui/card.tsx:35 — all 4 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (5 lines × 2 locations) Sources/BrewPingwinDesktop/src/App.tsx:91— Sources/BrewPingwinDesktop/src/App.tsx:91 · Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:41 — 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.
Complex function ModelConfigCard (cyclomatic 96, cognitive 87) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:176— ModelConfigCard has cyclomatic complexity 96 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 App (cyclomatic 67, cognitive 64) Sources/BrewPingwinDesktop/src/App.tsx:230— App has cyclomatic complexity 67 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 SetupWizard (cyclomatic 50, cognitive 49) Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:118— SetupWizard has cyclomatic complexity 50 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 EnvironmentCard (cyclomatic 32, cognitive 27) Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:48— EnvironmentCard has cyclomatic complexity 32 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 SettingsView (cyclomatic 21, cognitive 20) Sources/BrewPingwinDesktop/src/App.tsx:1349— SettingsView has cyclomatic complexity 21 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 CodexProviderForm (cyclomatic 21, cognitive 18) Sources/BrewPingwinDesktop/src/components/settings/codex-provider-form.tsx:84— CodexProviderForm has cyclomatic complexity 21 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 OpenCodeProviderForm (cyclomatic 20, cognitive 16) Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-form.tsx:67— OpenCodeProviderForm has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function PiProviderForm (cyclomatic 19, cognitive 16) Sources/BrewPingwinDesktop/src/components/settings/pi-provider-form.tsx:93— PiProviderForm has cyclomatic complexity 19 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function WorkdirPicker (cyclomatic 18, cognitive 16) Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.tsx:47— WorkdirPicker has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 17, cognitive 15) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1780— (anonymous) has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 15, cognitive 14) Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:132— (anonymous) has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 11, cognitive 9) Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1691— (anonymous) has cyclomatic complexity 11 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx · ×1
Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx: 1799 lines of code Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx:1— Sources/BrewPingwinDesktop/src/components/settings/model-config-card.tsx has 1799 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· Sources/BrewPingwinDesktop/src/App.tsx · ×1
Sources/BrewPingwinDesktop/src/App.tsx: 1521 lines of code Sources/BrewPingwinDesktop/src/App.tsx:1— Sources/BrewPingwinDesktop/src/App.tsx has 1521 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· Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx · ×1
Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx: 789 lines of code Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx:1— Sources/BrewPingwinDesktop/src/components/setup/setup-wizard.tsx has 789 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· Sources/BrewPingwinDesktop/src/api/tauri.ts · ×1
Sources/BrewPingwinDesktop/src/api/tauri.ts: 480 lines of code Sources/BrewPingwinDesktop/src/api/tauri.ts:1— Sources/BrewPingwinDesktop/src/api/tauri.ts has 480 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· Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx · ×1
Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx: 473 lines of code Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:1— Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx has 473 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 (~42 LoC) Sources/BrewPingwinDesktop/src/components/ui/card.tsx— no import path from any entry point (2 application, 3 tooling, 1 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@tauri-apps/plugin-shell' Sources/BrewPingwinDesktop/package.json:16— Declared in Sources/BrewPingwinDesktop/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'katex' Sources/BrewPingwinDesktop/package.json:19— Declared in Sources/BrewPingwinDesktop/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.
X18 · Disposal-pattern correctness· Owned value's release suppressed and never restored · ×1
Owned value's release suppressed and never restored Sources/BrewPingwinDesktop/src-tauri/src/lib.rs:1512— `std::mem::forget(mdns)` (line 1512) takes `mdns` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
Duplicated predicate Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx:209— `confirmId === p.id && t("mp.confirmDelete")` appears character-identically in 4 files — Sources/BrewPingwinDesktop/src/components/settings/agent-provider-panel.tsx, Sources/BrewPingwinDesktop/src/components/settings/codex-provider-panel.tsx, Sources/BrewPingwinDesktop/src/components/settings/opencode-provider-panel.tsx, Sources/BrewPingwinDesktop/src/components/settings/pi-provider-panel.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 Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx:62— `rootRef.current && !rootRef.current.contains(e.target as Node)` appears character-identically in 2 files — Sources/BrewPingwinDesktop/src/components/chat/composer-dropdown.tsx, Sources/BrewPingwinDesktop/src/components/chat/workdir-picker.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 Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:123— `b.is_ascii_lowercase() || b.is_ascii_digit() || b == b'-'` appears character-identically in 3 files — Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs:344— `base.starts_with("http://") || base.starts_with("https://")` appears character-identically in 4 files — Sources/BrewPingwinDesktop/src-tauri/src/services/claude_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:118— `bytes[0] == b'-' || bytes[bytes.len() - 1] == b'-'` appears character-identically in 3 files — Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs:146— `c.is_ascii_lowercase() || c.is_ascii_digit()` appears character-identically in 3 files — Sources/BrewPingwinDesktop/src-tauri/src/services/codex_provider_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/opencode_config.rs, Sources/BrewPingwinDesktop/src-tauri/src/services/pi_config.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Sources/App/ClaudeProviderConfig.swift:145— `base.hasPrefix("http://") || base.hasPrefix("https://")` appears character-identically in 4 files — Sources/App/ClaudeProviderConfig.swift, Sources/App/CodexProviderConfig.swift, Sources/App/OpenCodeProviderConfig.swift, Sources/App/PiProviderConfig.swift. 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 Sources/BrewPingDesktop/CLIProviderPanels.swift:929— `message.contains("401") || message.contains("403")` appears character-identically in 2 files — Sources/BrewPingDesktop/CLIProviderPanels.swift, Sources/BrewPingDesktop/ModelProviderFormView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default on Err Sources/BrewPingwinDesktop/src-tauri/src/services/agent_config.rs:120— `config_version_for` turns every `Err` into `"-".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err Sources/BrewPingwinDesktop/src-tauri/src/services/device_identity.rs:93— `get_device_name` turns every `Err` into `"BrewPing".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err Sources/BrewPingwinDesktop/src-tauri/src/services/model_list.rs:10— `parse_openai_models` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err Sources/BrewPingwinDesktop/src-tauri/src/services/model_provider_store.rs:484— `load` turns every `Err` into `Stored::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err Sources/BrewPingwinDesktop/src-tauri/src/services/workdir_prefs.rs:82— `load` turns every `Err` into `HashMap::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×2
Projects may be oversized for their cohesion Package.swift:1— `(repository root)` (22159 LoC, 261 module-visible types across 10 directories) overshoots its size bounds. 2 of 8 build unit(s) (Cargo, Gradle, SwiftPM, Xcode, npm) overshoot their size bounds, lowering Project Cohesion to 5.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion Sources/BrewPingwinDesktop/src-tauri/Cargo.toml:1— `Sources/BrewPingwinDesktop/src-tauri` (19978 LoC, 122 module-visible types across 2 directories) overshoots its size bounds. 2 of 8 build unit(s) (Cargo, Gradle, SwiftPM, Xcode, npm) overshoot their size bounds, lowering Project Cohesion to 5.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
No ADRs found Package.swift:18— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `Package.swift` makes this repository a deployable product (line 18).
D21 · Naming Consistency· `additionalPATHEntries` spells `PATH` where 40 names in the project spell it `Path` · ×1
`additionalPATHEntries` spells `PATH` where 40 names in the project spell it `Path` Sources/Agents/AgentDiscovery.swift:81— 40 of 41 names in project Agents spell the token `Path` (40 of 41; unit: names in project Agents containing `Path`). Peers: SystemCommand.run(executablePath) (Sources/Agents/AgentDiscovery.swift:81); HeadlessCLIAgent.executablePath (Sources/Agents/HeadlessCLIAgent.swift:97); OpenCodeAgent.defaultPath (Sources/Agents/OpenCodeAgent.swift:4); OpenCodeAgent.resolveExecutablePath (Sources/Agents/OpenCodeAgent.swift:45); ClaudeConfigStore.resolveConfigPath (Sources/App/ClaudeProviderConfig.swift:103). Rename to `additionalPathEntries`. [rule N6]
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 3/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
No SAST REDACTED:6— No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 2 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.
P3 · Security & performance tooling· Dependabot does not watch npm/cargo/gradle · ×1
Dependabot does not watch npm/cargo/gradle REDACTED:2— `REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, `cargo`, `gradle`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
No release approval gate REDACTED:86— The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
R7 · Dead Code· Unused export 'StatusResponse' · ×1
Unused export 'StatusResponse' experimental/relay-server/src/types/message.ts:62— Nothing imports this binding — it is safe to review for removal.
Unused export 'AuthResult' experimental/relay-server/src/utils/auth.ts:18— Nothing imports this binding — it is safe to review for removal.
X7 · Silent fallback defaults· Pending state with no failure state · ×1
Pending state with no failure state Sources/BrewPingwinDesktop/src/components/settings/environment-card.tsx:208— The view draws `<Loader2 size= class="animate-spin"/>` under `checking`, but `checking` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
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) — `Android/app/src/main/java/com/brewping/android/ui/ConversationDetailScreen.kt`, `Android/app/src/main/java/com/brewping/android/ui/HelpScreen.kt`, `Sources/App/AttachCLI.swift`, `Sources/App/DangerPattern.swift`, `Sources/PTY/PTYSession.swift`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e626-8e8b-726b-9464-918a9ed4f1a1 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 58 · Warnings: 548 · Recommendations: 29 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 20:57 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.