Public report of block/buzz, published 27 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). 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, 27 October 2026, 00:51 UTC · Survey ID cd_734a676d7bea4097945edd436a26ebf7
block/buzz
Measured 27 October 2026, 00:42 UTC, at code version 8216db1
No regression since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAt riskDown 6 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 1,034,872 lines of product code in 44 projects, tests not counted · Estimated rebuild effort: about 9.5 person-years · Weakest lens: Architecture, 36
Findings by how serious they are
90 critical4394 serious150 minor
16 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 00:42 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
97of 97 dimensions measured by tools.
4598of 4634 findings point to an exact file and line, so you can open each one in the code. The other 36 concern the repository as a whole, such as missing documentation.
97dimensions across 8 lenses, read from 1,034,872 lines of product code in 44 projects.
block/buzz is rated At risk because critical security findings are open. Its score is held back in part because it has loops of files that import each other. It scores 48 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Architecture, at 36, is the weakest lens and counts most in the score. The best first steps are respecting the front end's boundaries and breaking the import cycles, each worth about 6 points. Raising Architecture to 67 would lift the score to about 57.
Twenty-one passwords or keys in the code and two in the code's history are open to anyone who can read the repository. Twelve known security holes in the packages the code depends on can be used by attackers, and ten weaknesses in the code could be used by an attacker. Replacing each exposed password or key, updating the vulnerable packages and fixing the weaknesses the scanner points to would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and the three unsafe settings in infrastructure or container files need changing to safe values. The 19 form fields without a label need a label.
The product code is 1,034,872 lines, about €1,400,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 Architecture rose from 36 to 67, the lowest score rated Strong, the score would rise from 48 to about 57.
Code composition: what the lines of code are
Product code 75%Tests 25%
New since the last survey: 471 findings
These 471 critical or serious findings weren't in the previous survey, on 13 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 2327 findings
These 2327 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one. The first 100 are listed here.
€460,000 to €2,300,000, for 7,687 to 24,386 hours of work, about 9.5 person-years for 5 to 19 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 48. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 1,034,872 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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1120 rows); import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (5 rows).
Raises the score by about 6 points · Medium effort · Import Boundaries
2
Break each cycle by extracting the shared piece into a module both sides can import.
Raises the score by about 6 points · Medium effort · Circular Imports
3
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
Raises the score by about 5 points · Medium effort · Slice cohesion
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €1,400,000 to build again, about 9.5 person-years of work. Its weakest lens is Architecture, at 36 (Weak). Architecture is about whether the structure holds up as the product grows, and when the structure is weak, a change in one place ripples into many others. Because the weakest lens counts most in the score, work on Architecture also moves the score most.
Based on: the rebuild estimate · the Architecture grade · how much each lens counts
What to do: Start with the Architecture actions in Top priorities.
If you do one thing first · First action
Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1120 rows); import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (5 rows). Of all the actions in this report, it raises the score most for the work it takes: about 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.4 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 1,265,764 lines over the last 90 days, which is about 5,133,376 lines a year. At that pace, the extra work comes to an estimated 513.6 to 3081.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, 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.
1220 modules, with 1738 dependencies between them. 18 loops run through 78 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1180 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.
buzz_backend_kubernetes.wire uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_backend_kubernetes.wire, while a change to buzz_backend_kubernetes.wire can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_backend_kubernetes.wire uses a module listed above it, which is the healthy direction.
buzz_core.private_managed_agent uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_core.private_managed_agent, while a change to buzz_core.private_managed_agent can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_core.private_managed_agent uses a module listed above it, which is the healthy direction.
buzz_db.runtime.admitted_tx uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_db.runtime.admitted_tx, while a change to buzz_db.runtime.admitted_tx can't break buzz_core.tenant.
Position
Below the diagonal: buzz_db.runtime.admitted_tx uses a module listed above it, which is the healthy direction.
buzz_media.storage uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_media.storage, while a change to buzz_media.storage can't break buzz_core.tenant.
Position
Below the diagonal: buzz_media.storage uses a module listed above it, which is the healthy direction.
buzz_media.storage uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_media.storage, while a change to buzz_media.storage can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_media.storage uses a module listed above it, which is the healthy direction.
desktop.src.features.agents.ui uses desktop.src.shared.api.types, so a change to desktop.src.shared.api.types can break desktop.src.features.agents.ui, while a change to desktop.src.features.agents.ui can't break desktop.src.shared.api.types.
Position
Below the diagonal: desktop.src.features.agents.ui uses a module listed above it, which is the healthy direction.
desktop.src.features.messages.lib uses desktop.src.shared.api.types, so a change to desktop.src.shared.api.types can break desktop.src.features.messages.lib, while a change to desktop.src.features.messages.lib can't break desktop.src.shared.api.types.
Position
Below the diagonal: desktop.src.features.messages.lib uses a module listed above it, which is the healthy direction.
buzz_acp.relay uses buzz_acp.config, so a change to buzz_acp.config can break buzz_acp.relay, while a change to buzz_acp.relay can't break buzz_acp.config.
Position
Below the diagonal: buzz_acp.relay uses a module listed above it, which is the healthy direction.
buzz_acp.relay uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_acp.relay, while a change to buzz_acp.relay can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_acp.relay uses a module listed above it, which is the healthy direction.
buzz_acp.relay uses buzz_core.private_managed_agent, so a change to buzz_core.private_managed_agent can break buzz_acp.relay, while a change to buzz_acp.relay can't break buzz_core.private_managed_agent.
Position
Below the diagonal: buzz_acp.relay uses a module listed above it, which is the healthy direction.
buzz_agent.types uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_agent.types, while a change to buzz_agent.types can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_agent.types uses a module listed above it, which is the healthy direction.
buzz_agent.types uses buzz_core.private_managed_agent, so a change to buzz_core.private_managed_agent can break buzz_agent.types, while a change to buzz_agent.types can't break buzz_core.private_managed_agent.
Position
Below the diagonal: buzz_agent.types uses a module listed above it, which is the healthy direction.
buzz_cli.client uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_cli.client, while a change to buzz_cli.client can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_cli.client uses a module listed above it, which is the healthy direction.
buzz_cli.client uses buzz_backend_kubernetes.wire, so a change to buzz_backend_kubernetes.wire can break buzz_cli.client, while a change to buzz_cli.client can't break buzz_backend_kubernetes.wire.
Position
Below the diagonal: buzz_cli.client uses a module listed above it, which is the healthy direction.
buzz_db.store.channel uses buzz_core.event, so a change to buzz_core.event can break buzz_db.store.channel, while a change to buzz_db.store.channel can't break buzz_core.event.
Position
Below the diagonal: buzz_db.store.channel uses a module listed above it, which is the healthy direction.
buzz_db.store.channel uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_db.store.channel, while a change to buzz_db.store.channel can't break buzz_core.tenant.
Position
Below the diagonal: buzz_db.store.channel uses a module listed above it, which is the healthy direction.
buzz_db.store.channel uses buzz_cli, so a change to buzz_cli can break buzz_db.store.channel, while a change to buzz_db.store.channel can't break buzz_cli.
Position
Below the diagonal: buzz_db.store.channel uses a module listed above it, which is the healthy direction.
buzz_db.store.channel uses buzz_db.runtime.admitted_tx, so a change to buzz_db.runtime.admitted_tx can break buzz_db.store.channel, while a change to buzz_db.store.channel can't break buzz_db.runtime.admitted_tx.
Position
Below the diagonal: buzz_db.store.channel uses a module listed above it, which is the healthy direction.
buzz_push_gateway.http uses buzz_backend_kubernetes.wire, so a change to buzz_backend_kubernetes.wire can break buzz_push_gateway.http, while a change to buzz_push_gateway.http can't break buzz_backend_kubernetes.wire.
Position
Below the diagonal: buzz_push_gateway.http uses a module listed above it, which is the healthy direction.
buzz_push_gateway.http uses buzz_core.private_managed_agent, so a change to buzz_core.private_managed_agent can break buzz_push_gateway.http, while a change to buzz_push_gateway.http can't break buzz_core.private_managed_agent.
Position
Below the diagonal: buzz_push_gateway.http uses a module listed above it, which is the healthy direction.
buzz_acp.pool uses buzz_acp.config, so a change to buzz_acp.config can break buzz_acp.pool, while a change to buzz_acp.pool can't break buzz_acp.config.
Position
Below the diagonal: buzz_acp.pool uses a module listed above it, which is the healthy direction.
buzz_acp.pool uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_acp.pool, while a change to buzz_acp.pool can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_acp.pool uses a module listed above it, which is the healthy direction.
buzz_agent uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_agent, while a change to buzz_agent can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_agent uses a module listed above it, which is the healthy direction.
buzz_db.runtime uses buzz_agent.databricks_test_support, so a change to buzz_agent.databricks_test_support can break buzz_db.runtime, while a change to buzz_db.runtime can't break buzz_agent.databricks_test_support.
Position
Below the diagonal: buzz_db.runtime uses a module listed above it, which is the healthy direction.
buzz_db.runtime uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_db.runtime, while a change to buzz_db.runtime can't break buzz_core.tenant.
Position
Below the diagonal: buzz_db.runtime uses a module listed above it, which is the healthy direction.
buzz_db.runtime uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_db.runtime, while a change to buzz_db.runtime can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_db.runtime uses a module listed above it, which is the healthy direction.
buzz_db.runtime uses buzz_db.runtime.admitted_tx, so a change to buzz_db.runtime.admitted_tx can break buzz_db.runtime, while a change to buzz_db.runtime can't break buzz_db.runtime.admitted_tx.
Position
Below the diagonal: buzz_db.runtime uses a module listed above it, which is the healthy direction.
buzz_db.runtime uses buzz_db.store.channel, so a change to buzz_db.store.channel can break buzz_db.runtime, while a change to buzz_db.runtime can't break buzz_db.store.channel.
Position
Below the diagonal: buzz_db.runtime uses a module listed above it, which is the healthy direction.
buzz_relay.api.bridge uses buzz_core.event, so a change to buzz_core.event can break buzz_relay.api.bridge, while a change to buzz_relay.api.bridge can't break buzz_core.event.
Position
Below the diagonal: buzz_relay.api.bridge uses a module listed above it, which is the healthy direction.
buzz_relay.api.bridge uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_relay.api.bridge, while a change to buzz_relay.api.bridge can't break buzz_core.tenant.
Position
Below the diagonal: buzz_relay.api.bridge uses a module listed above it, which is the healthy direction.
buzz_relay.api.bridge uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_relay.api.bridge, while a change to buzz_relay.api.bridge can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_relay.api.bridge uses a module listed above it, which is the healthy direction.
buzz_relay.api.bridge uses buzz_backend_kubernetes.wire, so a change to buzz_backend_kubernetes.wire can break buzz_relay.api.bridge, while a change to buzz_relay.api.bridge can't break buzz_backend_kubernetes.wire.
Position
Below the diagonal: buzz_relay.api.bridge uses a module listed above it, which is the healthy direction.
buzz_relay.api.bridge uses buzz_core.private_managed_agent, so a change to buzz_core.private_managed_agent can break buzz_relay.api.bridge, while a change to buzz_relay.api.bridge can't break buzz_core.private_managed_agent.
Position
Below the diagonal: buzz_relay.api.bridge uses a module listed above it, which is the healthy direction.
buzz_relay.api.bridge uses buzz_push_gateway.http, so a change to buzz_push_gateway.http can break buzz_relay.api.bridge, while a change to buzz_relay.api.bridge can't break buzz_push_gateway.http.
Position
Below the diagonal: buzz_relay.api.bridge uses a module listed above it, which is the healthy direction.
buzz_relay.api.media uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_relay.api.media, while a change to buzz_relay.api.media can't break buzz_core.tenant.
Position
Below the diagonal: buzz_relay.api.media uses a module listed above it, which is the healthy direction.
buzz_relay.api.media uses buzz_backend_kubernetes.wire, so a change to buzz_backend_kubernetes.wire can break buzz_relay.api.media, while a change to buzz_relay.api.media can't break buzz_backend_kubernetes.wire.
Position
Below the diagonal: buzz_relay.api.media uses a module listed above it, which is the healthy direction.
buzz_relay.api.media uses buzz_core.private_managed_agent, so a change to buzz_core.private_managed_agent can break buzz_relay.api.media, while a change to buzz_relay.api.media can't break buzz_core.private_managed_agent.
Position
Below the diagonal: buzz_relay.api.media uses a module listed above it, which is the healthy direction.
buzz_relay.api.media uses buzz_media.storage, so a change to buzz_media.storage can break buzz_relay.api.media, while a change to buzz_relay.api.media can't break buzz_media.storage.
Position
Below the diagonal: buzz_relay.api.media uses a module listed above it, which is the healthy direction.
buzz_relay.api.media uses buzz_cli.client, so a change to buzz_cli.client can break buzz_relay.api.media, while a change to buzz_relay.api.media can't break buzz_cli.client.
Position
Below the diagonal: buzz_relay.api.media uses a module listed above it, which is the healthy direction.
buzz_relay.api.media uses buzz_push_gateway.http, so a change to buzz_push_gateway.http can break buzz_relay.api.media, while a change to buzz_relay.api.media can't break buzz_push_gateway.http.
Position
Below the diagonal: buzz_relay.api.media uses a module listed above it, which is the healthy direction.
buzz_acp uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_acp, while a change to buzz_acp can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_acp uses a module listed above it, which is the healthy direction.
buzz_relay.handlers.ingest uses buzz_core.event, so a change to buzz_core.event can break buzz_relay.handlers.ingest, while a change to buzz_relay.handlers.ingest can't break buzz_core.event.
Position
Below the diagonal: buzz_relay.handlers.ingest uses a module listed above it, which is the healthy direction.
buzz_relay.handlers.ingest uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_relay.handlers.ingest, while a change to buzz_relay.handlers.ingest can't break buzz_core.tenant.
Position
Below the diagonal: buzz_relay.handlers.ingest uses a module listed above it, which is the healthy direction.
buzz_relay.handlers.ingest uses buzz_db.error, so a change to buzz_db.error can break buzz_relay.handlers.ingest, while a change to buzz_relay.handlers.ingest can't break buzz_db.error.
Position
Below the diagonal: buzz_relay.handlers.ingest uses a module listed above it, which is the healthy direction.
buzz_relay.handlers.ingest uses buzz_cli, so a change to buzz_cli can break buzz_relay.handlers.ingest, while a change to buzz_relay.handlers.ingest can't break buzz_cli.
Position
Below the diagonal: buzz_relay.handlers.ingest uses a module listed above it, which is the healthy direction.
buzz_relay.handlers.ingest uses buzz_db.store.channel, so a change to buzz_db.store.channel can break buzz_relay.handlers.ingest, while a change to buzz_relay.handlers.ingest can't break buzz_db.store.channel.
Position
Below the diagonal: buzz_relay.handlers.ingest uses a module listed above it, which is the healthy direction.
buzz_relay.handlers.ingest uses buzz_push_gateway.http, so a change to buzz_push_gateway.http can break buzz_relay.handlers.ingest, while a change to buzz_relay.handlers.ingest can't break buzz_push_gateway.http.
Position
Below the diagonal: buzz_relay.handlers.ingest uses a module listed above it, which is the healthy direction.
buzz_relay.handlers.ingest uses buzz_db.runtime, so a change to buzz_db.runtime can break buzz_relay.handlers.ingest, while a change to buzz_relay.handlers.ingest can't break buzz_db.runtime.
Position
Below the diagonal: buzz_relay.handlers.ingest uses a module listed above it, which is the healthy direction.
buzz_relay.mesh_boot uses buzz_acp.config, so a change to buzz_acp.config can break buzz_relay.mesh_boot, while a change to buzz_relay.mesh_boot can't break buzz_acp.config.
Position
Below the diagonal: buzz_relay.mesh_boot uses a module listed above it, which is the healthy direction.
buzz_relay.mesh_boot uses buzz_relay_mesh.wire, so a change to buzz_relay_mesh.wire can break buzz_relay.mesh_boot, while a change to buzz_relay.mesh_boot can't break buzz_relay_mesh.wire.
Position
Below the diagonal: buzz_relay.mesh_boot uses a module listed above it, which is the healthy direction.
buzz_relay.mesh_boot uses buzz_db.runtime, so a change to buzz_db.runtime can break buzz_relay.mesh_boot, while a change to buzz_relay.mesh_boot can't break buzz_db.runtime.
Position
Below the diagonal: buzz_relay.mesh_boot uses a module listed above it, which is the healthy direction.
buzz_acp.setup_mode uses buzz_acp.config, so a change to buzz_acp.config can break buzz_acp.setup_mode, while a change to buzz_acp.setup_mode can't break buzz_acp.config.
Position
Below the diagonal: buzz_acp.setup_mode uses a module listed above it, which is the healthy direction.
buzz_acp.setup_mode uses buzz_acp.relay, so a change to buzz_acp.relay can break buzz_acp.setup_mode, while a change to buzz_acp.setup_mode can't break buzz_acp.relay.
Position
Below the diagonal: buzz_acp.setup_mode uses a module listed above it, which is the healthy direction.
buzz_acp.setup_mode uses buzz_acp.pool, so a change to buzz_acp.pool can break buzz_acp.setup_mode, while a change to buzz_acp.setup_mode can't break buzz_acp.pool.
Position
Below the diagonal: buzz_acp.setup_mode uses a module listed above it, which is the healthy direction.
buzz_relay.api.git.transport uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_relay.api.git.transport, while a change to buzz_relay.api.git.transport can't break buzz_core.tenant.
Position
Below the diagonal: buzz_relay.api.git.transport uses a module listed above it, which is the healthy direction.
buzz_relay.api.git.transport uses buzz_backend_kubernetes.wire, so a change to buzz_backend_kubernetes.wire can break buzz_relay.api.git.transport, while a change to buzz_relay.api.git.transport can't break buzz_backend_kubernetes.wire.
Position
Below the diagonal: buzz_relay.api.git.transport uses a module listed above it, which is the healthy direction.
buzz_relay.api.git.transport uses buzz_core.private_managed_agent, so a change to buzz_core.private_managed_agent can break buzz_relay.api.git.transport, while a change to buzz_relay.api.git.transport can't break buzz_core.private_managed_agent.
Position
Below the diagonal: buzz_relay.api.git.transport uses a module listed above it, which is the healthy direction.
buzz_relay.api.git.transport uses buzz_push_gateway.http, so a change to buzz_push_gateway.http can break buzz_relay.api.git.transport, while a change to buzz_relay.api.git.transport can't break buzz_push_gateway.http.
Position
Below the diagonal: buzz_relay.api.git.transport uses a module listed above it, which is the healthy direction.
buzz_relay.api.git.transport uses buzz_db.runtime, so a change to buzz_db.runtime can break buzz_relay.api.git.transport, while a change to buzz_relay.api.git.transport can't break buzz_db.runtime.
Position
Below the diagonal: buzz_relay.api.git.transport uses a module listed above it, which is the healthy direction.
buzz_relay.api.git.transport uses buzz_admin, so a change to buzz_admin can break buzz_relay.api.git.transport, while a change to buzz_relay.api.git.transport can't break buzz_admin.
Position
Below the diagonal: buzz_relay.api.git.transport uses a module listed above it, which is the healthy direction.
buzz_relay.state uses buzz_acp.config, so a change to buzz_acp.config can break buzz_relay.state, while a change to buzz_relay.state can't break buzz_acp.config.
Position
Below the diagonal: buzz_relay.state uses a module listed above it, which is the healthy direction.
buzz_relay.state uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_relay.state, while a change to buzz_relay.state can't break buzz_core.tenant.
Position
Below the diagonal: buzz_relay.state uses a module listed above it, which is the healthy direction.
buzz_relay.state uses buzz_media.storage, so a change to buzz_media.storage can break buzz_relay.state, while a change to buzz_relay.state can't break buzz_media.storage.
Position
Below the diagonal: buzz_relay.state uses a module listed above it, which is the healthy direction.
buzz_relay.state uses buzz_db.store.channel, so a change to buzz_db.store.channel can break buzz_relay.state, while a change to buzz_relay.state can't break buzz_db.store.channel.
Position
Below the diagonal: buzz_relay.state uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in buzz_relay.state uses a type in buzz_db.runtime.
The types involved
buzz_relay.state.AppState → buzz_db.runtime.Db
Direction
buzz_relay.state uses buzz_db.runtime, so a change to buzz_db.runtime can break buzz_relay.state, while a change to buzz_relay.state can't break buzz_db.runtime.
Position
Below the diagonal: buzz_relay.state uses a module listed above it, which is the healthy direction.
buzz_relay.state uses buzz_relay.mesh_boot, so a change to buzz_relay.mesh_boot can break buzz_relay.state, while a change to buzz_relay.state can't break buzz_relay.mesh_boot.
Position
Below the diagonal: buzz_relay.state uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.types uses buzz_acp.config, so a change to buzz_acp.config can break buzz_desktop.managed_agents.types, while a change to buzz_desktop.managed_agents.types can't break buzz_acp.config.
Position
Below the diagonal: buzz_desktop.managed_agents.types uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.types uses buzz_acp.setup_mode, so a change to buzz_acp.setup_mode can break buzz_desktop.managed_agents.types, while a change to buzz_desktop.managed_agents.types can't break buzz_acp.setup_mode.
Position
Below the diagonal: buzz_desktop.managed_agents.types uses a module listed above it, which is the healthy direction.
34→38 buzz_desktop.managed_agents.types uses buzz_desktop.managed_agents.session_policypart of a loop✕
Connections
3 pairs of types, where a type in buzz_desktop.managed_agents.types uses a type in buzz_desktop.managed_agents.session_policy.
buzz_desktop.managed_agents.types uses buzz_desktop.managed_agents.session_policy, so a change to buzz_desktop.managed_agents.session_policy can break buzz_desktop.managed_agents.types, while a change to buzz_desktop.managed_agents.types can't break buzz_desktop.managed_agents.session_policy.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
buzz_relay.audio.handler uses buzz_agent.databricks_test_support, so a change to buzz_agent.databricks_test_support can break buzz_relay.audio.handler, while a change to buzz_relay.audio.handler can't break buzz_agent.databricks_test_support.
Position
Below the diagonal: buzz_relay.audio.handler uses a module listed above it, which is the healthy direction.
buzz_relay.audio.handler uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_relay.audio.handler, while a change to buzz_relay.audio.handler can't break buzz_core.tenant.
Position
Below the diagonal: buzz_relay.audio.handler uses a module listed above it, which is the healthy direction.
buzz_relay.audio.handler uses buzz_db.error, so a change to buzz_db.error can break buzz_relay.audio.handler, while a change to buzz_relay.audio.handler can't break buzz_db.error.
Position
Below the diagonal: buzz_relay.audio.handler uses a module listed above it, which is the healthy direction.
buzz_relay.audio.handler uses buzz_push_gateway.app_attest.cbor, so a change to buzz_push_gateway.app_attest.cbor can break buzz_relay.audio.handler, while a change to buzz_relay.audio.handler can't break buzz_push_gateway.app_attest.cbor.
Position
Below the diagonal: buzz_relay.audio.handler uses a module listed above it, which is the healthy direction.
buzz_relay.audio.handler uses buzz_core.private_managed_agent, so a change to buzz_core.private_managed_agent can break buzz_relay.audio.handler, while a change to buzz_relay.audio.handler can't break buzz_core.private_managed_agent.
Position
Below the diagonal: buzz_relay.audio.handler uses a module listed above it, which is the healthy direction.
buzz_relay.audio.handler uses buzz_push_gateway.http, so a change to buzz_push_gateway.http can break buzz_relay.audio.handler, while a change to buzz_relay.audio.handler can't break buzz_push_gateway.http.
Position
Below the diagonal: buzz_relay.audio.handler uses a module listed above it, which is the healthy direction.
buzz_relay.audio.handler uses buzz_relay.state, so a change to buzz_relay.state can break buzz_relay.audio.handler, while a change to buzz_relay.audio.handler can't break buzz_relay.state.
Position
Below the diagonal: buzz_relay.audio.handler uses a module listed above it, which is the healthy direction.
buzz_relay.connection uses buzz_core.tenant, so a change to buzz_core.tenant can break buzz_relay.connection, while a change to buzz_relay.connection can't break buzz_core.tenant.
Position
Below the diagonal: buzz_relay.connection uses a module listed above it, which is the healthy direction.
buzz_relay.connection uses buzz_push_gateway.http, so a change to buzz_push_gateway.http can break buzz_relay.connection, while a change to buzz_relay.connection can't break buzz_push_gateway.http.
Position
Below the diagonal: buzz_relay.connection uses a module listed above it, which is the healthy direction.
buzz_relay.connection uses buzz_relay.state, so a change to buzz_relay.state can break buzz_relay.connection, while a change to buzz_relay.connection can't break buzz_relay.state.
Position
Below the diagonal: buzz_relay.connection uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.global_config uses buzz_desktop.managed_agents.types, so a change to buzz_desktop.managed_agents.types can break buzz_desktop.managed_agents.global_config, while a change to buzz_desktop.managed_agents.global_config can't break buzz_desktop.managed_agents.types.
Position
Below the diagonal: buzz_desktop.managed_agents.global_config uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.session_policy uses buzz_admin, so a change to buzz_admin can break buzz_desktop.managed_agents.session_policy, while a change to buzz_desktop.managed_agents.session_policy can't break buzz_admin.
Position
Below the diagonal: buzz_desktop.managed_agents.session_policy uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.session_policy uses buzz_desktop.managed_agents.types, so a change to buzz_desktop.managed_agents.types can break buzz_desktop.managed_agents.session_policy, while a change to buzz_desktop.managed_agents.session_policy can't break buzz_desktop.managed_agents.types.
Position
Below the diagonal: buzz_desktop.managed_agents.session_policy uses a module listed above it, which is the healthy direction.
buzz_desktop.app_state uses buzz_push_gateway.http, so a change to buzz_push_gateway.http can break buzz_desktop.app_state, while a change to buzz_desktop.app_state can't break buzz_push_gateway.http.
Position
Below the diagonal: buzz_desktop.app_state uses a module listed above it, which is the healthy direction.
buzz_desktop.app_state uses buzz_desktop.managed_agents.session_policy, so a change to buzz_desktop.managed_agents.session_policy can break buzz_desktop.app_state, while a change to buzz_desktop.app_state can't break buzz_desktop.managed_agents.session_policy.
Position
Below the diagonal: buzz_desktop.app_state uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.types.requests uses buzz_acp.config, so a change to buzz_acp.config can break buzz_desktop.managed_agents.types.requests, while a change to buzz_desktop.managed_agents.types.requests can't break buzz_acp.config.
Position
Below the diagonal: buzz_desktop.managed_agents.types.requests uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.types.requests uses buzz_desktop.managed_agents.types, so a change to buzz_desktop.managed_agents.types can break buzz_desktop.managed_agents.types.requests, while a change to buzz_desktop.managed_agents.types.requests can't break buzz_desktop.managed_agents.types.
Position
Below the diagonal: buzz_desktop.managed_agents.types.requests uses a module listed above it, which is the healthy direction.
buzz_desktop.managed_agents.types.requests uses buzz_desktop.managed_agents.session_policy, so a change to buzz_desktop.managed_agents.session_policy can break buzz_desktop.managed_agents.types.requests, while a change to buzz_desktop.managed_agents.types.requests can't break buzz_desktop.managed_agents.session_policy.
Position
Below the diagonal: buzz_desktop.managed_agents.types.requests uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 57% · Adequate · gated by D1, D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
62
High / Critical
A03:2025 — Software Supply Chain Failures
56
High / Critical
A02:2025 — Security Misconfiguration
25
High / Critical
A07:2025 — Authentication Failures
24
High / Critical
Roadmap
First, enforce strict import boundaries by ensuring all dependencies flow downward through public interfaces and eliminating circular imports by extracting shared logic into independent modules. Next, maintain slice independence by routing cross-slice interactions through explicit contracts rather than direct references. Finally, address the remaining coupling warnings and resolve the project cohesion issue to ensure the codebase remains modular and manageable.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1120 rows); import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (5 rows).
Enforce accessibility in the toolchain you already use: enable Biome's a11y rule group in your biome.json `linter.rules` (it is off whenever `recommended` is false and the group is unlisted), then assert with @axe-core/playwright in tests, then gate axe/pa11y/Lighthouse in CI.
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.
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 — 90
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 — 4394
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 — 150
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 97 of 97 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 97 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, 4598 of 4634 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for desktop/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 8,351 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 617 test source file(s) (.py, .dart, .swift, .rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for admin-web/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in admin-web/ was NOT MEASURED: the dependency install for admin-web/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the node:test suite in desktop/ was NOT MEASURED: the dependency install for desktop/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 2 Maven/Gradle manifest(s) were read, stating a version for 2 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Dart pubspec.yaml, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Dart dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `admin-web/src/App.tsx`, `desktop/src/app/useAppShellDesktopNotifications.ts`, `desktop/src/features/agents/channelAgents.ts`, `desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx`, `desktop/src/features/agents/ui/activityRenderClasses/TranscriptActivityItem.tsx`, … (+29 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.
D41 Kernel & Syscall Confinement — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Deploy/charts/buzz-push-gateway/templates/deployment.yaml:2, deploy/charts/buzz-push-gateway/templates/migration-job.yaml:2, deploy/charts/buzz/templates/deployment.yaml:3, REDACTED:4, REDACTED:24, REDACTED:11, deploy/charts/buzz/templates/storage-accounting-cronjob.yaml:3 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
AX7 Slice cohesion — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1459 further occurrence(s) are not listed individually; the score already reflects all 1499.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — adminer Pulling keycloak Pulling prometheus Pulling postgres Pulling prometheus Error Get "https://registry-1.docker.io/v2/": Forbidden minio Error context canceled keycloak Error context canceled adminer Error context canceled postgres Error context canceled redis Error context canceled minio-init Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: keycloak Pulling minio Pulling prometheus Pulling postgres Pulling adminer Error Get "https://registry-1.docker.io/v2/": Forbidden minio-init Error context canceled keycloak Error context canceled redis Error context canceled prometheus Error context canceled minio Error context canceled postgres Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 714 further occurrence(s) are not listed individually; the score already reflects all 754.
R11 Import Boundaries — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1086 further occurrence(s) are not listed individually; the score already reflects all 1126.
R3 Large Files — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 179 further occurrence(s) are not listed individually; the score already reflects all 219.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 21 further occurrence(s) are not listed individually; the score already reflects all 61.
R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 95 further occurrence(s) are not listed individually; the score already reflects all 135.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 252 further occurrence(s) are not listed individually; the score already reflects all 292.
X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 447 further occurrence(s) are not listed individually; the score already reflects all 487.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
720 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was _MessageList.build at 203. A further 15 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 buzz_media::validation::file_mime_to_ext at 35 — they are counted neither in the figure above nor in this dimension's score. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: crates/buzz-cli/src/lib.rs (buzz_cli::run at 26), crates/buzz-cli/src/validate.rs (buzz_cli::validate::infer_language at 24), desktop/src-tauri/src/commands/admin/attachment.rs (buzz_desktop::commands::admin::attachment::attachment_file_name at 24), desktop/src-tauri/src/commands/admin/routes.rs (AdminRoute::path at 23), crates/buzz-relay/src/startup_steps.rs (StartupStep::as_str at 20), and 5 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 570 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 13 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with _MessageList.build (cyclomatic 203), buzz_acp::run_harness (cyclomatic 171), AgentConfigFields.AgentConfigFields (cyclomatic 170). — 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 13 together lifts Cyclomatic Complexity from 4.0 to about 4.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 747 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 35 bodies over 120 down to 120 or less in Cognitive Complexity — start with buzz_acp::run_harness (cognitive 398), buzz_relay::audio::handler::run_active_audio_connection (cognitive 250), ProfileAvatarEditor.ProfileAvatarEditor (cognitive 250). — 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 35 together lifts Cognitive Complexity from 2.0 to about 3.3/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.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.
TooManyMethods: Db · ×17crates/buzz-db/src/runtime/mod.rs:261
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 505 FunctionTooLong finding(s) in God Classes — start with lib.rs (9), hooks.ts (6), main.rs (5). — One of this dimension's main actionable groups (505 warning-level).
Resolve the 233 FileTooLong finding(s) in God Classes — start with lib.rs (8), mod.rs (6), hooks.ts (4). — One of this dimension's main actionable groups (233 warning-level).
Resolve the 109 MethodTooLong finding(s) in God Classes — start with REDACTED (3), message_list.dart (2), config.rs (2). — One of this dimension's main actionable groups (109 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
678 duplicated block group(s) detected. A further 27 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. Measured on part of this repository only: .tsx (17% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
+ 154 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 54 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with config.rs (3), filter.rs (2), client.rs (2). — One of this dimension's main actionable groups (54 warning-level).
Resolve the 45 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with channel_mutes_manager.dart (3), relay.rs (2), social.rs (2). — One of this dimension's main actionable groups (45 warning-level).
Resolve the 40 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with relay.rs (2), import.rs (2), channel_head_cache.rs (2). — One of this dimension's main actionable groups (40 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.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.
44 production modules (Gradle+Cargo+npm+SwiftPM+pub), 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; 14 module(s) off the main sequence, with abstractness counted on 38 of the 44 (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: buzz-audio-client · ×14
What to do
Resolve the 14 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (14 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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 app_state.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution8.7 / 10Strong✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
20154 test methods: 17734 unit, 476 integration, 0 BDD, 1944 e2e. The JavaScript/TypeScript suite contributes 8351 `it`/`test` case(s) across 925 test file(s) declaring at least one beside 249 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 11430 `#[test]` function(s) across 748 file(s) declaring at least one; its unit/integration split is Cargo's own — 50 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 124 test function(s) across 15 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
What to do
Improve Test Distribution — currently 8.7/10. — 20154 test methods: 17734 unit, 476 integration, 0 BDD, 1944 e2e. The JavaScript/TypeScript suite contributes 8351 `it`/`test` case(s) across 925 test file(s) declaring at least one beside 249 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 11430 `#[test]` function(s) across 748 file(s) declaring at least one; its unit/integration split is Cargo's own — 50 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 124 test function(s) across 15 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 27 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
4 skipped, 16 zero-assertion, 5 synchronised by a fixed sleep, 2 racing the wall clock, no mocking-framework packages referenced (hand-written doubles or no mocking) across 8351 tests. Measured on the JavaScript/TypeScript suite only — at least 617 test source file(s) (.py, .dart, .swift, .rs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: capture: add-community choices · ×16desktop/tests/e2e/add-community-screenshots.spec.ts:176
Fixed-sleep synchronisation: an orphaned metadata load is cancelled after its re-entry grace period · ×5desktop/src/shared/lib/useResolvedLinkPreviews.test.mjs:629
Races the wall clock: shows a large elapsed for a turn that started well in the past · ×2desktop/src/features/agents/activeAgentTurnsStore.test.mjs:1126
What to do
Resolve the 16 No assertions finding(s) in Test Quality — start with channel-add-screenshots.spec.ts (4), add-community-screenshots.spec.ts (3), community-rail.spec.ts. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 5 Fixed-sleep synchronisation finding(s) in Test Quality — start with audioMediaLoadScheduler.test.mjs (2), communityViewTransition.test.mjs (2), useResolvedLinkPreviews.test.mjs. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 4 Skipped test finding(s) in Test Quality — start with composer-link-shortcut.spec.ts (2), agents-everywhere.live.spec.ts, relay-restart.live.spec.ts. — One of this dimension's main actionable groups (4 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 21 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (9), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (21 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 1018 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 50 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json and a Dart pubspec.yaml, 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: desktop/src/testing/e2eBridge.ts (99×598=59202); crates/buzz-acp/src/lib.rs (43×171=7353); mobile/lib/features/channels/channel_detail_page.dart (48×116=5568) Repeated repair below the complexity floor: desktop/src/features/agents/hooks.ts (7 of 13 changes were fixes); desktop/src/shared/api/relayClientShared.ts (6 of 8 changes were fixes); desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs (4 of 7 changes were fixes)
Resolve the 332 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (5), config.rs (3), message_list.dart (2). — One of this dimension's main actionable groups (332 warning-level).
Resolve the 42 Repeated repair finding(s) in Churn × Complexity Hotspots — start with hooks.ts (8), relayClientShared.ts, relay_directory.rs. — One of this dimension's main actionable groups (42 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.8 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
268 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is desktop/src-tauri/src/managed_agents/persona_avatars.rs. Counted over 2288 of the 3268 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×11
Further sole-owners (lower concentration)
What to do
Resolve the 11 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (11 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
18 deducted task-comment markers across 1034872 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 16 TodoComment finding(s) in Explicit Debt — start with executor.rs (3), REDACTED (2), conformance_multitenant.rs (2). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 1 FixmeComment finding(s) in Explicit Debt — start with navigation.spec.ts. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with postgres_fts_integration.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 102 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
5 of 43 build units (Cargo, Gradle, SwiftPM, Xcode, npm, pub) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
62 finding(s): 0 critical, 11 high, 50 medium, 1 low. semgrep hit a parse error in 73 file(s) — `REDACTED` (lines 23–187), `admin-web/src/App.tsx` (lines 75–76), `bin/activate-hermit` (line 12), `bin/activate-hermit.fish` (lines 8–24), `REDACTED` (line 3076, line 3167, line 3194, …), … (+68 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 7 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (7 issue-level).
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 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8), REDACTED (2). — One of this dimension's main actionable groups (10 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 17 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 5 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
2 of 2288 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is desktop/src/features/search/lib/parseSearchOperators.ts. Counted over 2288 of the 3268 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 30 Change coupling finding(s) in Change Coupling — start with channel_detail_page.dart (2), activity_page.dart (2), AgentSessionTranscriptList.tsx (2). — One of this dimension's main actionable groups (30 warning-level).
Resolve the 8 Change-coupling hub finding(s) in Change Coupling — start with AppSidebar.tsx, e2eBridge.ts, MessageRow.tsx. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Build pipeline generates provenance, signs artifacts and produces an SBOM.
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 3 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives5.5 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×3) — desktop/src/features/messages/ui/ComposerAttachments.tsx:432, desktop/src/shared/ui/VideoPlayer.tsx:992, desktop/src/shared/ui/VideoPlayer.tsx:1698
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×5) — desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:768, desktop/src/features/terminal/TerminalSubstrate.tsx:681, desktop/src/features/terminal/TerminalSubstrate.tsx:759, …
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels6.9 / 10Strong✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×10) — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:445, desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:690, desktop/src/features/admin-console/AdminConsoleCommunities.tsx:157, …
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×9) — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:629, desktop/src/features/agents/ui/AgentSessionToolItem/TodoToolSummary.tsx:96, desktop/src/features/agents/ui/agentConfigControls.tsx:547, …
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — desktop/src/features/agents/ui/AgentCardMintDialog.tsx:306, desktop/src/features/agents/ui/RespondToField.tsx:501, desktop/src/features/settings/ui/SendFeedbackDialog.tsx:234
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×3) — desktop/src/features/channels/ui/MembersSidebarAgentControls.tsx:33, desktop/src/features/channels/ui/MembersSidebarMemberCard.tsx:364, desktop/src/features/forum/ui/DeleteActionMenu.tsx:27
A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×3) — desktop/src/features/forum/ui/ForumComposer.tsx:681, desktop/src/features/onboarding/ui/DefaultConfigStep.tsx:231, desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:454
This <video> 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. (×2) — desktop/src/shared/ui/VideoPlayer.tsx:992, desktop/src/shared/ui/VideoPlayer.tsx:1698
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure7.7 / 10Strong✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>. — desktop/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. (×4) — desktop/src/features/agents/ui/AgentSessionToolItem/ViewImageToolPreview.tsx:25, desktop/src/features/communities/ui/CommunityChangeOverlay.tsx:76, desktop/src/features/home/ui/InboxListPane.tsx:373, …
The repo's own CSS styles .buzz-avatar-framing-slider-hashmark with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — desktop/src/features/profile/ui/AnimatedAvatarControls.tsx:248
A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×2) — desktop/src/shared/ui/VideoPlayer.tsx:992, desktop/src/shared/ui/VideoPlayer.tsx:1698
The repo's own CSS styles .buzz-spoiler with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — desktop/src/shared/ui/markdown/SpoilerInline.tsx:84
The repo's own CSS styles .buzz-spoiler with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — desktop/src/shared/ui/markdown/SpoilerInline.tsx:100
This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×2) — web/src/features/invite/ui/InvitePage.tsx:306, web/src/features/invite/ui/InvitePage.tsx:378
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). (×4) — desktop/src/features/agents/ui/PersonaModelCombobox.tsx:159, desktop/src/features/projects/ui/ProjectsSectionSearch.tsx:104, desktop/src/features/search/ui/SearchScopeControls.tsx:74, …
<button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×6) — desktop/src/features/communities/ui/CommunitySwitcher.tsx:415, desktop/src/features/sidebar/ui/CommunityRail.tsx:123, desktop/src/features/sidebar/ui/CommunityRail.tsx:417, …
<span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — desktop/src/features/messages/ui/ComposerAddressControls.tsx:353
<div> moves — its `animate-[progress-indeterminate_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — desktop/src/shared/ui/progress.tsx:33
`.buzz-avatar-hue-scrubber` 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. — desktop/src/shared/styles/globals/animations.css:433
`.rich-text-composer .tiptap` 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. — desktop/src/shared/styles/globals/composer.css:97
`.video-volume-slider:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — desktop/src/shared/styles/globals/media-controls.css:11
`.sprout-arc-spinner` moves (`animation: sprout-arc-spinner-spin 500ms linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:2
`.buzz-poof-frame` moves (`animation: buzz-poof-frame 400ms linear both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:282
`.buzz-poof-frame-1` moves (`animation-name: buzz-poof-frame-1`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:294
`.buzz-poof-frame-2` moves (`animation-name: buzz-poof-frame-2`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:298
`.buzz-poof-frame-3` moves (`animation-name: buzz-poof-frame-3`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:302
`.buzz-poof-frame-4` moves (`animation-name: buzz-poof-frame-4`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:306
`.buzz-poof-frame-5` moves (`animation-name: buzz-poof-frame-5`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:310
`.buzz-sidebar-action-description__reel` moves (`animation: buzz-sidebar-action-description-roll-up 260ms
cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:518
`.buzz-animated-count__slot[data-direction="up"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:577
`.buzz-animated-count__slot[data-direction="down"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-down 260ms cubic-bezier(0.2, 0.8, 0.2, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:582
`.buzz-animated-count__symbol[data-direction="up"]` moves (`animation: buzz-animated-count-symbol-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:592
`.buzz-animated-count__symbol[data-direction="down"]` moves (`animation: buzz-animated-count-symbol-down 220ms
cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:597
`.bee-sprite .bee-wing-left` moves (`animation-name: bee-wing-left-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:875
`.bee-sprite .bee-wing-right` moves (`animation-name: bee-wing-right-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/animations.css:879
`.buzz-avatar-framing-slider-handle` moves (`transition: opacity 150ms ease,
transform 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/avatar-framing.css:115
`.buzz-avatar-framing-slider-tip` moves (`transition: opacity 150ms ease,
transform 150ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/avatar-framing.css:141
`.buzz-huddle-speaking-avatar::after` moves (`transition: opacity 80ms linear,
transform 90ms cubic-bezier(0.2, 0, 0, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:195
`.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="forward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-forward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:530
`.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="backward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-backward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:535
`.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-down"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-down`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:561
`.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-up"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-up`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — desktop/src/shared/styles/globals/components.css:566
`.record-card` moves (`transition: transform 180ms ease,
box-shadow 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — admin-web/src/styles.css:279
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — your Biome config enables no a11y rules and there's no axe/pa11y/Lighthouse in tests or CI. Start by turning on Biome's own a11y rule group to catch issues at author time. What was searched, so you can tell an absence from a miss: the 744 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain you already use: enable Biome's a11y rule group in your biome.json `linter.rules` (it is off whenever `recommended` is false and the group is unlisted), then assert with @axe-core/playwright in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.
Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.
`currentCommunityRoleProvider` is a keep-alive Riverpod provider and calls `ref.watch(communityMembershipProvider…)`, which is declared auto-dispose (mobile/lib/shared/community/community_membership_provider.dart:107). The keep-alive provider listens to it for the life of the ProviderContainer, so `communityMembershipProvider` is never disposed — the auto-dispose lifetime it declares never happens, and whatever it holds (a socket, a controller, a stale value) is kept for every later reader. Mark `communityMembershipProvider` keepAlive too, make `currentCommunityRoleProvider` auto-dispose, or read it per use outside build. — mobile/lib/shared/community/community_membership_provider.dart:119
What to do
Riverpod: a keepAlive provider must only watch, listen to or read in build other keepAlive providers — mark the dependency @Riverpod(keepAlive: true) (or drop .autoDispose), make the consumer auto-dispose too, or read the dependency per use from a Notifier method instead of in build (riverpod_lint: only_use_keep_alive_inside_keep_alive).
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.
Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.
`DirectActionsProvider` (slice 'admin-console') depends on `memberSearchLabel` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:248
`useAdminMemberSearch` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:617
`AdminMemberPicker` (slice 'admin-console') depends on `useMemberCandidates` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:664
`AdminMemberPicker` (slice 'admin-console') depends on `MemberSearchResult` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:717
`CommunitiesTab` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'. — desktop/src/features/admin-console/AdminConsoleCommunities.tsx:48
`AdminConsolePanel` (slice 'admin-console') depends on `useCommunities` from slice 'communities'. — desktop/src/features/admin-console/AdminConsolePanel.tsx:150
`formatTimestamp` (slice 'admin-console') depends on `formatRelativeTime` from slice 'forum'. — desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:263
`ReportsTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:702
`AdminConsoleSettingsCard` (slice 'admin-console') depends on `SettingsSectionHeader` from slice 'settings'. — desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:216
`StaffingTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'. — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:483
`mountCard` (slice 'admin-console') depends on `CommunitiesProvider` from slice 'communities'. — desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:161
`useIsManagedAgent` (slice 'agent-memory') depends on `useManagedAgentsQuery` from slice 'agents'. — desktop/src/features/agent-memory/hooks.ts:42
`invalidateAgentQueries` (slice 'agents') depends on `channelsQueryKey` from slice 'channels'. — desktop/src/features/agents/hooks.ts:157
`useUpdateManagedAgentMutation` (slice 'agents') depends on `updateCachedChannelMemberDisplayName` from slice 'channels'. — desktop/src/features/agents/hooks.ts:470
`useUpdateManagedAgentMutation` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'. — desktop/src/features/agents/hooks.ts:491
`useAttachManagedAgentToChannelMutation` (slice 'agents') depends on `upsertCachedChannelMember` from slice 'channels'. — desktop/src/features/agents/hooks.ts:723
`invalidatePersonaEditCaches` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'. — desktop/src/features/agents/lib/personaEditCaches.ts:21
`useAgentAvailabilityLookup` (slice 'agents') depends on `usePresenceQuery` from slice 'presence'. — desktop/src/features/agents/lib/useAgentAvailability.ts:43
`useAgentAvailabilityLookup` (slice 'agents') depends on `presenceQueryKey` from slice 'presence'. — desktop/src/features/agents/lib/useAgentAvailability.ts:48
`bootstrapManagedAgentRuntimePairs` (slice 'agents') depends on `loadCommunities` from slice 'communities'. — desktop/src/features/agents/managedAgentRuntimeHooks.ts:88
`clearActiveTurnsForAgentOnStop` (slice 'agents') depends on `loadActiveCommunityId` from slice 'communities'. — desktop/src/features/agents/managedAgentRuntimeHooks.ts:128
`projectChannelRequestListeners` (slice 'agents') depends on `ProjectChannelRequest` from slice 'projects'. — desktop/src/features/agents/observerRelayStore.ts:142
`processLiveObserverEvents` (slice 'agents') depends on `parseProjectChannelRequest` from slice 'projects'. — desktop/src/features/agents/observerRelayStore.ts:516
`AddAgentToChannelDialog` (slice 'agents') depends on `useChannelsQuery` from slice 'channels'. — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:41
`AddAgentToChannelDialog` (slice 'agents') depends on `useChannelMembersQuery` from slice 'channels'. — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:79
`AddCustomHarnessDialog` (slice 'agents') depends on `CustomHarnessForm` from slice 'settings'. — desktop/src/features/agents/ui/AddCustomHarnessDialog.tsx:29
`AddTeamToChannelDialog` (slice 'agents') depends on `useChannelsQuery` from slice 'channels'. — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:55
`AddTeamToChannelDialog` (slice 'agents') depends on `ProfileAvatar` from slice 'profile'. — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:190
`AgentCardViewerContent` (slice 'agents') depends on `useOpenDmMutation` from slice 'channels'. — desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:105
`AgentCardViewerContent` (slice 'agents') depends on `useUpsertCachedChannel` from slice 'channels'. — desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:106
`AgentConfigFields` (slice 'agents') depends on `SettingsOptionGroup` from slice 'settings'. — desktop/src/features/agents/ui/AgentConfigFields.tsx:1041
`AgentCreationPreview` (slice 'agents') depends on `DEFAULT_EMOJI_AVATAR_COLOR` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:85
`AgentCreationPreview` (slice 'agents') depends on `DEFAULT_CUSTOM_HUE` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:92
`AgentCreationPreview` (slice 'agents') depends on `DEFAULT_CUSTOM_SATURATION` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:94
`AgentCreationPreview` (slice 'agents') depends on `DEFAULT_CUSTOM_VALUE` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:96
`AgentCreationPreview` (slice 'agents') depends on `useEmojiMartThemeVars` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:105
`AgentCreationPreview` (slice 'agents') depends on `useAvatarUpload` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:119
`AgentCreationPreview` (slice 'agents') depends on `useEmojiMartStyles` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:128
`AgentCreationPreview` (slice 'agents') depends on `hsvToHex` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:159
`AgentCreationPreview` (slice 'agents') depends on `parseEmojiAvatarDataUrl` from slice 'profile'. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:177
What to do
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
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.
`CommunityStorage.loadAll` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — mobile/lib/shared/community/community_storage.dart:38
What to do
Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add a README to the 34 of 45 project(s) that lack one — worth up to 1.5 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Only 20/28 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/buzz-backend-kubernetes`, `crates/buzz-cli`, `crates/buzz-pair-relay`, `crates/buzz-pairing-cli` and 3 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — desktop/src-tauri/src/app_state.rs:183, desktop/src-tauri/src/app_state.rs:208
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — desktop/src-tauri/src/app_state.rs:213
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 85 use(s) across 139,270 production line(s) (~0.6/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Dart: on hot paths, hold numbers in dart:typed_data lists (Int32List, Float64List …) instead of boxed List<int>/List<double>, read through views (sublistView, buffer.asInt32List, asByteData) instead of copying, make lists that never grow growable: false, compute in the SIMD types (Float32x4List …), and build bytes with BytesBuilder(copy: false).
Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
a busy-wait on the clock in `handleMockCommand` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — desktop/src/testing/e2eBridge.ts:12901
`fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — desktop/test-loader-hooks.mjs:168, desktop/test-loader-hooks.mjs:184
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety7.2 / 10Strong✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
284 duplicated blocks under desktop/src/features/ have copies in at least two of the sibling directories admin-console, agents, channel-templates, channels, communities, community-members (+22 more sibling(s) not listed) — 141 of them are reported below, and 143 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 284 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 284 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 284 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49
111 duplicated blocks under desktop/src/ have copies in at least two of the sibling directories app, features, protectedFeatures, shared, testing — 55 of them are reported below, and 56 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 111 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 111 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 111 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/messages/ui/MessageReactions.tsx:371
20 duplicated blocks under the repository root have copies in at least two of the sibling directories desktop, mobile, web — 13 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 20 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 20 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 20 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/shared/ui/card.tsx:133
7 duplicated blocks under desktop/src/features/huddle/ have copies in at least two of the sibling directories components, hooks, lib — 4 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:42
6 duplicated blocks under desktop/src/features/messages/ have copies in at least two of the sibling directories lib, ui — 2 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — desktop/src/features/messages/lib/useThreadFollows.ts:16
desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49 · desktop/src/features/settings/ui/EncryptedBackupCreator.tsx:19 — the two spans are one implementation copied and then locally edited — 1024 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. — desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49
desktop/src/features/sidebar/lib/useChannelMutes.ts:19 · desktop/src/features/sidebar/lib/useChannelStars.ts:19 — 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. — desktop/src/features/sidebar/lib/useChannelMutes.ts:19
desktop/src/shared/ui/context-menu.tsx:13 · desktop/src/shared/ui/dropdown-menu.tsx:13 — the two spans are one implementation copied and then locally edited — 902 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. — desktop/src/shared/ui/context-menu.tsx:13
desktop/src/features/projects/ui/ProjectsIssuesList.tsx:196 · desktop/src/features/projects/ui/ProjectsPullRequestsList.tsx:203 — 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. — desktop/src/features/projects/ui/ProjectsIssuesList.tsx:196
desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119 · desktop/src/features/agents/ui/PersonaAdvancedFields.tsx:100 — the two spans are one implementation copied and then locally edited — 607 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. — desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119
desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277 · desktop/src/features/settings/ui/BackupTestFlow.tsx:160 — the two spans are one implementation copied and then locally edited — 823 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. — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277
desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114 · desktop/src/features/workflows/ui/WorkflowMessagePicker.tsx:195 — the two spans are one implementation copied and then locally edited — 720 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. — desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114
desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:120 · desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:233 — the two spans are one implementation copied and then locally edited — 666 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. — desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:120
desktop/src/features/sidebar/lib/channelMutesSync.ts:1 · desktop/src/features/sidebar/lib/channelStarsSync.ts:1 — these 2 files are line-for-line copies of one another — 152 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — desktop/src/features/sidebar/lib/channelMutesSync.ts:1
desktop/src/features/agents/ui/AgentSnapshotImportDialog.tsx:24 · desktop/src/features/agents/ui/TeamSnapshotImportDialog.tsx:22 — the two spans are one implementation copied and then locally edited — 629 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. — desktop/src/features/agents/ui/AgentSnapshotImportDialog.tsx:24
desktop/src/features/projects/ui/IssueAssigneesRow.tsx:31 · desktop/src/features/projects/ui/PullRequestReviewersRow.tsx:38 — the two spans are one implementation copied and then locally edited — 652 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. — desktop/src/features/projects/ui/IssueAssigneesRow.tsx:31
desktop/src/shared/theme/ThemePreviewFrame.tsx:63 · desktop/src/shared/theme/ThemePreviewFrame.tsx:267 — the two spans are one implementation copied and then locally edited — 565 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/shared/theme/ThemePreviewFrame.tsx:63
desktop/src/features/channels/ui/MembersSidebar.tsx:268 · desktop/src/features/messages/ui/useNewMessageRecipients.ts:102 — the two spans are one implementation copied and then locally edited — 598 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. — desktop/src/features/channels/ui/MembersSidebar.tsx:268
desktop/src/features/sidebar/lib/channelMutesStorage.ts:2 · desktop/src/features/sidebar/lib/channelStarsStorage.ts:2 — 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. — desktop/src/features/sidebar/lib/channelMutesStorage.ts:2
desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:52 · desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:92 — the two spans are one implementation copied and then locally edited — 607 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. — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:52
desktop/src/features/agents/ui/usePersonaActions.ts:70 · desktop/src/features/agents/ui/useTeamActions.ts:66 — the two spans are one implementation copied and then locally edited — 647 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. — desktop/src/features/agents/ui/usePersonaActions.ts:70
desktop/src/features/agents/ui/AgentsView.tsx:325 · desktop/src/features/agents/ui/AgentsView.tsx:551 — the two spans are one implementation copied and then locally edited — 539 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/AgentsView.tsx:325
desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116 · desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:134 — the two spans are one implementation copied and then locally edited — 533 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. — desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116
desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33 · desktop/src/features/settings/ui/BackupTestFlow.tsx:14 — the two spans are one implementation copied and then locally edited — 699 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. — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33
desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:148 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:200 — the two spans are one implementation copied and then locally edited — 503 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. — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:148
desktop/src/features/messages/lib/useChannelLinks.ts:92 · desktop/src/features/messages/lib/useEmojiAutocomplete.ts:151 — the two spans are one implementation copied and then locally edited — 521 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. — desktop/src/features/messages/lib/useChannelLinks.ts:92
desktop/src/features/onboarding/lib/encryptedBackup.ts:2 · desktop/src/features/settings/lib/encryptedBackup.ts:2 — these 2 files are line-for-line copies of one another — 94 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — desktop/src/features/onboarding/lib/encryptedBackup.ts:2
desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89 · desktop/src/features/agents/ui/TeamSnapshotExportDialog.tsx:72 — the two spans are one implementation copied and then locally edited — 401 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89
desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141 · desktop/src/features/search/ui/SearchPromptPlaceholder.tsx:62 — the two spans are one implementation copied and then locally edited — 526 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. — desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141
desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58 · desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:224 — the two spans are one implementation copied and then locally edited — 432 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. — desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58
desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631 · desktop/src/features/settings/ui/BackupTestFlow.tsx:341 — the two spans are one implementation copied and then locally edited — 358 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. — desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631
desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13 · desktop/src/features/projects/ui/CreatePullRequestDialog.tsx:23 — the two spans are one implementation copied and then locally edited — 425 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. — desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13
desktop/src/features/messages/ui/MessageRow.tsx:755 · desktop/src/features/messages/ui/MessageThreadSummaryRow.tsx:150 — the two spans are one implementation copied and then locally edited — 297 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. — desktop/src/features/messages/ui/MessageRow.tsx:755
desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:90 — the two spans are one implementation copied and then locally edited — 525 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. — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48
desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201 · desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1368 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201
desktop/src/features/channels/channelSnapshot.ts:46 · desktop/src/features/projects/projectSnapshot.ts:113 — the two spans are one implementation copied and then locally edited — 393 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. — desktop/src/features/channels/channelSnapshot.ts:46
desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76 · desktop/src/features/projects/ui/ProjectsAgentPromptPage.tsx:427 — the two spans are one implementation copied and then locally edited — 284 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76
desktop/src/shared/ui/rich-link-preview-attachment.tsx:168 · desktop/src/shared/ui/rich-link-preview-attachment.tsx:267 — the two spans are one implementation copied and then locally edited — 282 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — desktop/src/shared/ui/rich-link-preview-attachment.tsx:168
desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126 · desktop/src/features/agents/ui/PromptSectionAccordion.tsx:17 — the two spans are one implementation copied and then locally edited — 249 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. — desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126
desktop/src/features/agents/useAgentManagement.ts:42 · desktop/src/features/projects/useProjectChannelRequests.ts:25 — the two spans are one implementation copied and then locally edited — 328 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. — desktop/src/features/agents/useAgentManagement.ts:42
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 · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
desktop/scripts/check-file-sizes.mjs:4 reaches into another package with a relative path (../../scripts/check-file-sizes-core.mjs) — import the package by name instead. — desktop/scripts/check-file-sizes.mjs:4
desktop/scripts/check-pubkey-truncation.mjs:3 reaches into another package with a relative path (../../scripts/check-pubkey-truncation-core.mjs) — import the package by name instead. — desktop/scripts/check-pubkey-truncation.mjs:3
desktop/scripts/check-px-text.mjs:3 reaches into another package with a relative path (../../scripts/check-px-text-core.mjs) — import the package by name instead. — desktop/scripts/check-px-text.mjs:3
desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:31 imports desktop/src/features/onboarding/lib/keyImportInput.ts against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:31
desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:32 imports desktop/src/features/profile/ui/MemberSearchResult.tsx against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:32
desktop/src/features/admin-console/AdminConsoleCommunities.tsx:14 imports desktop/src/features/onboarding/lib/keyImportInput.ts against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsoleCommunities.tsx:14
desktop/src/features/admin-console/AdminConsolePanel.tsx:30 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsolePanel.tsx:30
desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:11 imports desktop/src/features/forum/lib/time.ts against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:11
desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:18 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:18
desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:33 imports desktop/src/features/settings/ui/SettingsSectionHeader.tsx against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:33
desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:23 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:23
desktop/src/features/admin-console/adminConsolePanel.test.mjs:461 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules. — desktop/src/features/admin-console/adminConsolePanel.test.mjs:461
desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:60 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules. — desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:60
desktop/src/features/agent-memory/hooks.ts:4 imports desktop/src/features/agents/hooks.ts against the feature-sliced rules. — desktop/src/features/agent-memory/hooks.ts:4
desktop/src/features/agents/hooks.ts:14 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules. — desktop/src/features/agents/hooks.ts:14
desktop/src/features/agents/hooks.ts:18 imports desktop/src/features/channels/channelMemberProfileCache.ts against the feature-sliced rules. — desktop/src/features/agents/hooks.ts:18
desktop/src/features/agents/hooks.ts:19 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules. — desktop/src/features/agents/hooks.ts:19
desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:61 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules. — desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:61
desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:68 imports desktop/src/features/profile/ui/UserProfilePanelDeletion.ts against the feature-sliced rules. — desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:68
desktop/src/features/agents/lib/personaEditCaches.ts:3 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules. — desktop/src/features/agents/lib/personaEditCaches.ts:3
desktop/src/features/agents/lib/useAgentAvailability.ts:3 imports desktop/src/features/presence/hooks.ts against the feature-sliced rules. — desktop/src/features/agents/lib/useAgentAvailability.ts:3
desktop/src/features/agents/managedAgentRuntimeHooks.ts:9 imports desktop/src/features/communities/communityStorage.ts against the feature-sliced rules. — desktop/src/features/agents/managedAgentRuntimeHooks.ts:9
desktop/src/features/agents/observerRelayStore.ts:14 imports desktop/src/features/projects/projectChannelRequest.ts against the feature-sliced rules. — desktop/src/features/agents/observerRelayStore.ts:14
desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:7 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:7
desktop/src/features/agents/ui/AddCustomHarnessDialog.tsx:1 imports desktop/src/features/settings/ui/CustomHarnessForm.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AddCustomHarnessDialog.tsx:1
desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:19 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:19
desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:20 imports desktop/src/features/profile/ui/ProfileAvatar.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:20
desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:16 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:16
desktop/src/features/agents/ui/AgentConfigFields.tsx:62 imports desktop/src/features/settings/ui/SettingsOptionGroup.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentConfigFields.tsx:62
desktop/src/features/agents/ui/AgentCreationPreview.tsx:6 imports desktop/src/features/profile/ui/MaskedAvatarBadgeFrame.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:6
desktop/src/features/agents/ui/AgentCreationPreview.tsx:7 imports desktop/src/features/profile/ui/ProfileAvatar.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:7
desktop/src/features/agents/ui/AgentCreationPreview.tsx:8 imports REDACTED against the feature-sliced rules. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:8
desktop/src/features/agents/ui/AgentCreationPreview.tsx:27 imports desktop/src/features/profile/ui/AvatarCustomColorPanel.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:27
desktop/src/features/agents/ui/AgentCreationPreview.tsx:28 imports desktop/src/features/profile/useAvatarUpload.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:28
desktop/src/features/agents/ui/AgentIdentityCard.tsx:3 imports desktop/src/features/profile/ui/ProfileAvatar.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentIdentityCard.tsx:3
desktop/src/features/agents/ui/AgentManagementDialogs.tsx:2 imports desktop/src/features/projects/ui/ProjectChannelRequestDialog.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentManagementDialogs.tsx:2
desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:4 imports desktop/src/features/profile/ui/MaskedAvatarBadgeFrame.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:4
desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:9 imports desktop/src/features/profile/ui/ProfileAvatar.tsx against the feature-sliced rules. — desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:9
desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:10 imports desktop/src/features/presence/lib/presence.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:10
desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx:4 imports desktop/src/app/navigation/useAppNavigation.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx:4
What to do
Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1120 rows); import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (5 rows).
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.
(anonymous) has cyclomatic complexity 658 and cognitive complexity 556; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — desktop/src/testing/e2eBridge.ts:12040
AgentConfigFields has cyclomatic complexity 122 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — desktop/src/features/agents/ui/AgentConfigFields.tsx:212
sendToMockSocket has cyclomatic complexity 118 and cognitive complexity 237; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — desktop/src/testing/e2eBridge.ts:10909
UserProfilePanel has cyclomatic complexity 112 and cognitive complexity 90; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — desktop/src/features/profile/ui/UserProfilePanel.tsx:105
ChannelPane has cyclomatic complexity 108 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — desktop/src/features/channels/ui/ChannelPane.tsx:78
AnimatedAvatarCapture has cyclomatic complexity 98 and cognitive complexity 91; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:71
processTranscriptEvent has cyclomatic complexity 97 and cognitive complexity 166; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — desktop/src/features/agents/ui/agentSessionTranscript.ts:700
ProjectDetailScreen has cyclomatic complexity 95 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — desktop/src/features/projects/ui/ProjectDetailScreen.tsx:87
(anonymous) has cyclomatic complexity 91 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. — desktop/tests/e2e/projects-v3-screenshots.spec.ts:280
AgentCreationPreview has cyclomatic complexity 87 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:47
ProfileAvatarEditor has cyclomatic complexity 85 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:67
MessageTimeline has cyclomatic complexity 81 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/messages/ui/MessageTimeline.tsx:162
ProfileSummaryView has cyclomatic complexity 70 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/profile/ui/UserProfilePanelSections.tsx:136
AgentDefinitionDialog has cyclomatic complexity 69 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128
NostrKeyImportForm has cyclomatic complexity 68 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. — desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:60
ProjectRepositoryActionsPanel has cyclomatic complexity 68 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/projects/ui/ProjectRepositoryActionsPanel.tsx:139
UserProfilePopoverBody has cyclomatic complexity 68 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/profile/ui/UserProfilePopover.tsx:257
MessageRow has cyclomatic complexity 67 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/messages/ui/MessageRow.tsx:72
apply has cyclomatic complexity 64 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — desktop/src/features/huddle/lib/huddlePresence.ts:260
InboxMessageDetailPane has cyclomatic complexity 61 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — desktop/src/features/home/ui/InboxDetailPane.tsx:166
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files5.2 / 10Adequate✓ 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.
desktop/src/testing/e2eBridge.ts has 14703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/testing/e2eBridge.ts:1
desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs has 2667 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs:1
desktop/src/shared/ui/VideoPlayer.tsx has 2094 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/ui/VideoPlayer.tsx:1
desktop/src/shared/ui/markdown.tsx has 1751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/ui/markdown.tsx:1
desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs has 1561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1
desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs has 1434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs:1
desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx has 1164 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:1
desktop/src/features/onboarding/ui/SetupStep.tsx has 1127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/onboarding/ui/SetupStep.tsx:1
desktop/src/features/agents/ui/agentSessionTranscript.ts has 1126 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/agentSessionTranscript.ts:1
desktop/src/shared/api/relayClientSession.ts has 1097 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/api/relayClientSession.ts:1
desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs has 1035 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs:1
desktop/src/features/profile/ui/ProfileAvatarEditor.tsx has 1021 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:1
desktop/src/features/messages/ui/MessageComposer.tsx has 1012 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/MessageComposer.tsx:1
desktop/src/features/agents/ui/AgentDefinitionDialog.tsx has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:1
desktop/src/features/agents/ui/AgentCreationPreview.tsx has 1002 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentCreationPreview.tsx:1
desktop/src/features/agents/ui/AgentConfigFields.tsx has 999 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentConfigFields.tsx:1
desktop/src/features/channels/ui/ChannelScreen.tsx has 995 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/ui/ChannelScreen.tsx:1
desktop/src/features/channels/ui/ChannelPane.tsx has 994 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/ui/ChannelPane.tsx:1
desktop/src/features/messages/ui/useMentionSendFlow.ts has 992 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/useMentionSendFlow.ts:1
desktop/src/features/projects/ui/ProjectDetailScreen.tsx has 988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/projects/ui/ProjectDetailScreen.tsx:1
desktop/src/app/AppShell.tsx has 987 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/app/AppShell.tsx:1
desktop/src/features/messages/ui/MessageRow.tsx has 981 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/MessageRow.tsx:1
desktop/src/features/home/ui/HomeView.tsx has 980 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/home/ui/HomeView.tsx:1
admin-web/src/App.tsx has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — admin-web/src/App.tsx:1
desktop/src/shared/api/tauri.ts has 966 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/api/tauri.ts:1
desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx has 965 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:1
desktop/src/features/profile/ui/UserProfilePanel.tsx has 960 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/profile/ui/UserProfilePanel.tsx:1
desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx has 954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx:1
desktop/src/features/messages/lib/useMentions.ts has 953 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/lib/useMentions.ts:1
desktop/src/features/channels/ui/ChannelManagementSheet.tsx has 952 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/ui/ChannelManagementSheet.tsx:1
desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:1
desktop/src/features/projects/ui/ProjectsView.tsx has 948 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/projects/ui/ProjectsView.tsx:1
desktop/src/features/admin-console/AdminConsoleReportsTab.tsx has 945 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:1
desktop/src/shared/ui/sidebar.tsx has 940 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/shared/ui/sidebar.tsx:1
desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1
desktop/src/features/channels/useUnreadChannels.ts has 931 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/channels/useUnreadChannels.ts:1
desktop/src/features/search/ui/TopbarSearch.tsx has 929 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/search/ui/TopbarSearch.tsx:1
desktop/src/features/messages/ui/SystemMessageRow.tsx has 923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/SystemMessageRow.tsx:1
desktop/src/features/sidebar/ui/AppSidebar.tsx has 922 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/sidebar/ui/AppSidebar.tsx:1
desktop/src/features/messages/ui/useAnchoredScroll.ts has 920 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — desktop/src/features/messages/ui/useAnchoredScroll.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.7 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — desktop/src/protectedFeatures/bestie/BestiePopover.tsx:1, desktop/src/features/agents/ui/ManagedAgentRow.tsx:1, desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code7.8 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 80 application, 32 tooling and 943 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (80 application, 32 tooling, 943 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (desktop/src/features/agents/ui/AgentGroupRows.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — desktop/src/features/agents/ui/ManagedAgentRow.tsx
no import path from any entry point (80 application, 32 tooling, 943 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 (×33) — desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx, desktop/src/features/agents/ui/ModelPicker.tsx, desktop/src/features/community-members/ui/CommunityMembersCard.tsx, …
no import path from any entry point (80 application, 32 tooling, 943 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (desktop/src/features/community-members/ui/CommunityMembersCard.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — desktop/src/features/community-members/ui/ConfirmRemoveDialog.tsx
Nothing imports this binding — it is safe to review for removal. (×4) — desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:356, desktop/src/features/admin-console/api.ts:626, desktop/src/features/agents/hooks.ts:646, …
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 desktop/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — deploy/compose/Caddyfile:4
What to do
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document2.7 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`validTree` is exported and takes `node: unknown` from its caller, and it calls itself at line 187 (`validTree`) with a piece of `node` — and nowhere in `validTree` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `validTree` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — desktop/src/features/sidebar/lib/sidebarLwwMap.ts:187
`canonical` is exported and takes `value: unknown` from its caller, and it calls itself at line 195 (`canonical`) with a piece of `value` (and at line 200) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — desktop/src/features/sidebar/lib/sidebarLwwMap.ts:195
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether functions that make a cancellable request accept or pass on an AbortSignal or a CancelToken (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 11/21 functions that make a cancellable request (fetch, axios, ky, ofetch; Dio, AbortableRequest) accept an AbortSignal or a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Dart: `CancelToken? cancelToken`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`resolveBuzzDownloadUrlForPlatform` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/shared/lib/buzz-download.ts:160
`ensureClone` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/features/repos/git-client.ts:68
`acceptPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/features/invite/ui/InvitePage.tsx:92
`getJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/shared/api/invites.ts:131
`acceptJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/shared/api/invites.ts:170
`moderationGet` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/shared/api/moderation.ts:237
`tick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/features/sidebar/lib/useStaleReaderRecovery.ts:89
`fetchAvatarDataUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — desktop/src/features/profile/lib/selfProfileStorage.ts:378
`doRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — admin-web/src/api.ts:94
`probeAuthMode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — admin-web/src/api.ts:157
What to do
Thread an AbortSignal or a CancelToken through functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). 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 a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped6.6 / 10Adequate✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`escapeHtml(attachment.url)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:64
`svgHtml` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:31
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … in` loop leaves the `List`, `Map` or `Set` it is walking alone — Dart's collection iterators check that the collection has not changed since the loop began, so a body that adds to or removes from the very collection the loop is walking (or the map whose `keys`, `values` or `entries` it walks) makes the next step throw `ConcurrentModificationError` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×10) — web/src/shared/lib/buzz-download.ts:119, web/src/shared/lib/buzz-download.ts:181, web/src/shared/lib/buzz-download.ts:204, …
`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. — web/src/shared/lib/nostr-client.ts:84
`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. (×28) — mobile/lib/shared/utils/string_utils.dart:30, mobile/lib/shared/theme/community_theme_preference.dart:100, mobile/lib/shared/theme/community_theme_sync.dart:322, …
`on 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. — mobile/lib/shared/relay/media_upload.dart:841
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:93
`warn!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:113
`warn!` at line 121 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:121
`warn!` at line 130 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:130
`warn!` at line 137 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:137
`warn!` at line 144 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:144
`warn!` at line 480 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/custom_harnesses.rs:480
`warn!` at line 1156 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — desktop/src-tauri/src/managed_agents/discovery.rs:1156
`debug!` at line 86 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-ws-client/src/connection.rs:86
`debug!` at line 152 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-ws-client/src/connection.rs:152
`info!` at line 619 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:619
`warn!` at line 656 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:656
`info!` at line 668 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:668
`info!` at line 701 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:701
`info!` at line 731 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:731
`info!` at line 758 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:758
`debug!` at line 856 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:856
`warn!` at line 1133 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:1133
`warn!` at line 1208 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/executor.rs:1208
`error!` at line 253 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:253
`error!` at line 272 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:272
`error!` at line 280 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:280
`error!` at line 299 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:299
`error!` at line 366 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:366
`warn!` at line 375 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:375
`warn!` at line 398 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:398
`error!` at line 418 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:418
`error!` at line 501 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:501
`warn!` at line 515 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:515
`warn!` at line 575 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:575
`warn!` at line 611 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:611
`error!` at line 642 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:642
`error!` at line 660 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:660
`error!` at line 680 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:680
`warn!` at line 700 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:700
`warn!` at line 779 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:779
`warn!` at line 816 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:816
`warn!` at line 845 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:845
`warn!` at line 922 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-workflow/src/lib.rs:922
`warn!` at line 1036 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/buzz-relay/src/config.rs:1036
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
3/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 9 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: 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.
Not included — 36 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.
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. Dart isolates share no mutable memory, so no two requests write one object at the same instant. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 18 — an image could not be pulled) — adminer Pulling keycloak Pulling prometheus Pulling postgres Pulling prometheus Error Get "https://registry-1.docker.io/v2/": Forbidden minio Error context canceled keycloak Error context canceled adminer Error context canceled postgres Error context canceled redis Error context canceled minio-init Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: keycloak Pulling minio Pulling prometheus Pulling postgres Pulling adminer Error Get "https://registry-1.docker.io/v2/": Forbidden minio-init Error context canceled keycloak Error context canceled redis Error context canceled prometheus Error context canceled minio Error context canceled postgres Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — 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 measured — JavaScript/TypeScript suite did not run
D12 Dependency Hygiene — Not scored — 2 Maven/Gradle manifest(s) were read, stating a version for 2 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.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; Dart, JavaScript, Kotlin, Python, Rust, Swift, TypeScript not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .dart, .kt, .py, .rs, .swift, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 34 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — Not assessed, and this one is on us: 1 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC2 · Forms & labels· <input> without a programmatic label · ×14
<input> without a programmatic label desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:445— 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 desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:690— 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 desktop/src/features/admin-console/AdminConsoleCommunities.tsx:157— 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 desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:496— 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 desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:629— 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 desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:620— 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 desktop/src/features/agents/ui/AgentCreationPreview.tsx:499— 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 desktop/src/features/agents/ui/AgentSessionToolItem/TodoToolSummary.tsx:96— 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 desktop/src/features/community-members/ui/CommunityMembersSettingsCard.tsx:336— 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 desktop/src/features/onboarding/ui/BackupTestFlow.tsx:530— 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 desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:415— 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 desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:725— 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 desktop/src/features/settings/ui/BackupTestFlow.tsx:301— 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 desktop/src/features/user-status/ui/SetStatusDialog.tsx:407— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels· <select> without a programmatic label · ×5
<select> without a programmatic label desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:629— 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 desktop/src/features/agents/ui/agentConfigControls.tsx:547— 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 desktop/src/features/agents/ui/agentConfigControls.tsx:641— 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 desktop/src/features/settings/ui/ChannelTemplatesSettingsCard.tsx:776— 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 desktop/src/features/workflows/ui/workflowFormPrimitives.tsx:19— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <button> with no accessible text · ×3
<button> with no accessible text desktop/src/features/channels/ui/MembersSidebarAgentControls.tsx:33— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text desktop/src/features/channels/ui/MembersSidebarMemberCard.tsx:364— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text desktop/src/features/forum/ui/DeleteActionMenu.tsx:27— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×3
Click handler on a non-interactive <div> desktop/src/features/communities/ui/CommunityChangeOverlay.tsx:76— 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> desktop/src/features/home/ui/InboxListPane.tsx:373— 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> desktop/src/shared/ui/OverlayPanelBackdrop.tsx:34— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×3
Clickable element isn't keyboard-operable desktop/src/features/profile/ui/AnimatedAvatarControls.tsx:248— The repo's own CSS styles .buzz-avatar-framing-slider-hashmark with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable desktop/src/shared/ui/markdown/SpoilerInline.tsx:84— The repo's own CSS styles .buzz-spoiler with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable desktop/src/shared/ui/markdown/SpoilerInline.tsx:100— The repo's own CSS styles .buzz-spoiler with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
AC2 · Forms & labels· Custom control with no accessible name on <video> · ×2
Custom control with no accessible name on <video> desktop/src/shared/ui/VideoPlayer.tsx:992— This <video> 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.
Custom control with no accessible name on <video> desktop/src/shared/ui/VideoPlayer.tsx:1698— This <video> 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.
AC4 · Keyboard semantics· Click handler on a non-interactive <video> · ×2
Click handler on a non-interactive <video> desktop/src/shared/ui/VideoPlayer.tsx:992— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <video> desktop/src/shared/ui/VideoPlayer.tsx:1698— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Import cycle (2 files) desktop/src/shared/api/editMessage.ts:1— desktop/src/shared/api/editMessage.ts → desktop/src/shared/api/tauri.ts → desktop/src/shared/api/editMessage.ts (one verified cycle inside a mutually-dependent group of 6 files)
AC3 · Page structure· Document <title> is empty · ×1
Document <title> is empty desktop/index.html:2— An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
AC4 · Keyboard semantics· Click handler on a non-interactive <img> · ×1
Click handler on a non-interactive <img> desktop/src/features/agents/ui/AgentSessionToolItem/ViewImageToolPreview.tsx:25— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Captive dependency: keepAlive provider currentCommunityRoleProvider captures autoDispose communityMembershipProvider mobile/lib/shared/community/community_membership_provider.dart:119— `currentCommunityRoleProvider` is a keep-alive Riverpod provider and calls `ref.watch(communityMembershipProvider…)`, which is declared auto-dispose (mobile/lib/shared/community/community_membership_provider.dart:107). The keep-alive provider listens to it for the life of the ProviderContainer, so `communityMembershipProvider` is never disposed — the auto-dispose lifetime it declares never happens, and whatever it holds (a socket, a controller, a stale value) is kept for every later reader. Mark `communityMembershipProvider` keepAlive too, make `currentCommunityRoleProvider` auto-dispose, or read it per use outside build.
AX9 · CQS / query purity· Query writes persistent state on the read path · ×1
Query writes persistent state on the read path: CommunityStorage.loadAll mobile/lib/shared/community/community_storage.dart:38— `CommunityStorage.loadAll` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
FunctionTooLong: buzz_relay::audio::handler::run_active_audio_connection crates/buzz-relay/src/audio/handler.rs:528— FunctionTooLong — buzz_relay::audio::handler::run_active_audio_connection runs 1053 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 953 over it, 10.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buzz_acp::run_harness crates/buzz-acp/src/lib.rs:2838— FunctionTooLong — buzz_acp::run_harness runs 888 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 788 over it, 8.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AgentInstanceEditDialog.AgentInstanceEditDialog desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:102— FunctionTooLong — AgentInstanceEditDialog runs 842 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 742 over it, 8.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buzz_relay::run_relay_main crates/buzz-relay/src/main.rs:381— FunctionTooLong — buzz_relay::run_relay_main runs 839 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 739 over it, 8.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ChannelPane.ChannelPane desktop/src/features/channels/ui/ChannelPane.tsx:78— FunctionTooLong — ChannelPane runs 835 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 735 over it, 8.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buzz_acp::pool::run_prompt_task crates/buzz-acp/src/pool.rs:2415— FunctionTooLong — buzz_acp::pool::run_prompt_task runs 826 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 726 over it, 8.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ProfileAvatarEditor.ProfileAvatarEditor desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:67— FunctionTooLong — ProfileAvatarEditor runs 817 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 717 over it, 8.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ChannelScreen.ChannelScreen desktop/src/features/channels/ui/ChannelScreen.tsx:90— FunctionTooLong — ChannelScreen runs 816 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 716 over it, 8.16× 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: MessageComposer.MessageComposerImpl desktop/src/features/messages/ui/MessageComposer.tsx:70— FunctionTooLong — MessageComposerImpl runs 813 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 713 over it, 8.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AgentCreationPreview.AgentCreationPreview desktop/src/features/agents/ui/AgentCreationPreview.tsx:47— FunctionTooLong — AgentCreationPreview runs 810 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 710 over it, 8.10× 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: ProjectDetailScreen.ProjectDetailScreen desktop/src/features/projects/ui/ProjectDetailScreen.tsx:87— FunctionTooLong — ProjectDetailScreen runs 774 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 674 over it, 7.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: buzz_relay::handlers::ingest::ingest_event_inner crates/buzz-relay/src/handlers/ingest.rs:2533— FunctionTooLong — buzz_relay::handlers::ingest::ingest_event_inner runs 761 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 661 over it, 7.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: AnimatedAvatarCapture.AnimatedAvatarCapture desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:71— FunctionTooLong — AnimatedAvatarCapture runs 761 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 661 over it, 7.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: HomeView.HomeView desktop/src/features/home/ui/HomeView.tsx:101— FunctionTooLong — HomeView runs 751 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 651 over it, 7.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AgentDefinitionDialog.AgentDefinitionDialog desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128— FunctionTooLong — AgentDefinitionDialog runs 747 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 647 over it, 7.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useMentionSendFlow.useMentionSendFlow desktop/src/features/messages/ui/useMentionSendFlow.ts:51— FunctionTooLong — useMentionSendFlow runs 744 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 644 over it, 7.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AppShell.AppShell desktop/src/app/AppShell.tsx:110— FunctionTooLong — AppShell runs 736 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 636 over it, 7.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: UserProfilePanel.UserProfilePanel desktop/src/features/profile/ui/UserProfilePanel.tsx:105— FunctionTooLong — UserProfilePanel runs 731 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 631 over it, 7.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: AppSidebar.AppSidebar desktop/src/features/sidebar/ui/AppSidebar.tsx:80— FunctionTooLong — AppSidebar runs 730 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 630 over it, 7.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: VideoPlayer.VideoReviewDialog desktop/src/shared/ui/VideoPlayer.tsx:1198— FunctionTooLong — VideoReviewDialog runs 717 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 617 over it, 7.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useMentions.useMentions desktop/src/features/messages/lib/useMentions.ts:76— FunctionTooLong — useMentions runs 699 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 599 over it, 6.99× 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: ProjectsView.ProjectsView desktop/src/features/projects/ui/ProjectsView.tsx:111— FunctionTooLong — ProjectsView runs 690 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 590 over it, 6.90× 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: AgentConfigFields.AgentConfigFields desktop/src/features/agents/ui/AgentConfigFields.tsx:212— FunctionTooLong — AgentConfigFields runs 683 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 583 over it, 6.83× 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: MessageThreadPanel.MessageThreadPanel desktop/src/features/messages/ui/MessageThreadPanel.tsx:145— FunctionTooLong — MessageThreadPanel runs 654 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 554 over it, 6.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buzz_desktop::run desktop/src-tauri/src/lib.rs:101— FunctionTooLong — buzz_desktop::run runs 651 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 551 over it, 6.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: desktop/src/testing/e2eBridge.ts desktop/src/testing/e2eBridge.ts:11427— desktop/src/testing/e2eBridge.ts changed 99 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 598 in e2eBridge.maybeInstallE2eTauriMocks at line 11427. 34 of those changes were fix/bug commits, and the other 65 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/testing/e2eBridge.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/buzz-acp/src/lib.rs crates/buzz-acp/src/lib.rs:2838— crates/buzz-acp/src/lib.rs changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 171 in buzz_acp::run_harness at line 2838. 20 of those changes were fix/bug commits, and the other 23 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-acp/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: mobile/lib/features/channels/channel_detail_page.dart mobile/lib/features/channels/channel_detail_page.dart:285— mobile/lib/features/channels/channel_detail_page.dart changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in _ResolvedChannelDetailPage.build at line 285. 13 of those changes were fix/bug commits, and the other 35 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/channels/channel_detail_page.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/buzz-relay/src/handlers/ingest.rs crates/buzz-relay/src/handlers/ingest.rs:2533— crates/buzz-relay/src/handlers/ingest.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 156 in buzz_relay::handlers::ingest::ingest_event_inner at line 2533. 9 of those changes were fix/bug commits, and the other 26 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-relay/src/handlers/ingest.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: mobile/lib/features/channels/thread_detail_page.dart mobile/lib/features/channels/thread_detail_page.dart:110— mobile/lib/features/channels/thread_detail_page.dart changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 152 in ThreadDetailPage.build at line 110. 10 of those changes were fix/bug commits, and the other 23 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/channels/thread_detail_page.dart`: 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: mobile/lib/features/channels/channel_detail_page/message_list.dart mobile/lib/features/channels/channel_detail_page/message_list.dart:50— mobile/lib/features/channels/channel_detail_page/message_list.dart changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 203 in _MessageList.build at line 50. 6 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/channels/channel_detail_page/message_list.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/buzz-relay/src/main.rs crates/buzz-relay/src/main.rs:381— crates/buzz-relay/src/main.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 97 in buzz_relay::run_relay_main at line 381. 10 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-relay/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: desktop/src/features/channels/ui/ChannelPane.tsx desktop/src/features/channels/ui/ChannelPane.tsx:78— desktop/src/features/channels/ui/ChannelPane.tsx changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in ChannelPane.ChannelPane at line 78. 11 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/channels/ui/ChannelPane.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: crates/buzz-relay/src/api/bridge.rs crates/buzz-relay/src/api/bridge.rs:1495— crates/buzz-relay/src/api/bridge.rs changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in buzz_relay::api::bridge::query_member_events at line 1495. 13 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-relay/src/api/bridge.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: desktop/src/features/messages/ui/MessageComposer.tsx desktop/src/features/messages/ui/MessageComposer.tsx:70— desktop/src/features/messages/ui/MessageComposer.tsx changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in MessageComposer.MessageComposerImpl at line 70. 14 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/messages/ui/MessageComposer.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: crates/buzz-acp/src/pool.rs crates/buzz-acp/src/pool.rs:2415— crates/buzz-acp/src/pool.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in buzz_acp::pool::run_prompt_task at line 2415. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-acp/src/pool.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/buzz-relay/src/audio/handler.rs crates/buzz-relay/src/audio/handler.rs:528— crates/buzz-relay/src/audio/handler.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in buzz_relay::audio::handler::run_active_audio_connection at line 528. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-relay/src/audio/handler.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: desktop/src-tauri/src/lib.rs desktop/src-tauri/src/lib.rs:101— desktop/src-tauri/src/lib.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in buzz_desktop::run at line 101. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src-tauri/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: mobile/lib/features/channels/channels_page.dart mobile/lib/features/channels/channels_page.dart:145— mobile/lib/features/channels/channels_page.dart changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in ChannelsPage.build at line 145. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/channels/channels_page.dart`: 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: desktop/src/shared/ui/markdown.tsx desktop/src/shared/ui/markdown.tsx:149— desktop/src/shared/ui/markdown.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in markdown.ImageZoomOverlay at line 149. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/shared/ui/markdown.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: crates/buzz-relay/src/config.rs crates/buzz-relay/src/config.rs:633— crates/buzz-relay/src/config.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in Config::from_env at line 633. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-relay/src/config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: desktop/src/features/profile/ui/UserProfilePanel.tsx desktop/src/features/profile/ui/UserProfilePanel.tsx:105— desktop/src/features/profile/ui/UserProfilePanel.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 148 in UserProfilePanel.UserProfilePanel at line 105. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/profile/ui/UserProfilePanel.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: crates/buzz-relay/src/handlers/side_effects.rs crates/buzz-relay/src/handlers/side_effects.rs:544— crates/buzz-relay/src/handlers/side_effects.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in buzz_relay::handlers::side_effects::validate_admin_event at line 544. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-relay/src/handlers/side_effects.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: desktop/src/features/messages/ui/MessageRow.tsx desktop/src/features/messages/ui/MessageRow.tsx:72— desktop/src/features/messages/ui/MessageRow.tsx changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in MessageRow.MessageRow at line 72. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/messages/ui/MessageRow.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: desktop/src/features/messages/ui/useMentionSendFlow.ts desktop/src/features/messages/ui/useMentionSendFlow.ts:284— desktop/src/features/messages/ui/useMentionSendFlow.ts changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in useMentionSendFlow.useMentionSendFlow.completeSend at line 284. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/messages/ui/useMentionSendFlow.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: desktop/src/features/messages/ui/MessageThreadPanel.tsx desktop/src/features/messages/ui/MessageThreadPanel.tsx:145— desktop/src/features/messages/ui/MessageThreadPanel.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in MessageThreadPanel.MessageThreadPanel at line 145. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/messages/ui/MessageThreadPanel.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: desktop/src/features/channels/ui/MembersSidebar.tsx desktop/src/features/channels/ui/MembersSidebar.tsx:138— desktop/src/features/channels/ui/MembersSidebar.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in MembersSidebar.MembersSidebar at line 138. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/channels/ui/MembersSidebar.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: desktop/src/app/AppShell.tsx desktop/src/app/AppShell.tsx:110— desktop/src/app/AppShell.tsx changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in AppShell.AppShell at line 110. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/app/AppShell.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: crates/buzz-db/src/store/event.rs crates/buzz-db/src/store/event.rs:603— crates/buzz-db/src/store/event.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in buzz_db::store::event::build_query_events_sql at line 603. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-db/src/store/event.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: desktop/src/features/agents/ui/AgentDefinitionDialog.tsx desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128— desktop/src/features/agents/ui/AgentDefinitionDialog.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in AgentDefinitionDialog.AgentDefinitionDialog at line 128. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/agents/ui/AgentDefinitionDialog.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.
FileTooLong: src/lib.rs crates/buzz-acp/src/lib.rs— FileTooLong — 3400 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 72 free functions. The bar is 500 significant lines; this is 2900 over it, 6.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/pool.rs crates/buzz-acp/src/pool.rs— FileTooLong — 3085 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 2585 over it, 6.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 2813 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: DeletionStore (2 blocks, 751-3315). The bar is 500 significant lines; this is 2313 over it, 5.63× 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: handlers/side_effects.rs crates/buzz-relay/src/handlers/side_effects.rs— FileTooLong — 2532 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 76 free functions. The bar is 500 significant lines; this is 2032 over it, 5.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/relay.rs crates/buzz-acp/src/relay.rs— FileTooLong — 2429 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 1929 over it, 4.86× 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: handlers/ingest.rs crates/buzz-relay/src/handlers/ingest.rs— FileTooLong — 2213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 54 free functions. The bar is 500 significant lines; this is 1713 over it, 4.43× 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: audio/handler.rs crates/buzz-relay/src/audio/handler.rs— FileTooLong — 2109 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 1609 over it, 4.22× 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/bridge.rs crates/buzz-relay/src/api/bridge.rs— FileTooLong — 1967 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 1467 over it, 3.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/main.rs crates/buzz-relay/src/main.rs— FileTooLong — 1827 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 1327 over it, 3.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ui/VideoPlayer.tsx desktop/src/shared/ui/VideoPlayer.tsx— FileTooLong — 1789 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1289 over it, 3.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: store/event.rs crates/buzz-db/src/store/event.rs— FileTooLong — 1778 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 46 free functions. The bar is 500 significant lines; this is 1278 over it, 3.56× 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: store/relay_admin_actions.rs crates/buzz-db/src/store/relay_admin_actions.rs— FileTooLong — 1595 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 1095 over it, 3.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: store/channel_members.rs crates/buzz-db/src/store/channel_members.rs— FileTooLong — 1505 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 39 free functions. The bar is 500 significant lines; this is 1005 over it, 3.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/llm.rs crates/buzz-agent/src/llm.rs— FileTooLong — 1493 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 48 free functions. The bar is 500 significant lines; this is 993 over it, 2.99× 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/markdown.tsx desktop/src/shared/ui/markdown.tsx— FileTooLong — 1440 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 940 over it, 2.88× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/builders.rs crates/buzz-sdk/src/builders.rs— FileTooLong — 1394 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 85 free functions. The bar is 500 significant lines; this is 894 over it, 2.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs crates/buzz-deletion/src/lib.rs— FileTooLong — 1326 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 826 over it, 2.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs crates/buzz-cli/src/lib.rs— FileTooLong — 1305 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 805 over it, 2.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/queue.rs crates/buzz-acp/src/queue.rs— FileTooLong — 1302 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 802 over it, 2.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: src/state.rs crates/buzz-relay/src/state.rs— FileTooLong — 1301 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 801 over it, 2.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: commands/channels.rs crates/buzz-cli/src/commands/channels.rs— FileTooLong — 1269 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 769 over it, 2.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/acp.rs crates/buzz-acp/src/acp.rs— FileTooLong — 1235 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 72% of them inside a single declaration: AcpClient (3 blocks, 148-2394). The bar is 500 significant lines; this is 735 over it, 2.47× 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: store/channel.rs crates/buzz-db/src/store/channel.rs— FileTooLong — 1206 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 706 over it, 2.41× 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: store/workflow.rs crates/buzz-db/src/store/workflow.rs— FileTooLong — 1181 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 681 over it, 2.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: git/transport.rs crates/buzz-relay/src/api/git/transport.rs— FileTooLong — 1166 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 666 over it, 2.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
MethodTooLong: ComposeBar.build mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:33— MethodTooLong — build runs 809 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 709 over it, 8.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _MessageList.build mobile/lib/features/channels/channel_detail_page/message_list.dart:50— MethodTooLong — build runs 806 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 706 over it, 8.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ThreadDetailPage.build mobile/lib/features/channels/thread_detail_page.dart:110— MethodTooLong — build runs 705 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 605 over it, 7.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Config.from_env crates/buzz-relay/src/config.rs:633— MethodTooLong — from_env runs 592 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 492 over it, 5.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _ResolvedChannelDetailPage.build mobile/lib/features/channels/channel_detail_page.dart:285— MethodTooLong — build runs 532 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 432 over it, 5.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AnimatedAvatarCapture.build mobile/lib/features/profile/animated_avatar_capture.dart:68— MethodTooLong — build runs 477 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 377 over it, 4.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ChannelDetailsPage.build mobile/lib/features/channels/channel_details_page.dart:41— MethodTooLong — build runs 474 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 374 over it, 4.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.
MethodTooLong: ImageAvatarCapture.build mobile/lib/features/profile/image_avatar_capture.dart:84— MethodTooLong — build runs 443 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 343 over it, 4.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: ProfileEditPage.build mobile/lib/features/profile/profile_edit_page.dart:51— MethodTooLong — build runs 369 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× 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: ProfileAvatarEditor.build mobile/lib/features/profile/profile_avatar_editor.dart:133— MethodTooLong — build runs 368 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 268 over it, 3.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _MessageBubble.build mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40— MethodTooLong — build runs 342 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 242 over it, 3.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ChannelsPage.build mobile/lib/features/channels/channels_page.dart:145— MethodTooLong — build runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MediaImageViewerPage.build mobile/lib/features/channels/media_viewer_page.dart:201— MethodTooLong — build runs 321 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _ThreadMessage.build mobile/lib/features/channels/thread_detail_page/thread_message.dart:41— MethodTooLong — build runs 320 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 220 over it, 3.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ActivityPage.build mobile/lib/features/activity/activity_page.dart:75— MethodTooLong — build runs 319 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 219 over it, 3.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _PairingWelcomeView.build mobile/lib/features/pairing/pairing_page/pairing_welcome_view.dart:56— MethodTooLong — build runs 309 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BeeRefreshIndicator.build mobile/lib/shared/widgets/bee_refresh_indicator.dart:57— MethodTooLong — build runs 303 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 203 over it, 3.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CommunitySwitcherPage.build mobile/lib/features/channels/channels_page/community_switcher.dart:90— MethodTooLong — build runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.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.
MethodTooLong: _NewDirectMessageSheet.build mobile/lib/features/channels/channels_page/sheets.dart:441— MethodTooLong — build runs 274 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 174 over it, 2.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.
MethodTooLong: AddChannelMembersSheet.build mobile/lib/features/channels/add_members_sheet.dart:77— MethodTooLong — build runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MessageContent.build mobile/lib/features/channels/message_content.dart:198— MethodTooLong — build runs 269 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 169 over it, 2.69× 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: MediaVideoViewerPage.build mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19— MethodTooLong — build runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ProfileAvatarCropPage.build mobile/lib/features/profile/profile_avatar_crop_page.dart:23— MethodTooLong — build 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.
MethodTooLong: IosNavigationBar.build mobile/lib/shared/widgets/ios_navigation_bar.dart:162— MethodTooLong — build runs 242 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 142 over it, 2.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: _SystemMessageRow.build mobile/lib/features/channels/channel_detail_page/system_rows.dart:26— MethodTooLong — build runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
buzz_desktop::huddle::playout::run_playout_recv_loop (cognitive 175) desktop/src-tauri/src/huddle/playout.rs:273— buzz_desktop::huddle::playout::run_playout_recv_loop has cognitive complexity 175 (threshold 15). Drivers by points: if/else 27 (127 pts), loops 7 (29 pts), match/switch 5 (18 pts), boolean chains 1 (nesting depth added 135). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_desktop::huddle::tts::tts_worker (cognitive 149) desktop/src-tauri/src/huddle/tts.rs:322— buzz_desktop::huddle::tts::tts_worker has cognitive complexity 149 (threshold 15). Drivers by points: if/else 43 (112 pts), match/switch 12 (22 pts), boolean chains 8, loops 4 (7 pts) (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::commands::pairing::pairing_ws_task_inner (cognitive 137) desktop/src-tauri/src/commands/pairing.rs:351— buzz_desktop::commands::pairing::pairing_ws_task_inner has cognitive complexity 137 (threshold 15). Drivers by points: if/else 28 (117 pts), match/switch 4 (18 pts), boolean chains 1, loops 1 (nesting depth added 103). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_desktop::migration::sync_shared_agent_data (cognitive 104) desktop/src-tauri/src/migration.rs:785— buzz_desktop::migration::sync_shared_agent_data has cognitive complexity 104 (threshold 15). Drivers by points: if/else 27 (81 pts), loops 7 (19 pts), boolean chains 2, match/switch 2 (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_desktop::native_relay_client::run_connection (cognitive 97) desktop/src-tauri/src/native_relay_client.rs:522— buzz_desktop::native_relay_client::run_connection has cognitive complexity 97 (threshold 15). Drivers by points: if/else 21 (82 pts), loops 3 (7 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file (cognitive 62) desktop/src-tauri/src/migration/pollen.rs:21— buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (53 pts), boolean chains 7, loops 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::run (cognitive 59) desktop/src-tauri/src/lib.rs:101— buzz_desktop::run has cognitive complexity 59 (threshold 15). Drivers by points: if/else 33 (47 pts), boolean chains 5, loops 3 (4 pts), match/switch 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::managed_agents::backend::invoke_provider (cognitive 59) desktop/src-tauri/src/managed_agents/backend.rs:76— buzz_desktop::managed_agents::backend::invoke_provider has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (31 pts), match/switch 7 (17 pts), loops 7 (11 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::huddle::start_huddle (cognitive 53) desktop/src-tauri/src/huddle/mod.rs:189— buzz_desktop::huddle::start_huddle has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (45 pts), match/switch 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::commands::team_snapshot::confirm_team_snapshot_import (cognitive 49) desktop/src-tauri/src/commands/team_snapshot.rs:511— buzz_desktop::commands::team_snapshot::confirm_team_snapshot_import has cognitive complexity 49 (threshold 15). Drivers by points: match/switch 9 (21 pts), if/else 11 (17 pts), loops 9 (11 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::reset::run_boot_reset_with_keychain (cognitive 49) desktop/src-tauri/src/reset.rs:185— buzz_desktop::reset::run_boot_reset_with_keychain has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (46 pts), boolean chains 2, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::unread_catch_up::classify_batch (cognitive 46) desktop/src-tauri/src/unread_catch_up.rs:250— buzz_desktop::unread_catch_up::classify_batch has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (34 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::commands::agent_models::normalize_agent_models (cognitive 44) desktop/src-tauri/src/commands/agent_models.rs:710— buzz_desktop::commands::agent_models::normalize_agent_models has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (35 pts), loops 3 (9 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_desktop::commands::agent_models_update::update_managed_agent (cognitive 43) desktop/src-tauri/src/commands/agent_models_update.rs:143— buzz_desktop::commands::agent_models_update::update_managed_agent has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::commands::agents::create_managed_agent_in (cognitive 43) desktop/src-tauri/src/commands/agents.rs:400— buzz_desktop::commands::agents::create_managed_agent_in has cognitive complexity 43 (threshold 15). Drivers by points: if/else 27 (30 pts), match/switch 3 (6 pts), boolean chains 5, loops 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buzz_desktop::media_proxy::handle_buzz_media (cognitive 43) desktop/src-tauri/src/media_proxy.rs:190— buzz_desktop::media_proxy::handle_buzz_media has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (37 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_desktop::app_state::resolve_identity_with_store (cognitive 42) desktop/src-tauri/src/app_state.rs:383— buzz_desktop::app_state::resolve_identity_with_store has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 3 (9 pts), boolean chains 2 (nesting depth added 26). 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.
buzz_desktop::managed_agents::runtime::spawn_agent_child (cognitive 42) desktop/src-tauri/src/managed_agents/runtime.rs:484— buzz_desktop::managed_agents::runtime::spawn_agent_child has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (28 pts), loops 6 (9 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_desktop::commands::channels::fetch::fetch_channels (cognitive 41) desktop/src-tauri/src/commands/channels/fetch.rs:194— buzz_desktop::commands::channels::fetch::fetch_channels has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 5 (8 pts), boolean chains 4 (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.
buzz_desktop::archive::pipeline::commit_archive (cognitive 40) desktop/src-tauri/src/archive/pipeline.rs:260— buzz_desktop::archive::pipeline::commit_archive has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (11 pts), loops 5 (8 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.
buzz_desktop::media_proxy::proxy_handler (cognitive 40) desktop/src-tauri/src/media_proxy.rs:29— buzz_desktop::media_proxy::proxy_handler has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::migration::detach::detach_directory_backed_teams_in_dir (cognitive 40) desktop/src-tauri/src/migration/detach.rs:32— buzz_desktop::migration::detach::detach_directory_backed_teams_in_dir has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (32 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_desktop::commands::media_gif::strip_gif_metadata (cognitive 36) desktop/src-tauri/src/commands/media_gif.rs:38— buzz_desktop::commands::media_gif::strip_gif_metadata has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch (cognitive 36) desktop/src-tauri/src/managed_agents/restore.rs:140— buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 4, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_desktop::terminal_runtime::terminal_attach (cognitive 36) desktop/src-tauri/src/terminal_runtime.rs:371— buzz_desktop::terminal_runtime::terminal_attach has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (29 pts), match/switch 2 (4 pts), loops 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClassTooLong: DeletionStore REDACTED:751— ClassTooLong — 1907 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 63 methods, 2 blocks, lines 751-3315. The bar is 400 significant lines; this is 1507 over it, 4.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AcpClient crates/buzz-acp/src/acp.rs:148— ClassTooLong — 891 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 40 methods, 3 blocks, lines 148-2394. The bar is 400 significant lines; this is 491 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: _MessageList mobile/lib/features/channels/channel_detail_page/message_list.dart:3— ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AgentInstanceEditDialog desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:1— ClassTooLong — 842 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 442 over it, 2.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ChannelPane desktop/src/features/channels/ui/ChannelPane.tsx:1— ClassTooLong — 835 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 435 over it, 2.09× 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: ComposeBar mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:3— ClassTooLong — 830 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 430 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: ProfileAvatarEditor desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:1— ClassTooLong — 817 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 417 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ChannelScreen desktop/src/features/channels/ui/ChannelScreen.tsx:1— ClassTooLong — 816 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 416 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AgentCreationPreview desktop/src/features/agents/ui/AgentCreationPreview.tsx:1— ClassTooLong — 810 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 410 over it, 2.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.
ClassTooLong: ProjectDetailScreen desktop/src/features/projects/ui/ProjectDetailScreen.tsx:1— ClassTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 374 over it, 1.94× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AnimatedAvatarCapture desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:1— ClassTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 361 over it, 1.90× 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: RelayClient desktop/src/shared/api/relayClientSession.ts:79— ClassTooLong — 755 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 355 over it, 1.89× 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: HomeView desktop/src/features/home/ui/HomeView.tsx:1— ClassTooLong — 751 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 351 over it, 1.88× 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: AgentDefinitionDialog desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:1— ClassTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 347 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: useMentionSendFlow desktop/src/features/messages/ui/useMentionSendFlow.ts:1— ClassTooLong — 744 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 344 over it, 1.86× 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: AppShell desktop/src/app/AppShell.tsx:1— ClassTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 336 over it, 1.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: UserProfilePanel desktop/src/features/profile/ui/UserProfilePanel.tsx:1— ClassTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 331 over it, 1.83× 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: AppSidebar desktop/src/features/sidebar/ui/AppSidebar.tsx:1— ClassTooLong — 730 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 330 over it, 1.83× 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: RelaySessionNotifier mobile/lib/shared/relay/relay_session.dart:81— ClassTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 325 over it, 1.81× 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: ThreadDetailPage mobile/lib/features/channels/thread_detail_page.dart:81— ClassTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 325 over it, 1.81× 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: NativeAttachmentPopoverViewController mobile/ios/Runner/NativeAttachmentPopover.swift:7— ClassTooLong — 722 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 322 over it, 1.81× 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: MessageRow desktop/src/features/messages/ui/MessageRow.tsx:1— ClassTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 314 over it, 1.79× 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: useMentions desktop/src/features/messages/lib/useMentions.ts:1— ClassTooLong — 699 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 299 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: ProjectsView desktop/src/features/projects/ui/ProjectsView.tsx:1— ClassTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 290 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AgentConfigFields desktop/src/features/agents/ui/AgentConfigFields.tsx:1— ClassTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 283 over it, 1.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
buzz_relay::audio::handler::run_active_audio_connection (cognitive 250) crates/buzz-relay/src/audio/handler.rs:528— buzz_relay::audio::handler::run_active_audio_connection has cognitive complexity 250 (threshold 15). Drivers by points: if/else 109 (197 pts), match/switch 28 (47 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 109). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::ingest::ingest_event_inner (cognitive 212) crates/buzz-relay/src/handlers/ingest.rs:2533— buzz_relay::handlers::ingest::ingest_event_inner has cognitive complexity 212 (threshold 15). Drivers by points: if/else 113 (153 pts), match/switch 23 (41 pts), boolean chains 18 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::run_relay_main (cognitive 156) crates/buzz-relay/src/main.rs:381— buzz_relay::run_relay_main has cognitive complexity 156 (threshold 15). Drivers by points: if/else 62 (95 pts), match/switch 22 (41 pts), loops 12 (16 pts), boolean chains 4 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::api::bridge::query_member_events (cognitive 138) crates/buzz-relay/src/api/bridge.rs:1495— buzz_relay::api::bridge::query_member_events has cognitive complexity 138 (threshold 15). Drivers by points: if/else 43 (94 pts), loops 12 (23 pts), match/switch 9 (18 pts), boolean chains 3 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::side_effects::validate_admin_event (cognitive 116) crates/buzz-relay/src/handlers/side_effects.rs:544— buzz_relay::handlers::side_effects::validate_admin_event has cognitive complexity 116 (threshold 15). Drivers by points: if/else 28 (64 pts), match/switch 10 (34 pts), loops 6 (12 pts), boolean chains 6 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::imeta::validate_imeta_tags (cognitive 109) crates/buzz-relay/src/handlers/imeta.rs:10— buzz_relay::handlers::imeta::validate_imeta_tags has cognitive complexity 109 (threshold 15). Drivers by points: if/else 27 (89 pts), boolean chains 7, match/switch 2 (7 pts), loops 3 (6 pts) (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::count::handle_count (cognitive 100) crates/buzz-relay/src/handlers/count.rs:19— buzz_relay::handlers::count::handle_count has cognitive complexity 100 (threshold 15). Drivers by points: if/else 21 (64 pts), match/switch 9 (18 pts), loops 3 (11 pts), boolean chains 7 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::auth::handle_auth (cognitive 98) crates/buzz-relay/src/handlers/auth.rs:381— buzz_relay::handlers::auth::handle_auth has cognitive complexity 98 (threshold 15). Drivers by points: if/else 31 (79 pts), match/switch 8 (17 pts), boolean chains 2 (nesting depth added 57). 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.
buzz_relay::api::bridge::count_member_events (cognitive 95) crates/buzz-relay/src/api/bridge.rs:2187— buzz_relay::api::bridge::count_member_events has cognitive complexity 95 (threshold 15). Drivers by points: if/else 21 (64 pts), match/switch 4 (13 pts), loops 3 (11 pts), boolean chains 7 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::req::handle_search_req (cognitive 92) crates/buzz-relay/src/handlers/req.rs:761— buzz_relay::handlers::req::handle_search_req has cognitive complexity 92 (threshold 15). Drivers by points: if/else 20 (56 pts), match/switch 6 (22 pts), loops 4 (12 pts), boolean chains 2 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::req::handle_req (cognitive 87) crates/buzz-relay/src/handlers/req.rs:56— buzz_relay::handlers::req::handle_req has cognitive complexity 87 (threshold 15). Drivers by points: if/else 31 (59 pts), match/switch 11 (17 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::api::bridge::thread_window::query (cognitive 59) crates/buzz-relay/src/api/bridge/thread_window.rs:165— buzz_relay::api::bridge::thread_window::query has cognitive complexity 59 (threshold 15). Drivers by points: if/else 8 (33 pts), loops 6 (21 pts), boolean chains 5 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::report_resolution::drive_enforcement (cognitive 57) crates/buzz-relay/src/handlers/report_resolution.rs:380— buzz_relay::handlers::report_resolution::drive_enforcement has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (42 pts), match/switch 4 (14 pts), loops 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::api::git::policy::hook_policy_check (cognitive 54) crates/buzz-relay/src/api/git/policy.rs:176— buzz_relay::api::git::policy::hook_policy_check has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 13 (21 pts), if/else 17 (19 pts), boolean chains 11, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::relay_admin::execute_relay_admin_command (cognitive 54) crates/buzz-relay/src/handlers/relay_admin.rs:225— buzz_relay::handlers::relay_admin::execute_relay_admin_command has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (43 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::side_effects::handle_standard_deletion_event (cognitive 54) crates/buzz-relay/src/handlers/side_effects.rs:2859— buzz_relay::handlers::side_effects::handle_standard_deletion_event has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (50 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_relay::emit_db_usage_metrics (cognitive 42) crates/buzz-relay/src/main.rs:2783— buzz_relay::emit_db_usage_metrics has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 16 (21 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::audio::handler::recv_loop (cognitive 41) crates/buzz-relay/src/audio/handler.rs:2389— buzz_relay::audio::handler::recv_loop has cognitive complexity 41 (threshold 15). Drivers by points: if/else 6 (26 pts), match/switch 4 (14 pts), loops 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.
buzz_relay::handlers::imeta::verify_imeta_blobs (cognitive 40) crates/buzz-relay/src/handlers/imeta.rs:209— buzz_relay::handlers::imeta::verify_imeta_blobs has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_relay::router::nip11_or_ws_handler (cognitive 40) crates/buzz-relay/src/router.rs:590— buzz_relay::router::nip11_or_ws_handler has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (30 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::event::handle_event (cognitive 37) crates/buzz-relay/src/handlers/event.rs:602— buzz_relay::handlers::event::handle_event has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 10 (18 pts), if/else 9 (13 pts), boolean chains 6 (nesting depth added 12). 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.
buzz_relay::handlers::ingest::validate_project_envelope (cognitive 37) crates/buzz-relay/src/handlers/ingest.rs:1856— buzz_relay::handlers::ingest::validate_project_envelope has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 2 (6 pts), loops 4, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::api::git::cas_publish::cas_publish_inner (cognitive 36) crates/buzz-relay/src/api/git/cas_publish.rs:1021— buzz_relay::api::git::cas_publish::cas_publish_inner has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 6 (9 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::audio::handler::commit_participant_join (cognitive 34) crates/buzz-relay/src/audio/handler.rs:3234— buzz_relay::audio::handler::commit_participant_join has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (27 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_relay::handlers::side_effects::persist_edit_metadata (cognitive 34) crates/buzz-relay/src/handlers/side_effects.rs:1987— buzz_relay::handlers::side_effects::persist_edit_metadata has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 4 (7 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (6 lines × 2) crates/buzz-acp/src/filter.rs:283— crates/buzz-acp/src/filter.rs:283-289 | crates/buzz-workflow/src/executor.rs:251-256 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/buzz-acp/src/filter.rs:295— crates/buzz-acp/src/filter.rs:295-301 | crates/buzz-workflow/src/executor.rs:262-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/buzz-acp/src/queue.rs:566— crates/buzz-acp/src/queue.rs:566-571 | crates/buzz-acp/src/queue.rs:601-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-agent/src/llm.rs:1996— crates/buzz-agent/src/llm.rs:1996-2001 | crates/buzz-agent/src/llm.rs:2435-2440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-cli/src/client.rs:326— crates/buzz-cli/src/client.rs:326-331 | crates/buzz-cli/src/client.rs:356-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-cli/src/client.rs:1089— crates/buzz-cli/src/client.rs:1089-1094 | crates/buzz-cli/src/client.rs:1370-1375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-cli/src/commands/mem.rs:238— crates/buzz-cli/src/commands/mem.rs:238-246 | desktop/src-tauri/src/commands/engrams.rs:223-228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/buzz-cli/src/commands/projects.rs:175— crates/buzz-cli/src/commands/projects.rs:175-180 | crates/buzz-cli/src/commands/projects.rs:527-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-cli/src/commands/workflows.rs:40— crates/buzz-cli/src/commands/workflows.rs:40-45 | crates/buzz-cli/src/commands/workflows.rs:129-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-db/src/store/api_token.rs:241— crates/buzz-db/src/store/api_token.rs:241-247 | crates/buzz-db/src/store/api_token.rs:572-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-db/src/store/partition.rs:936— crates/buzz-db/src/store/partition.rs:936-941 | crates/buzz-db/src/store/partition.rs:943-948 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:1915— crates/buzz-db/src/store/relay_admin_actions.rs:1915-1920 | crates/buzz-db/src/store/relay_admin_actions.rs:1932-1937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-deletion/src/lib.rs:1114— crates/buzz-deletion/src/lib.rs:1114-1119 | crates/buzz-deletion/src/lib.rs:1348-1353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-dev-mcp/src/shell.rs:363— crates/buzz-dev-mcp/src/shell.rs:363-369 | crates/buzz-dev-mcp/src/shell.rs:408-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-pairing-cli/src/main.rs:490— crates/buzz-pairing-cli/src/main.rs:490-495 | desktop/src-tauri/src/commands/pairing.rs:869-874 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/buzz-relay/src/api/bridge.rs:1961— crates/buzz-relay/src/api/bridge.rs:1961-1966 | crates/buzz-relay/src/handlers/req.rs:467-472 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/handlers/req.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/buzz-relay/src/api/bridge.rs:2764— crates/buzz-relay/src/api/bridge.rs:2764-2769 | crates/buzz-relay/src/handlers/command_executor.rs:948-953 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/buzz-relay/src/api/git/transport.rs:1449— crates/buzz-relay/src/api/git/transport.rs:1449-1454 | crates/buzz-relay/src/api/git/transport.rs:1853-1858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:1406— crates/buzz-relay/src/handlers/ingest.rs:1406-1411 | crates/buzz-relay/src/handlers/ingest.rs:1478-1483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-relay/src/readiness.rs:602— crates/buzz-relay/src/readiness.rs:602-607 | crates/buzz-relay/src/readiness.rs:635-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/buzz-sdk/src/builders.rs:433— crates/buzz-sdk/src/builders.rs:433-438 | crates/buzz-sdk/src/builders.rs:504-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) desktop/src-tauri/src/commands/teams/mod.rs:422— desktop/src-tauri/src/commands/teams/mod.rs:422-427 | desktop/src-tauri/src/commands/teams/mod.rs:472-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) desktop/src-tauri/src/mesh_llm/mod.rs:620— desktop/src-tauri/src/mesh_llm/mod.rs:620-625 | desktop/src-tauri/src/mesh_llm/mod.rs:651-656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) desktop/src-tauri/src/migration/detach.rs:37— desktop/src-tauri/src/migration/detach.rs:37-42 | desktop/src-tauri/src/migration/team_membership.rs:99-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) desktop/src-tauri/src/persona_catalog.rs:198— desktop/src-tauri/src/persona_catalog.rs:198-203 | desktop/src-tauri/src/team_catalog.rs:316-321 — before extracting anything, compare `desktop/src-tauri/src/persona_catalog.rs` and `desktop/src-tauri/src/team_catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/buzz-acp/src/relay.rs:3381— crates/buzz-acp/src/relay.rs:3381-3388 | crates/buzz-acp/src/relay.rs:3436-3443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/buzz-cli/src/commands/channels.rs:236— crates/buzz-cli/src/commands/channels.rs:236-243 | crates/buzz-cli/src/commands/channels.rs:259-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/buzz-cli/src/commands/projects.rs:490— crates/buzz-cli/src/commands/projects.rs:490-497 | crates/buzz-cli/src/commands/repos.rs:311-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/buzz-cli/src/commands/social.rs:34— crates/buzz-cli/src/commands/social.rs:34-41 | crates/buzz-cli/src/commands/social.rs:62-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/buzz-cli/src/links.rs:115— crates/buzz-cli/src/links.rs:115-122 | crates/buzz-relay/src/handlers/side_effects.rs:3186-3193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/buzz-cli/src/validate.rs:169— crates/buzz-cli/src/validate.rs:169-176 | crates/buzz-cli/src/validate.rs:187-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/buzz-core/src/engram.rs:306— crates/buzz-core/src/engram.rs:306-313 | crates/buzz-core/src/private_managed_agent.rs:742-749 — before extracting anything, compare `crates/buzz-core/src/engram.rs` and `crates/buzz-core/src/private_managed_agent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/buzz-relay/src/handlers/moderation_commands.rs:575— crates/buzz-relay/src/handlers/moderation_commands.rs:575-582 | crates/buzz-relay/src/handlers/moderation_commands.rs:590-597 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/agent_settings.rs:55— desktop/src-tauri/src/commands/agent_settings.rs:55-62 | desktop/src-tauri/src/commands/agent_settings.rs:99-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/agents.rs:159— desktop/src-tauri/src/commands/agents.rs:159-166 | desktop/src-tauri/src/commands/agents.rs:1026-1033 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/agents.rs:344— desktop/src-tauri/src/commands/agents.rs:344-351 | desktop/src-tauri/src/commands/agents.rs:1075-1082 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/agents_profile.rs:113— desktop/src-tauri/src/commands/agents_profile.rs:113-120 | desktop/src-tauri/src/commands/agents_profile.rs:158-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/media_transcode.rs:157— desktop/src-tauri/src/commands/media_transcode.rs:157-164 | desktop/src-tauri/src/commands/relay_reconnect.rs:69-76 — 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) desktop/src-tauri/src/commands/messages/forum.rs:50— desktop/src-tauri/src/commands/messages/forum.rs:50-57 | desktop/src-tauri/src/commands/messages/forum.rs:93-100 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/personas/card.rs:499— desktop/src-tauri/src/commands/personas/card.rs:499-506 | desktop/src-tauri/src/commands/personas/card.rs:557-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.
Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/personas/mod.rs:80— desktop/src-tauri/src/commands/personas/mod.rs:80-87 | desktop/src-tauri/src/commands/personas/mod.rs:298-305 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/personas/sharing.rs:36— desktop/src-tauri/src/commands/personas/sharing.rs:36-43 | desktop/src-tauri/src/commands/teams/sharing.rs:52-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) desktop/src-tauri/src/commands/project_git_workflow.rs:253— desktop/src-tauri/src/commands/project_git_workflow.rs:253-260 | desktop/src-tauri/src/commands/project_git_workflow.rs: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) desktop/src-tauri/src/commands/social.rs:208— desktop/src-tauri/src/commands/social.rs:208-215 | desktop/src-tauri/src/commands/social.rs:284-291 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/deep_link.rs:318— desktop/src-tauri/src/deep_link.rs:318-325 | desktop/src-tauri/src/deep_link.rs:345-352 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/events.rs:570— desktop/src-tauri/src/events.rs:570-577 | desktop/src-tauri/src/events.rs:591-598 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/managed_agents/nest.rs:430— desktop/src-tauri/src/managed_agents/nest.rs:430-437 | desktop/src-tauri/src/managed_agents/nest.rs:479-486 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/mesh_llm/mod.rs:375— desktop/src-tauri/src/mesh_llm/mod.rs:375-382 | desktop/src-tauri/src/mesh_llm/mod.rs:412-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/buzz-acp/src/config.rs:797— crates/buzz-acp/src/config.rs:797-804 | desktop/src-tauri/src/managed_agents/discovery.rs:325-332 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/buzz-acp/src/relay.rs:3446— crates/buzz-acp/src/relay.rs:3446-3453 | crates/buzz-acp/src/relay.rs:3479-3488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
buzz_relay::handlers::ingest::ingest_event_inner (cyclomatic 156) crates/buzz-relay/src/handlers/ingest.rs:2533— buzz_relay::handlers::ingest::ingest_event_inner has cyclomatic complexity 156 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::audio::handler::run_active_audio_connection (cyclomatic 142) crates/buzz-relay/src/audio/handler.rs:528— buzz_relay::audio::handler::run_active_audio_connection has cyclomatic complexity 142 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::run_relay_main (cyclomatic 97) crates/buzz-relay/src/main.rs:381— buzz_relay::run_relay_main has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::api::bridge::query_member_events (cyclomatic 70) crates/buzz-relay/src/api/bridge.rs:1495— buzz_relay::api::bridge::query_member_events has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::handlers::side_effects::validate_admin_event (cyclomatic 56) crates/buzz-relay/src/handlers/side_effects.rs:544— buzz_relay::handlers::side_effects::validate_admin_event has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::handlers::req::handle_req (cyclomatic 48) crates/buzz-relay/src/handlers/req.rs:56— buzz_relay::handlers::req::handle_req has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::handlers::imeta::validate_imeta_tags (cyclomatic 47) crates/buzz-relay/src/handlers/imeta.rs:10— buzz_relay::handlers::imeta::validate_imeta_tags has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::api::git::policy::hook_policy_check (cyclomatic 44) crates/buzz-relay/src/api/git/policy.rs:176— buzz_relay::api::git::policy::hook_policy_check has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_relay::handlers::auth::handle_auth (cyclomatic 44) crates/buzz-relay/src/handlers/auth.rs:381— buzz_relay::handlers::auth::handle_auth has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::handlers::count::handle_count (cyclomatic 38) crates/buzz-relay/src/handlers/count.rs:19— buzz_relay::handlers::count::handle_count has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::handlers::side_effects::persist_edit_metadata (cyclomatic 36) crates/buzz-relay/src/handlers/side_effects.rs:1987— buzz_relay::handlers::side_effects::persist_edit_metadata has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::handlers::relay_admin::execute_relay_admin_command (cyclomatic 35) crates/buzz-relay/src/handlers/relay_admin.rs:225— buzz_relay::handlers::relay_admin::execute_relay_admin_command 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.
buzz_relay::api::bridge::count_member_events (cyclomatic 33) crates/buzz-relay/src/api/bridge.rs:2187— buzz_relay::api::bridge::count_member_events 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.
buzz_relay::handlers::event::handle_event (cyclomatic 32) crates/buzz-relay/src/handlers/event.rs:602— buzz_relay::handlers::event::handle_event has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_relay::handlers::req::handle_search_req (cyclomatic 31) crates/buzz-relay/src/handlers/req.rs:761— buzz_relay::handlers::req::handle_search_req has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::handlers::ingest::validate_project_envelope (cyclomatic 28) crates/buzz-relay/src/handlers/ingest.rs:1856— buzz_relay::handlers::ingest::validate_project_envelope has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::emit_db_usage_metrics (cyclomatic 28) crates/buzz-relay/src/main.rs:2783— buzz_relay::emit_db_usage_metrics has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::push_runtime::deliver_one (cyclomatic 28) crates/buzz-relay/src/push_runtime.rs:465— buzz_relay::push_runtime::deliver_one has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_relay::handlers::imeta::verify_imeta_blobs (cyclomatic 25) crates/buzz-relay/src/handlers/imeta.rs:209— buzz_relay::handlers::imeta::verify_imeta_blobs 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.
buzz_relay::handlers::report_resolution::drive_enforcement (cyclomatic 25) crates/buzz-relay/src/handlers/report_resolution.rs:380— buzz_relay::handlers::report_resolution::drive_enforcement 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.
buzz_relay::audio::handler::commit_participant_join (cyclomatic 24) crates/buzz-relay/src/audio/handler.rs:3234— buzz_relay::audio::handler::commit_participant_join 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.
buzz_relay::api::git::cas_publish::cas_publish_inner (cyclomatic 22) crates/buzz-relay/src/api/git/cas_publish.rs:1021— buzz_relay::api::git::cas_publish::cas_publish_inner 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.
buzz_relay::router::nip11_or_ws_handler (cyclomatic 21) crates/buzz-relay/src/router.rs:590— buzz_relay::router::nip11_or_ws_handler 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.
buzz_relay::api::bridge::handle_channel_window_filter (cyclomatic 20) crates/buzz-relay/src/api/bridge.rs:755— buzz_relay::api::bridge::handle_channel_window_filter has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_relay::api::bridge::thread_window::query (cyclomatic 20) crates/buzz-relay/src/api/bridge/thread_window.rs:165— buzz_relay::api::bridge::thread_window::query has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Repeated repair: desktop/src/features/agents/hooks.ts desktop/src/features/agents/hooks.ts:453— desktop/src/features/agents/hooks.ts changed 13 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 6 (its worst body is hooks.useUpdateManagedAgentMutation at line 453), 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(desktop): read channel metadata and member lists from writer after writes (#7999)”; “fix(desktop): resolve bundled sidecar on cheap path and bound login-shell spawns (#6904)”; “fix(desktop): enforce shared agent access across devices (#6086)”; “fix(desktop): defer foreground resume work (#5696)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/agents/hooks.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/shared/api/relayClientShared.ts desktop/src/shared/api/relayClientShared.ts:149— desktop/src/shared/api/relayClientShared.ts changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is relayClientShared.getTextPayload at line 149), 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(desktop): bound startup request bursts and recover quota refusals (#7790)”; “fix(desktop): harden profile batch and thread-reply fetches against relay slowness (#7188)”; “fix(client): resurface hidden DMs from live activity (#6885)”; “fix(desktop): make reconnect repair lossless (#6415)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/shared/api/relayClientShared.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs:127— desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs changed 7 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 7 (its worst body is buzz_desktop::commands::agent_discovery::relay_directory::list_relay_agents_for_selection at line 127), 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(desktop): discover authenticated owned relay agents (#7122)”; “Fix cross-owner relay agent mentions in owner-only builds (#6338)”; “fix(desktop): bound remote agent mention authorization (#6224)”; “fix(desktop): restore release agent mentions (#6182)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/buzz-relay/src/handlers/system_channels.rs crates/buzz-relay/src/handlers/system_channels.rs:174— crates/buzz-relay/src/handlers/system_channels.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is buzz_relay::handlers::system_channels::filter_channel_scope at line 174), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(relay): push system channel events to a lease that names them (#8517)”; “fix(relay): scope push matches with the read path's channel rule (#8507)”; “fix(relay): show only legacy channel types to reads that name no channel (#8469)”; “fix(relay): confirm requested channels in one membership query (#8378)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-relay/src/handlers/system_channels.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: mobile/lib/features/channels/channel_sections/channel_sections_manager.dart mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:465— mobile/lib/features/channels/channel_sections/channel_sections_manager.dart changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is ChannelSectionsManager._publish at line 465), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): keep cached state with its community (#8349)”; “fix(mobile): keep retired sections manager out of successor cache (#7873)”; “fix(mobile): converge sidebar managers on relay head with resume re-read (#7806)”; “fix(mobile): serialize channel sections sync (#3165)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/channels/channel_sections/channel_sections_manager.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/buzz-acp/src/setup_mode.rs crates/buzz-acp/src/setup_mode.rs:321— crates/buzz-acp/src/setup_mode.rs changed 5 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 buzz_acp::setup_mode::run_setup_listener at line 321), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(acp): wake agents for mentions added by edits (#6131)”; “fix(acp): preserve routing for edited messages (#4741)”; “fix(acp): improve hints in pi agent setup guide (#7594)”; “fix(acp): wake agents from workflow messages (#6953)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-acp/src/setup_mode.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: desktop/src/features/messages/ui/submitMessageEdit.ts desktop/src/features/messages/ui/submitMessageEdit.ts:70— desktop/src/features/messages/ui/submitMessageEdit.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is submitMessageEdit.submitMessageEdit at line 70), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(acp): wake agents for mentions added by edits (#6131)”; “fix(desktop): authorize remote mentions at publication (#7124)”; “fix(desktop): bind duplicate mention selections to exact recipients (#7133)”; “fix(desktop): enforce agent mention authorization at send boundaries (#5681)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/messages/ui/submitMessageEdit.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/shared/api/relayClosedRecovery.ts desktop/src/shared/api/relayClosedRecovery.ts:27— desktop/src/shared/api/relayClosedRecovery.ts changed 5 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 12 (its worst body is relayClosedRecovery.handleRelayClosed at line 27), 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(desktop): bound startup request bursts and recover quota refusals (#7790)”; “fix(desktop): harden profile batch and thread-reply fetches against relay slowness (#7188)”; “fix(desktop): make reconnect repair lossless (#6415)”; “fix(desktop): preserve theme when opening communities (#5266)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/shared/api/relayClosedRecovery.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/buzz-agent/src/handoff.rs crates/buzz-agent/src/handoff.rs:304— crates/buzz-agent/src/handoff.rs changed 5 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 11 (its worst body is RunCtx::build_handoff_prompt at line 304), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): raise output limit and allow 3 recoveries (#5475)”; “fix(buzz-agent): budget summarizer reasoning separately so it cannot starve the handoff summary (#5248)”; “fix(buzz-agent): recover from context-window 400s instead of sticking (#4946)”; “fix(buzz-agent): scope handoff cap per turn, not per session lifetime (#4805)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-agent/src/handoff.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: desktop/src/features/agents/lib/usePersonaCatalogRelay.ts desktop/src/features/agents/lib/usePersonaCatalogRelay.ts:51— desktop/src/features/agents/lib/usePersonaCatalogRelay.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is usePersonaCatalogRelay.usePersonaCatalogLiveUpdates at line 51), 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(desktop): cut steady-state relay traffic from polls and read-state echo (#5879)”; “fix(desktop): defer foreground resume work (#5696)”; “fix(desktop): remove 0.5.9+ perf regressions, speed up get_channels (#5599)”; “fix(desktop): quiesce renderer polling while hidden (#3677) (#5490)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/agents/lib/usePersonaCatalogRelay.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/features/custom-emoji/hooks.ts desktop/src/features/custom-emoji/hooks.ts:80— desktop/src/features/custom-emoji/hooks.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is hooks.useCommunityEmojiLiveUpdates at line 80), 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(desktop): cut steady-state relay traffic from polls and read-state echo (#5879)”; “fix(desktop): defer foreground resume work (#5696)”; “fix(desktop): remove 0.5.9+ perf regressions, speed up get_channels (#5599)”; “fix(desktop): quiesce renderer polling while hidden (#3677) (#5490)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/custom-emoji/hooks.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/features/home/hooks.ts desktop/src/features/home/hooks.ts:18— desktop/src/features/home/hooks.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is hooks.useHomeFeedQuery at line 18), 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(desktop): defer foreground resume work (#5696)”; “fix(desktop): remove 0.5.9+ perf regressions, speed up get_channels (#5599)”; “fix(desktop): suppress fresh focus-return refetches for channels and home-feed (#5535)”; “fix(desktop): quiesce renderer polling while hidden (#3677) (#5490)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/home/hooks.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: mobile/lib/shared/community/community.dart mobile/lib/shared/community/community.dart:128— mobile/lib/shared/community/community.dart 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 6 (its worst body is Community.fromJson at line 128), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): reset community notification preferences (#8455)”; “fix(mobile): default community push notifications to on (#8425)”; “fix(mobile): join starter channels after accepting invite (#5915)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/shared/community/community.dart`: 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: mobile/lib/features/settings/settings_page/notifications_section.dart mobile/lib/features/settings/settings_page/notifications_section.dart:6— mobile/lib/features/settings/settings_page/notifications_section.dart 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 _NotificationsSection.build at line 6), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): keep notification toggle usable and match row height (#8223)”; “fix(mobile): simplify notification settings (#8199)”; “fix(mobile): hide notification settings without relay push capability (#8025)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/settings/settings_page/notifications_section.dart`: 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: desktop/src/features/messages/ui/useDraftPersistSnapshot.ts desktop/src/features/messages/ui/useDraftPersistSnapshot.ts:107— desktop/src/features/messages/ui/useDraftPersistSnapshot.ts 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 useDraftPersistSnapshot.useDraftPersistLifecycle at line 107), 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(desktop): authorize remote mentions at publication (#7124)”; “fix(composer): polish automatic mentions (#6956)”; “fix(desktop-messages): preserve inline agent mentions with persistent addressing (#6793)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/messages/ui/useDraftPersistSnapshot.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/features/profile/hooks.ts desktop/src/features/profile/hooks.ts:328— desktop/src/features/profile/hooks.ts changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is hooks.useUsersBatchQuery at line 328), 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(desktop): harden profile batch and thread-reply fetches against relay slowness (#7188)”; “fix(desktop): sender names in notifications + macOS click-through routing (#6427)”; “fix(desktop): show cached display names on startup (#3317)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/profile/hooks.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: mobile/lib/features/channels/channels_page/skeleton.dart mobile/lib/features/channels/channels_page/skeleton.dart:9— mobile/lib/features/channels/channels_page/skeleton.dart 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 3 (its worst body is _ChannelsSkeleton.build at line 9), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): restore channel icons and align chat colors with desktop (#8478)”; “fix(mobile): bump Flutter 3.47, resolving memory leak (#8419)”; “fix(mobile): fill and stabilize content-aware loading placeholders (#8083)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/channels/channels_page/skeleton.dart`: 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: mobile/ios/NotificationService/NotificationService.swift mobile/ios/NotificationService/NotificationService.swift:98— mobile/ios/NotificationService/NotificationService.swift 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 12 (its worst body is NotificationService.didReceive at line 98), 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): supply missing push notification sound at handoff (#8443)”; “fix(ios): fetch profiles and avatars in notification extension (#8369)”; “fix(mobile): fail open when age checks are unavailable (#7714)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/ios/NotificationService/NotificationService.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: crates/buzz-dev-mcp/src/lib.rs crates/buzz-dev-mcp/src/lib.rs:138— crates/buzz-dev-mcp/src/lib.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 3 (its worst body is buzz_dev_mcp::run at line 138), 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(mcp): support Goose discovery handshake (#8037)”; “fix(dev-mcp): extend shell timeout cap to 20 minutes and align outer budgets (#7185)”; “fix(mcp): scope todo usage (#6216)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- crates/buzz-dev-mcp/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/features/sidebar/lib/channelSortPreference.ts desktop/src/features/sidebar/lib/channelSortPreference.ts:92— desktop/src/features/sidebar/lib/channelSortPreference.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is channelSortPreference.sortChannelsForSidebar at line 92), 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(sidebar): converge stale-at-open state across devices (sections/sort/stars/mutes) (#7805)”; “fix(desktop): bound nine unbounded localStorage stores (#5454)”; “fix(desktop): prevent sidebar prefs from reverting on stale-localStorage boot (#5086)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/sidebar/lib/channelSortPreference.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: mobile/lib/features/channels/thread_replies_provider.dart mobile/lib/features/channels/thread_replies_provider.dart:17— mobile/lib/features/channels/thread_replies_provider.dart 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 4 (its worst body is ThreadRepliesArgs.== at line 17), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mobile): avoid opening empty threads on message tap (#7756)”; “fix(mobile): preserve thread replies through refresh failures (#7757)”; “fix(mobile): recover stale and shuffled messages (#6691)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- mobile/lib/features/channels/thread_replies_provider.dart`: 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: desktop/src/features/settings/ui/harnessCatalogCopy.ts desktop/src/features/settings/ui/harnessCatalogCopy.ts:55— desktop/src/features/settings/ui/harnessCatalogCopy.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is harnessCatalogCopy.harnessDescription at line 55), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(acp): integrate the Buzz Pi adapter fork (#7552)”; “fix(catalog): update Amp tagline (#3806)”; “fix(catalog): update Amp description (#3758)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/settings/ui/harnessCatalogCopy.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/shared/ui/markdown/MarkdownMention.tsx desktop/src/shared/ui/markdown/MarkdownMention.tsx:19— desktop/src/shared/ui/markdown/MarkdownMention.tsx changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is MarkdownMention.createMarkdownMention at line 19), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(markdown): align mention chip wrapping (#7501)”; “fix(desktop): restore mention chip identity icons (#7338)”; “fix(desktop): bind duplicate mention selections to exact recipients (#7133)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/shared/ui/markdown/MarkdownMention.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/features/channels/ui/useChannelAgentSessions.ts desktop/src/features/channels/ui/useChannelAgentSessions.ts:113— desktop/src/features/channels/ui/useChannelAgentSessions.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is useChannelAgentSessions.getChannelAgentSessionAgents at line 113), 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(desktop): npub identity displays for mention, member, and workflow surfaces (#7495)”; “fix(desktop): discover authenticated owned relay agents (#7122)”; “fix(messages): route edits to the owning composer (#6575)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/channels/ui/useChannelAgentSessions.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: desktop/src/features/messages/lib/mentionCandidates.ts desktop/src/features/messages/lib/mentionCandidates.ts:77— desktop/src/features/messages/lib/mentionCandidates.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is mentionCandidates.findTeamMemberTarget at line 77), 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(desktop): npub identity displays for mention, member, and workflow surfaces (#7495)”; “fix(desktop): bind duplicate mention selections to exact recipients (#7133)”; “fix(desktop): enforce agent mention authorization at send boundaries (#5681)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 08:13:38 +11:00' --until='2026-10-27 08:13:38 +11:00' --full-history --no-merges -- desktop/src/features/messages/lib/mentionCandidates.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
buzz_desktop::huddle::tts::tts_worker (cyclomatic 71) desktop/src-tauri/src/huddle/tts.rs:322— buzz_desktop::huddle::tts::tts_worker has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::huddle::playout::run_playout_recv_loop (cyclomatic 49) desktop/src-tauri/src/huddle/playout.rs:273— buzz_desktop::huddle::playout::run_playout_recv_loop has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::run (cyclomatic 46) desktop/src-tauri/src/lib.rs:101— buzz_desktop::run has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::commands::pairing::pairing_ws_task_inner (cyclomatic 39) desktop/src-tauri/src/commands/pairing.rs:351— buzz_desktop::commands::pairing::pairing_ws_task_inner has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::migration::sync_shared_agent_data (cyclomatic 39) desktop/src-tauri/src/migration.rs:785— buzz_desktop::migration::sync_shared_agent_data has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file (cyclomatic 36) desktop/src-tauri/src/migration/pollen.rs:21— buzz_desktop::migration::pollen::migrate_pollen_agent_name_in_file has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::managed_agents::backend::invoke_provider (cyclomatic 34) desktop/src-tauri/src/managed_agents/backend.rs:76— buzz_desktop::managed_agents::backend::invoke_provider has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::native_relay_client::run_connection (cyclomatic 34) desktop/src-tauri/src/native_relay_client.rs:522— buzz_desktop::native_relay_client::run_connection has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::commands::agents::create_managed_agent_in (cyclomatic 31) desktop/src-tauri/src/commands/agents.rs:400— buzz_desktop::commands::agents::create_managed_agent_in has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_desktop::commands::agent_models_update::update_managed_agent (cyclomatic 30) desktop/src-tauri/src/commands/agent_models_update.rs:143— buzz_desktop::commands::agent_models_update::update_managed_agent has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::commands::team_snapshot::confirm_team_snapshot_import (cyclomatic 30) desktop/src-tauri/src/commands/team_snapshot.rs:511— buzz_desktop::commands::team_snapshot::confirm_team_snapshot_import has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buzz_desktop::managed_agents::runtime::spawn_agent_child (cyclomatic 30) desktop/src-tauri/src/managed_agents/runtime.rs:484— buzz_desktop::managed_agents::runtime::spawn_agent_child has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_desktop::reset::run_boot_reset_with_keychain (cyclomatic 29) desktop/src-tauri/src/reset.rs:185— buzz_desktop::reset::run_boot_reset_with_keychain 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.
buzz_desktop::huddle::start_huddle (cyclomatic 25) desktop/src-tauri/src/huddle/mod.rs:189— buzz_desktop::huddle::start_huddle 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.
buzz_desktop::media_proxy::handle_buzz_media (cyclomatic 23) desktop/src-tauri/src/media_proxy.rs:190— buzz_desktop::media_proxy::handle_buzz_media has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::commands::channels::fetch::fetch_channels (cyclomatic 22) desktop/src-tauri/src/commands/channels/fetch.rs:194— buzz_desktop::commands::channels::fetch::fetch_channels 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.
buzz_desktop::commands::personas::inbound::reconcile_inbound_persona_event_blocking (cyclomatic 22) desktop/src-tauri/src/commands/personas/inbound.rs:152— buzz_desktop::commands::personas::inbound::reconcile_inbound_persona_event_blocking 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.
buzz_desktop::deep_link::parse_entity_deep_link (cyclomatic 22) desktop/src-tauri/src/deep_link.rs:424— buzz_desktop::deep_link::parse_entity_deep_link has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch (cyclomatic 22) desktop/src-tauri/src/managed_agents/restore.rs:140— buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch 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.
buzz_desktop::unread_catch_up::classify_batch (cyclomatic 22) desktop/src-tauri/src/unread_catch_up.rs:250— buzz_desktop::unread_catch_up::classify_batch 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.
buzz_desktop::media_proxy::proxy_handler (cyclomatic 21) desktop/src-tauri/src/media_proxy.rs:29— buzz_desktop::media_proxy::proxy_handler 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.
buzz_desktop::relay::profile_avatar::localize_avatar (cyclomatic 21) desktop/src-tauri/src/relay/profile_avatar.rs:59— buzz_desktop::relay::profile_avatar::localize_avatar 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.
buzz_desktop::terminal_runtime::terminal_attach (cyclomatic 21) desktop/src-tauri/src/terminal_runtime.rs:371— buzz_desktop::terminal_runtime::terminal_attach 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.
buzz_desktop::commands::media_gif::strip_gif_metadata (cyclomatic 20) desktop/src-tauri/src/commands/media_gif.rs:38— buzz_desktop::commands::media_gif::strip_gif_metadata has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_desktop::commands::personas::card::mint_agent_card (cyclomatic 19) desktop/src-tauri/src/commands/personas/card.rs:534— buzz_desktop::commands::personas::card::mint_agent_card 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.
Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:248— `DirectActionsProvider` (slice 'admin-console') depends on `memberSearchLabel` from slice 'profile'.
Cross-slice coupling: admin-console → onboarding desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:617— `useAdminMemberSearch` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'.
Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:664— `AdminMemberPicker` (slice 'admin-console') depends on `useMemberCandidates` from slice 'profile'.
Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:717— `AdminMemberPicker` (slice 'admin-console') depends on `MemberSearchResult` from slice 'profile'.
Cross-slice coupling: admin-console → onboarding desktop/src/features/admin-console/AdminConsoleCommunities.tsx:48— `CommunitiesTab` (slice 'admin-console') depends on `containsSecretKey` from slice 'onboarding'.
Cross-slice coupling: admin-console → communities desktop/src/features/admin-console/AdminConsolePanel.tsx:150— `AdminConsolePanel` (slice 'admin-console') depends on `useCommunities` from slice 'communities'.
Cross-slice coupling: admin-console → forum desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:263— `formatTimestamp` (slice 'admin-console') depends on `formatRelativeTime` from slice 'forum'.
Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:702— `ReportsTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'.
Cross-slice coupling: admin-console → settings desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:216— `AdminConsoleSettingsCard` (slice 'admin-console') depends on `SettingsSectionHeader` from slice 'settings'.
Cross-slice coupling: admin-console → profile desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:483— `StaffingTab` (slice 'admin-console') depends on `useUsersBatchQuery` from slice 'profile'.
Cross-slice coupling: admin-console → communities desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:161— `mountCard` (slice 'admin-console') depends on `CommunitiesProvider` from slice 'communities'.
Cross-slice coupling: agent-memory → agents desktop/src/features/agent-memory/hooks.ts:42— `useIsManagedAgent` (slice 'agent-memory') depends on `useManagedAgentsQuery` from slice 'agents'.
Cross-slice coupling: agents → channels desktop/src/features/agents/hooks.ts:157— `invalidateAgentQueries` (slice 'agents') depends on `channelsQueryKey` from slice 'channels'.
Cross-slice coupling: agents → channels desktop/src/features/agents/hooks.ts:470— `useUpdateManagedAgentMutation` (slice 'agents') depends on `updateCachedChannelMemberDisplayName` from slice 'channels'.
Cross-slice coupling: agents → profile desktop/src/features/agents/hooks.ts:491— `useUpdateManagedAgentMutation` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'.
Cross-slice coupling: agents → channels desktop/src/features/agents/hooks.ts:723— `useAttachManagedAgentToChannelMutation` (slice 'agents') depends on `upsertCachedChannelMember` from slice 'channels'.
Cross-slice coupling: agents → profile desktop/src/features/agents/lib/personaEditCaches.ts:21— `invalidatePersonaEditCaches` (slice 'agents') depends on `evictUsersBatchEntries` from slice 'profile'.
Cross-slice coupling: agents → presence desktop/src/features/agents/lib/useAgentAvailability.ts:43— `useAgentAvailabilityLookup` (slice 'agents') depends on `usePresenceQuery` from slice 'presence'.
Cross-slice coupling: agents → presence desktop/src/features/agents/lib/useAgentAvailability.ts:48— `useAgentAvailabilityLookup` (slice 'agents') depends on `presenceQueryKey` from slice 'presence'.
Cross-slice coupling: agents → communities desktop/src/features/agents/managedAgentRuntimeHooks.ts:88— `bootstrapManagedAgentRuntimePairs` (slice 'agents') depends on `loadCommunities` from slice 'communities'.
Cross-slice coupling: agents → communities desktop/src/features/agents/managedAgentRuntimeHooks.ts:128— `clearActiveTurnsForAgentOnStop` (slice 'agents') depends on `loadActiveCommunityId` from slice 'communities'.
Cross-slice coupling: agents → projects desktop/src/features/agents/observerRelayStore.ts:142— `projectChannelRequestListeners` (slice 'agents') depends on `ProjectChannelRequest` from slice 'projects'.
Cross-slice coupling: agents → projects desktop/src/features/agents/observerRelayStore.ts:516— `processLiveObserverEvents` (slice 'agents') depends on `parseProjectChannelRequest` from slice 'projects'.
Cross-slice coupling: agents → channels desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:41— `AddAgentToChannelDialog` (slice 'agents') depends on `useChannelsQuery` from slice 'channels'.
Cross-slice coupling: agents → channels desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:79— `AddAgentToChannelDialog` (slice 'agents') depends on `useChannelMembersQuery` from slice 'channels'.
Duplicated block (7 lines × 2) crates/buzz-acp/src/relay.rs:499— crates/buzz-acp/src/relay.rs:499-505 | crates/buzz-acp/src/relay.rs:512-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/buzz-acp/src/relay.rs:3757— crates/buzz-acp/src/relay.rs:3757-3763 | crates/buzz-ws-client/src/message.rs:92-98 — before extracting anything, compare `crates/buzz-acp/src/relay.rs` and `crates/buzz-ws-client/src/message.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/buzz-admin/src/communities.rs:78— crates/buzz-admin/src/communities.rs:78-84 | crates/buzz-admin/src/communities.rs:130-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/buzz-admin/src/nip_fi.rs:123— crates/buzz-admin/src/nip_fi.rs:123-129 | crates/buzz-admin/src/nip_fi.rs:141-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/buzz-cli/src/commands/dms.rs:42— crates/buzz-cli/src/commands/dms.rs:42-48 | crates/buzz-cli/src/commands/users.rs:484-490 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/buzz-cli/src/commands/pack.rs:16— crates/buzz-cli/src/commands/pack.rs:16-22 | crates/buzz-cli/src/commands/pack.rs:53-59 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/buzz-db/src/store/api_token.rs:28— crates/buzz-db/src/store/api_token.rs:28-35 | crates/buzz-db/src/store/api_token.rs:88-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/buzz-db/src/store/channel.rs:641— crates/buzz-db/src/store/channel.rs:641-647 | crates/buzz-db/src/store/dm.rs:512-518 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/buzz-dev-mcp/src/view_image.rs:263— crates/buzz-dev-mcp/src/view_image.rs:263-269 | desktop/src-tauri/src/commands/media.rs:325-331 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/buzz-media/src/bucket_index.rs:158— crates/buzz-media/src/bucket_index.rs:158-164 | crates/buzz-media/src/bucket_index.rs:182-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/buzz-relay/src/audio/handler.rs:1758— crates/buzz-relay/src/audio/handler.rs:1758-1764 | crates/buzz-relay/src/audio/handler.rs:2613-2619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/buzz-relay/src/handlers/moderation_commands.rs:619— crates/buzz-relay/src/handlers/moderation_commands.rs:619-625 | crates/buzz-relay/src/handlers/relay_admin.rs:51-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/buzz-workflow/src/executor.rs:802— crates/buzz-workflow/src/executor.rs:802-808 | crates/buzz-workflow/src/executor.rs:810-816 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/agent_auth.rs:114— desktop/src-tauri/src/commands/agent_auth.rs:114-120 | desktop/src-tauri/src/commands/agent_auth.rs:250-256 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/agent_settings.rs:26— desktop/src-tauri/src/commands/agent_settings.rs:26-32 | desktop/src-tauri/src/commands/agent_settings.rs:70-76 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/personas/snapshot/import.rs:526— desktop/src-tauri/src/commands/personas/snapshot/import.rs:526-532 | desktop/src-tauri/src/commands/team_snapshot.rs:552-558 — before extracting anything, compare `desktop/src-tauri/src/commands/personas/snapshot/import.rs` and `desktop/src-tauri/src/commands/team_snapshot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:707— desktop/src-tauri/src/commands/personas/snapshot/import.rs:707-713 | desktop/src-tauri/src/commands/team_snapshot.rs:799-805 — before extracting anything, compare `desktop/src-tauri/src/commands/personas/snapshot/import.rs` and `desktop/src-tauri/src/commands/team_snapshot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) desktop/src-tauri/src/commands/profile.rs:242— desktop/src-tauri/src/commands/profile.rs:242-248 | desktop/src-tauri/src/commands/social.rs:134-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.
Duplicated block (7 lines × 2) desktop/src-tauri/src/managed_agents/discovery/login_shell.rs:288— desktop/src-tauri/src/managed_agents/discovery/login_shell.rs:288-294 | desktop/src-tauri/src/managed_agents/discovery/login_shell.rs:297-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) desktop/src-tauri/src/mesh_llm/recovery.rs:402— desktop/src-tauri/src/mesh_llm/recovery.rs:402-408 | desktop/src-tauri/src/mesh_llm/recovery.rs:415-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) desktop/src-tauri/src/migration/backfill.rs:52— desktop/src-tauri/src/migration/backfill.rs:52-58 | desktop/src-tauri/src/migration/team_suffix.rs:68-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) desktop/src-tauri/src/native_relay_client.rs:698— desktop/src-tauri/src/native_relay_client.rs:698-704 | desktop/src-tauri/src/native_relay_client.rs:725-731 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/channel_head_cache.rs:34— desktop/src-tauri/src/channel_head_cache.rs:34-40 | desktop/src-tauri/src/observed_unread.rs:49-55 — 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) desktop/src-tauri/src/channel_head_cache.rs:303— desktop/src-tauri/src/channel_head_cache.rs:303-309 | desktop/src-tauri/src/observed_unread.rs:667-673 — 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) desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs:88— desktop/src-tauri/src/commands/agent_discovery/relay_directory.rs:88-94 | desktop/src-tauri/src/commands/channels/fetch.rs:19-25 — 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.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file desktop/src/protectedFeatures/bestie/BestiePopover.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 desktop/src/features/agents/ui/ManagedAgentRow.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 desktop/src/features/channels/ui/ChannelMemberInviteCard.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 desktop/src/protectedFeatures/bestie/BloomMenu.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 desktop/src/features/agents/ui/ModelPicker.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 desktop/src/features/community-members/ui/CommunityMembersCard.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 desktop/src/features/home/ui/FeedSection.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 desktop/src/protectedFeatures/bestie/BestieGlobalOverlay.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 desktop/src/features/profile/ui/AvatarUpload.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 desktop/test-loader-hooks.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file desktop/src/protectedFeatures/bestie/useBestie.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 desktop/scripts/generate-sound-waveforms.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/check-px-text-core.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file desktop/scripts/texture-card/generate-card-texture.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/check-pubkey-truncation-core.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file desktop/src/features/messages/useLoadMissingAncestors.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 desktop/src/features/channels/ui/QuickBotBar.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 desktop/src/features/home/ui/RecentNotesSection.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 desktop/src/features/community-members/ui/ConfirmRemoveDialog.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 desktop/src/protectedFeatures/internalUi.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 desktop/src/protectedFeatures/bestie/BestieProfileSection.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 mobile/scripts/generate-emoji-data.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/shared/ui/card.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file desktop/src/features/channels/ui/MembersSidebarAgentControls.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 desktop/src/features/agents/lib/pickBotName.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.
Duplicated block (9 lines × 2) crates/buzz-acp/src/lib.rs:3113— crates/buzz-acp/src/lib.rs:3113-3121 | crates/buzz-acp/src/lib.rs:3134-3142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-acp/src/relay.rs:3568— crates/buzz-acp/src/relay.rs:3568-3576 | crates/buzz-acp/src/relay.rs:3595-3603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-agent/src/llm.rs:584— crates/buzz-agent/src/llm.rs:584-592 | crates/buzz-agent/src/llm.rs:752-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) REDACTED:2256— REDACTED:2256-2264 | REDACTED:2393-2403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-db/src/store/reaction.rs:122— crates/buzz-db/src/store/reaction.rs:122-131 | crates/buzz-db/src/store/workflow.rs:309-317 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/buzz-persona/src/validate.rs:211— crates/buzz-persona/src/validate.rs:211-219 | crates/buzz-persona/src/validate.rs:303-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-relay/src/audio/handler.rs:266— crates/buzz-relay/src/audio/handler.rs:266-274 | crates/buzz-relay/src/connection.rs:394-402 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:1210— crates/buzz-relay/src/handlers/ingest.rs:1210-1218 | crates/buzz-relay/src/handlers/ingest.rs:1313-1321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:1932— crates/buzz-relay/src/handlers/side_effects.rs:1932-1940 | crates/buzz-relay/src/handlers/side_effects.rs:2674-2682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-relay/src/main.rs:2238— crates/buzz-relay/src/main.rs:2238-2246 | crates/buzz-relay/src/main.rs:2271-2279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-voice/src/pocket_april.rs:655— crates/buzz-voice/src/pocket_april.rs:655-663 | crates/buzz-voice/src/pocket_april.rs:946-954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/buzz-ws-client/src/connection.rs:163— crates/buzz-ws-client/src/connection.rs:163-171 | crates/buzz-ws-client/src/connection.rs:273-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/git-sign-nostr/src/lib.rs:662— crates/git-sign-nostr/src/lib.rs:662-670 | crates/git-sign-nostr/src/lib.rs:716-724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/git-sign-nostr/src/lib.rs:1585— crates/git-sign-nostr/src/lib.rs:1585-1593 | crates/git-sign-nostr/src/lib.rs:1611-1619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) desktop/src-tauri/crates/buzz-terminal/src/damage.rs:217— desktop/src-tauri/crates/buzz-terminal/src/damage.rs:217-225 | desktop/src-tauri/crates/buzz-terminal/src/damage.rs:277-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.
Duplicated block (9 lines × 2) desktop/src-tauri/src/archive/store.rs:174— desktop/src-tauri/src/archive/store.rs:174-182 | desktop/src-tauri/src/managed_agents/retention.rs:156-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) desktop/src-tauri/src/commands/channels/fetch.rs:230— desktop/src-tauri/src/commands/channels/fetch.rs:230-238 | desktop/src-tauri/src/commands/channels/fetch.rs:334-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) desktop/src-tauri/src/commands/project_git.rs:264— desktop/src-tauri/src/commands/project_git.rs:264-272 | desktop/src-tauri/src/commands/project_git.rs:334-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) desktop/src-tauri/src/commands/project_git.rs:809— desktop/src-tauri/src/commands/project_git.rs:809-817 | desktop/src-tauri/src/commands/project_git.rs:840-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) desktop/src-tauri/src/commands/social.rs:387— desktop/src-tauri/src/commands/social.rs:387-395 | desktop/src-tauri/src/nostr_convert.rs:385-393 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) desktop/src-tauri/src/managed_agents/readiness.rs:588— desktop/src-tauri/src/managed_agents/readiness.rs:588-596 | desktop/src-tauri/src/managed_agents/readiness.rs:607-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) desktop/src-tauri/src/managed_agents/runtime_commands.rs:343— desktop/src-tauri/src/managed_agents/runtime_commands.rs:343-351 | desktop/src-tauri/src/shutdown.rs:128-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) desktop/src-tauri/src/managed_agents/teams.rs:17— desktop/src-tauri/src/managed_agents/teams.rs:17-25 | desktop/src-tauri/src/templates/storage.rs:23-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) desktop/src-tauri/src/managed_agents/teams.rs:167— desktop/src-tauri/src/managed_agents/teams.rs:167-175 | desktop/src-tauri/src/managed_agents/teams.rs:185-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) desktop/src-tauri/src/relay.rs:244— desktop/src-tauri/src/relay.rs:244-252 | desktop/src-tauri/src/relay.rs:289-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-acp/src/relay.rs:3753— crates/buzz-acp/src/relay.rs:3753-3757 | crates/buzz-acp/src/relay.rs:3781-3787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-auth/src/nip_fi/command.rs:588— crates/buzz-auth/src/nip_fi/command.rs:588-592 | crates/buzz-auth/src/nip_fi/verifier.rs:432-436 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/buzz-cli/src/commands/agents.rs:27— crates/buzz-cli/src/commands/agents.rs:27-31 | crates/buzz-cli/src/commands/agents.rs:69-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) REDACTED:1277— REDACTED:1277-1281 | REDACTED:1491-1495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-media/src/storage.rs:296— crates/buzz-media/src/storage.rs:296-300 | crates/buzz-media/src/storage.rs:309-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-media/src/validation.rs:687— crates/buzz-media/src/validation.rs:687-691 | crates/buzz-media/src/validation.rs:720-724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-relay/src/api/bridge.rs:904— crates/buzz-relay/src/api/bridge.rs:904-908 | crates/buzz-relay/src/api/bridge/thread_roots.rs:78-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:447— crates/buzz-relay/src/handlers/side_effects.rs:447-451 | crates/buzz-relay/src/handlers/side_effects.rs:2775-2779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-relay/src/main.rs:2752— crates/buzz-relay/src/main.rs:2752-2756 | crates/buzz-relay/src/main.rs:3046-3050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-sdk/src/mentions.rs:70— crates/buzz-sdk/src/mentions.rs:70-74 | desktop/src-tauri/src/huddle/preprocessing.rs:200-204 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/buzz-voice/src/pocket_april.rs:648— crates/buzz-voice/src/pocket_april.rs:648-652 | crates/buzz-voice/src/pocket_april.rs:939-943 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/personas/card.rs:549— desktop/src-tauri/src/commands/personas/card.rs:549-553 | desktop/src-tauri/src/commands/personas/snapshot.rs:265-269 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) desktop/src-tauri/src/commands/project_git.rs:632— desktop/src-tauri/src/commands/project_git.rs:632-636 | desktop/src-tauri/src/commands/project_git_file_content.rs:136-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.
Duplicated block (5 lines × 2) desktop/src-tauri/src/managed_agents/agent_snapshot.rs:459— desktop/src-tauri/src/managed_agents/agent_snapshot.rs:459-463 | desktop/src-tauri/src/managed_agents/agent_snapshot.rs:546-550 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/managed_agents/nest.rs:185— desktop/src-tauri/src/managed_agents/nest.rs:185-191 | desktop/src-tauri/src/managed_agents/nest.rs:211-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-media/src/bucket_index.rs:75— crates/buzz-media/src/bucket_index.rs:75-79 | crates/buzz-push-gateway/src/http.rs:71-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) desktop/src-tauri/src/commands/teams/adopt/apply.rs:420— desktop/src-tauri/src/commands/teams/adopt/apply.rs:420-424 | desktop/src-tauri/src/managed_agents/team_catalog.rs:369-373 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/buzz-relay/src/api/git/cas_publish.rs:540— crates/buzz-relay/src/api/git/cas_publish.rs:540-544 | crates/buzz-relay/src/api/git/cas_publish.rs:724-731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-voice/src/imported.rs:286— crates/buzz-voice/src/imported.rs:286-290 | desktop/src-tauri/src/managed_agents/storage.rs:644-650 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/buzz-core/src/engram.rs:299— crates/buzz-core/src/engram.rs:299-305 | crates/buzz-core/src/private_managed_agent.rs:737-741 — before extracting anything, compare `crates/buzz-core/src/engram.rs` and `crates/buzz-core/src/private_managed_agent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/buzz-relay/src/handlers/identity_archive.rs:172— crates/buzz-relay/src/handlers/identity_archive.rs:172-176 | crates/buzz-relay/src/handlers/identity_archive.rs:202-208 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/archive/store_migrations.rs:212— desktop/src-tauri/src/archive/store_migrations.rs:212-216 | desktop/src-tauri/src/archive/store_migrations.rs:285-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-cli/src/commands/agents.rs:371— crates/buzz-cli/src/commands/agents.rs:371-375 | crates/buzz-cli/src/commands/agents.rs:433-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/buzz-cli/src/commands/channels.rs:374— crates/buzz-cli/src/commands/channels.rs:374-378 | crates/buzz-cli/src/commands/workflows.rs:80-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/buzz-cli/src/commands/channels.rs:819— crates/buzz-cli/src/commands/channels.rs:819-823 | crates/buzz-cli/src/commands/emoji.rs:128-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/buzz-acp/src/queue.rs:2435— crates/buzz-acp/src/queue.rs:2435-2444 | crates/buzz-acp/src/queue.rs:2478-2487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/buzz-acp/src/relay.rs:3746— crates/buzz-acp/src/relay.rs:3746-3755 | crates/buzz-ws-client/src/message.rs:81-90 — before extracting anything, compare `crates/buzz-acp/src/relay.rs` and `crates/buzz-ws-client/src/message.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/buzz-cli/src/commands/social.rs:50— crates/buzz-cli/src/commands/social.rs:50-59 | desktop/src-tauri/src/commands/social.rs:108-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/buzz-db/src/store/api_token.rs:37— crates/buzz-db/src/store/api_token.rs:37-46 | crates/buzz-db/src/store/api_token.rs:96-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) REDACTED:1443— REDACTED:1443-1452 | REDACTED:1705-1714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/buzz-db/src/store/workflow.rs:1019— crates/buzz-db/src/store/workflow.rs:1019-1028 | crates/buzz-db/src/store/workflow.rs:1237-1246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/buzz-dev-mcp/src/shell.rs:550— crates/buzz-dev-mcp/src/shell.rs:550-559 | desktop/src-tauri/src/managed_agents/git_bash.rs:408-417 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/buzz-relay/src/api/bridge.rs:2525— crates/buzz-relay/src/api/bridge.rs:2525-2534 | crates/buzz-relay/src/handlers/req.rs:816-825 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/handlers/req.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/buzz-relay/src/handlers/identity_archive.rs:143— crates/buzz-relay/src/handlers/identity_archive.rs:143-152 | crates/buzz-relay/src/handlers/relay_admin.rs:238-247 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:697— crates/buzz-relay/src/handlers/ingest.rs:697-706 | crates/buzz-relay/src/handlers/side_effects.rs:2940-2949 — before extracting anything, compare `crates/buzz-relay/src/handlers/ingest.rs` and `crates/buzz-relay/src/handlers/side_effects.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/buzz-relay/src/protocol.rs:118— crates/buzz-relay/src/protocol.rs:118-127 | crates/buzz-relay/src/protocol.rs:191-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/buzz-voice/src/pocket_april.rs:406— crates/buzz-voice/src/pocket_april.rs:406-415 | crates/buzz-voice/src/pocket_april.rs:484-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) desktop/src-tauri/src/commands/admin/mod.rs:984— desktop/src-tauri/src/commands/admin/mod.rs:984-993 | desktop/src-tauri/src/commands/admin/mod.rs:1020-1029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:802— desktop/src-tauri/src/commands/personas/snapshot/import.rs:802-811 | desktop/src-tauri/src/commands/team_snapshot.rs:903-912 — before extracting anything, compare `desktop/src-tauri/src/commands/personas/snapshot/import.rs` and `desktop/src-tauri/src/commands/team_snapshot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) desktop/src-tauri/src/huddle/pipeline.rs:510— desktop/src-tauri/src/huddle/pipeline.rs:510-519 | desktop/src-tauri/src/huddle/pipeline.rs:636-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) desktop/src-tauri/src/managed_agents/effective_config/mod.rs:82— desktop/src-tauri/src/managed_agents/effective_config/mod.rs:82-91 | desktop/src-tauri/src/managed_agents/effective_config/mod.rs:196-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) desktop/src-tauri/src/mesh_llm/mod.rs:689— desktop/src-tauri/src/mesh_llm/mod.rs:689-698 | desktop/src-tauri/src/mesh_llm/mod.rs:705-714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) desktop/src-tauri/src/persona_catalog.rs:152— desktop/src-tauri/src/persona_catalog.rs:152-161 | desktop/src-tauri/src/team_catalog.rs:234-243 — before extracting anything, compare `desktop/src-tauri/src/persona_catalog.rs` and `desktop/src-tauri/src/team_catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) desktop/src-tauri/src/persona_catalog.rs:166— desktop/src-tauri/src/persona_catalog.rs:166-175 | desktop/src-tauri/src/team_catalog.rs:248-257 — before extracting anything, compare `desktop/src-tauri/src/persona_catalog.rs` and `desktop/src-tauri/src/team_catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/buzz-agent/src/mcp.rs:911— crates/buzz-agent/src/mcp.rs:911-920 | crates/buzz-dev-mcp/src/str_replace.rs:166-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/buzz-dev-mcp/src/lib.rs:189— crates/buzz-dev-mcp/src/lib.rs:189-198 | desktop/src-tauri/src/util.rs:212-221 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) desktop/src-tauri/src/archive/store.rs:184— desktop/src-tauri/src/archive/store.rs:184-193 | desktop/src-tauri/src/managed_agents/retention.rs:166-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) desktop/src-tauri/src/commands/personas/snapshot.rs:164— desktop/src-tauri/src/commands/personas/snapshot.rs:164-173 | desktop/src-tauri/src/commands/team_snapshot.rs:87-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/buzz-agent/src/catalog.rs:771— crates/buzz-agent/src/catalog.rs:771-780 | REDACTED:3920-3929 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/buzz-sdk/src/builders.rs:1038— crates/buzz-sdk/src/builders.rs:1038-1047 | crates/buzz-sdk/src/builders.rs:1101-1112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Change coupling: ChannelPane.types.ts ↔ ChannelScreen.tsx desktop/src/features/channels/ui/ChannelPane.types.ts:1— `desktop/src/features/channels/ui/ChannelPane.types.ts` and `desktop/src/features/channels/ui/ChannelScreen.tsx` change together 85% of the time (11 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `00e61eaf` fix(desktop): surface channel history load failures (#7013); `f6e6617a` fix(desktop): bound thread /query and surface load errors, not false-…; `4bf80978` fix(messages): route edits to the owning composer (#6575) — run `git show` on any of them.
Change coupling: thread_detail_page.dart ↔ forum_thread_page.dart mobile/lib/features/channels/thread_detail_page.dart:1— `mobile/lib/features/channels/thread_detail_page.dart` and `mobile/lib/features/forum/forum_thread_page.dart` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `4ef23609` feat(mobile): show contextual names in channel conversations (#7895); `06582ee6` Render mobile agent mention chips (#3702); `7e009a89` fix(mobile): open profile sheet when tapping @mentions (#1876) — run `git show` on any of them.
Change coupling: channel_detail_page.dart ↔ forum_thread_page.dart mobile/lib/features/channels/channel_detail_page.dart:1— `mobile/lib/features/channels/channel_detail_page.dart` and `mobile/lib/features/forum/forum_thread_page.dart` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4ef23609` feat(mobile): show contextual names in channel conversations (#7895); `06582ee6` Render mobile agent mention chips (#3702); `7b6e1265` fix(mobile): fix agent avatars on mobile (#1837) — run `git show` on any of them.
Change coupling: ForumComposer.tsx ↔ MessageComposer.tsx desktop/src/features/forum/ui/ForumComposer.tsx:1— `desktop/src/features/forum/ui/ForumComposer.tsx` and `desktop/src/features/messages/ui/MessageComposer.tsx` change together 69% of the time (11 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `571c1902` fix(desktop): scope composer autocomplete to focus (#6860); `b4967589` fix(desktop): resolve exact typed mentions on space (#6862); `bcf353c9` fix(desktop): enforce agent mention authorization at send boundaries … — run `git show` on any of them.
Change coupling: events.rs ↔ tauri.ts desktop/src-tauri/src/events.rs:1— `desktop/src-tauri/src/events.rs` and `desktop/src/shared/api/tauri.ts` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `3e56331e` fix(delete): make agent-deleted messages disappear from desktop UI im…; `7dd5b345` Add channel visibility & ephemeral TTL controls to manage sidebar (#911); `5d7c7489` fix(presence): clear on disconnect, fix heartbeat/TTL, drop broken RE… — run `git show` on any of them.
Change coupling: agents.rs ↔ restore.rs desktop/src-tauri/src/commands/agents.rs:1— `desktop/src-tauri/src/commands/agents.rs` and `desktop/src-tauri/src/managed_agents/restore.rs` change together 61% of the time (14 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `076081bf` Rename Bumble agent to Pollen (#5864); `1f48860b` fix(desktop): propagate agent definition edits to instances and remov…; `79a05753` fix(desktop): refresh persona env vars on respawn — record.env_vars i… — run `git show` on any of them.
Change coupling: activity_page.dart ↔ search_page.dart mobile/lib/features/activity/activity_page.dart:1— `mobile/lib/features/activity/activity_page.dart` and `mobile/lib/features/search/search_page.dart` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `69107dc3` Polish mobile message threads and composer (#5645); `ff0b7982` Polish mobile top navigation (#4778); `06582ee6` Render mobile agent mention chips (#3702) — run `git show` on any of them.
Change coupling: channel_detail_page.dart ↔ members_sheet.dart mobile/lib/features/channels/channel_detail_page.dart:1— `mobile/lib/features/channels/channel_detail_page.dart` and `mobile/lib/features/channels/members_sheet.dart` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `05d17149` fix(mobile): manage channel members from profile sheets (#8078); `7b6e1265` fix(mobile): fix agent avatars on mobile (#1837); `088c4e7d` feat(mobile): add user profile sheet and polish bottom sheets (#453) — run `git show` on any of them.
Change coupling: teams.rs ↔ types.ts desktop/src-tauri/src/managed_agents/teams.rs:1— `desktop/src-tauri/src/managed_agents/teams.rs` and `desktop/src/shared/api/types.ts` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `ba2fdbf6` refactor(desktop): consolidate packs into teams (#852); `9a98e60f` feat: provider/model selection for personas and runtime-aware env inj…; `32347d11` feat(desktop): per-persona and per-agent env var overrides (#594) — run `git show` on any of them.
Change coupling: DayDivider.tsx ↔ MessageTimeline.tsx desktop/src/features/messages/ui/DayDivider.tsx:1— `desktop/src/features/messages/ui/DayDivider.tsx` and `desktop/src/features/messages/ui/MessageTimeline.tsx` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `a5bf3c5a` Refine desktop timeline activity presentation (#4582); `8c388479` Keep channel day dividers sticky (#1420); `047db421` fix(desktop): single-owner anchored scroll for dynamic loading (#1115) — run `git show` on any of them.
Change coupling: MessageComposer.tsx ↔ MessageComposerToolbar.tsx desktop/src/features/messages/ui/MessageComposer.tsx:1— `desktop/src/features/messages/ui/MessageComposer.tsx` and `desktop/src/features/messages/ui/MessageComposerToolbar.tsx` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `1aa87bb2` feat(composer): compose spoiler, annotation, and tooltip controls (#1…; `770266d2` feat(composer): link editing — inline popover, modal picker, buzz:// …; `05fc69b8` Video Player Improvements (#993) — run `git show` on any of them.
Change coupling: mod.rs ↔ builders.rs crates/buzz-cli/src/commands/mod.rs:1— `crates/buzz-cli/src/commands/mod.rs` and `crates/buzz-sdk/src/builders.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `47d068e2` feat(cli): add buzz gifs command group and NIP-30 emoji tags on messa…; `b7bb1512` feat(projects): add buzz projects CLI commands (NIP-MP kind:30621) (#…; `5fef9b72` Add NIP-34 git pull request CLI support (#1279) — run `git show` on any of them.
Change coupling: channels_page.dart ↔ search_page.dart mobile/lib/features/channels/channels_page.dart:1— `mobile/lib/features/channels/channels_page.dart` and `mobile/lib/features/search/search_page.dart` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `26f4c3ed` feat(mobile): browse and join open channels (#6243); `ff0b7982` Polish mobile top navigation (#4778); `4555899a` Polish mobile navigation and menus (#3486) — run `git show` on any of them.
Change coupling: HomeView.tsx ↔ InboxMessageRow.tsx desktop/src/features/home/ui/HomeView.tsx:1— `desktop/src/features/home/ui/HomeView.tsx` and `desktop/src/features/home/ui/InboxMessageRow.tsx` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `514195b1` feat(desktop): add Inbox message delete action (#5779); `eb6a3756` fix(desktop): enable message editing in Inbox (#2198); `7f769b24` fix(desktop): align inbox layout and draft details (#2143) — run `git show` on any of them.
Change coupling: InboxDetailPane.tsx ↔ InboxListPane.tsx desktop/src/features/home/ui/InboxDetailPane.tsx:1— `desktop/src/features/home/ui/InboxDetailPane.tsx` and `desktop/src/features/home/ui/InboxListPane.tsx` change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `4d77175c` fix(client): resurface hidden DMs from live activity (#6885); `17d2147e` Fix video comment effect wrapping (#5748); `7f769b24` fix(desktop): align inbox layout and draft details (#2143) — run `git show` on any of them.
Change coupling: AgentSessionThreadPanel.tsx ↔ UserProfilePanel.tsx desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx:1— `desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx` and `desktop/src/features/profile/ui/UserProfilePanel.tsx` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `fd5d04de` fix(desktop): scope observer feed by channel and add session-boundary…; `1f5ba5bb` fix(desktop): sync derived active-turn liveness in channel activity p…; `360d2e54` Fix channel header shared blur layering (#1336) — run `git show` on any of them.
Change coupling: formatTimelineMessages.ts ↔ MessageTimeline.tsx desktop/src/features/messages/lib/formatTimelineMessages.ts:1— `desktop/src/features/messages/lib/formatTimelineMessages.ts` and `desktop/src/features/messages/ui/MessageTimeline.tsx` change together 50% of the time (15 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `463db6de` feat(desktop): show agent owners in messages (#2080); `6cca7599` desktop: fix scrollback paging and visible history depth (#1153); `047db421` fix(desktop): single-owner anchored scroll for dynamic loading (#1115) — run `git show` on any of them.
Change coupling: main.rs ↔ main.rs crates/buzz-admin/src/main.rs:1— `crates/buzz-admin/src/main.rs` and `crates/buzz-relay/src/main.rs` change together 50% of the time (11 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `039e1c8d` feat(relay): write the NIP-43 member list in the membership transacti…; `6286a543` feat(relay): store per-community NIP-FI issuer bindings (#8372); `71d7aa04` feat(relay): add the system channel type (#8180) — run `git show` on any of them.
Change coupling: activity_page.dart ↔ thread_detail_page.dart mobile/lib/features/activity/activity_page.dart:1— `mobile/lib/features/activity/activity_page.dart` and `mobile/lib/features/channels/thread_detail_page.dart` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `9ade5d1a` feat(mobile): write catch-up and visible-message read marks like the …; `93114c9c` Fix mobile Activity thread navigation (#5850); `69107dc3` Polish mobile message threads and composer (#5645) — run `git show` on any of them.
Change coupling: types.ts ↔ tauri.ts desktop/src/features/messages/types.ts:1— `desktop/src/features/messages/types.ts` and `desktop/src/shared/api/tauri.ts` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `3d61fd60` feat(desktop): add message editing support (#182); `fa939ec1` Polish chat replies and managed agent creation (#81); `d9f81322` Add end-to-end emoji reactions (#57) — run `git show` on any of them.
Change coupling: readStateManager.ts ↔ useUnreadChannels.ts desktop/src/features/channels/readState/readStateManager.ts:1— `desktop/src/features/channels/readState/readStateManager.ts` and `desktop/src/features/channels/useUnreadChannels.ts` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `733c766e` fix(desktop): clear unread projections from message read markers (#1242); `5268fac2` Fix monotonic read-state merges (#884); `269b35e8` fix(mobile+desktop): cross-device read state sync + diagnostic loggin… — run `git show` on any of them.
Change coupling: hooks.ts ↔ OnboardingFlow.tsx desktop/src/features/onboarding/hooks.ts:1— `desktop/src/features/onboarding/hooks.ts` and `desktop/src/features/onboarding/ui/OnboardingFlow.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `8688c041` Rework first-launch community onboarding (#1936); `5bb61929` fix(desktop): remediate all onboarding dead paths (D1-D7) (#1856); `e4a0824c` fix(onboarding): skip onboarding when relay already has a profile (#973) — run `git show` on any of them.
Change coupling: AgentSessionTranscriptList.tsx ↔ agentSessionTranscript.ts desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1— `desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx` and `desktop/src/features/agents/ui/agentSessionTranscript.ts` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1df4a4e7` fix(observer): align scroll-anchor ids with transcript display-block …; `84ec63aa` fix(desktop): separate system prompt from turn context (#1754); `426f0448` feat(agents): group activity tool bursts (#1571) — run `git show` on any of them.
Change coupling: AgentSessionTranscriptList.tsx ↔ AgentSessionThreadPanel.tsx desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1— `desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx` and `desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1df4a4e7` fix(observer): align scroll-anchor ids with transcript display-block …; `51234bd8` fix(desktop): preserve archived observer history (#1752); `fd5d04de` fix(desktop): scope observer feed by channel and add session-boundary… — run `git show` on any of them.
Change coupling: agent_config.rs ↔ runtime.rs desktop/src-tauri/src/commands/agent_config.rs:1— `desktop/src-tauri/src/commands/agent_config.rs` and `desktop/src-tauri/src/managed_agents/runtime.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `be95a8a9` fix(config-bridge): add harness-definition env tier and fix equal-val…; `25bb7147` fix(desktop): make doctor installs retryable with per-runtime progres…; `a415f0f3` feat(desktop): auto-restart agents on config change (Chunk F) (#1649) — run `git show` on any of them.
Swallowed exception (caught, then discarded) web/src/shared/lib/nostr-client.ts:84— `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) mobile/lib/shared/utils/string_utils.dart:30— `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) mobile/lib/shared/theme/community_theme_preference.dart:100— `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) mobile/lib/shared/theme/community_theme_sync.dart:322— `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) mobile/lib/shared/security/sensitive_action_authorizer.dart:36— `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) mobile/lib/shared/security/sensitive_action_authorizer.dart:53— `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) mobile/lib/shared/security/sensitive_action_authorizer.dart:77— `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) mobile/lib/shared/reminders/reminder_service.dart:138— `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) mobile/lib/shared/relay/media_upload.dart:841— `on 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) mobile/lib/shared/relay/relay_provider.dart:122— `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) mobile/lib/shared/read_state/read_state_format.dart:357— `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) mobile/lib/shared/profile/user_cache_provider.dart:127— `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) mobile/lib/shared/mentions/agent_identity_provider.dart:54— `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) mobile/lib/shared/me/me_assistants.dart:79— `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) mobile/lib/shared/me/me_search_placement.dart:16— `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) mobile/lib/shared/identity_transfer/nsec_export_sheet.dart:98— `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) mobile/lib/shared/identity_transfer/nsec_import_sheet.dart:67— `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) mobile/lib/shared/hosted/hosted_flow_provider.dart:153— `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) mobile/lib/shared/custom_emoji/custom_emoji_provider.dart:38— `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) mobile/lib/shared/crypto/nip_oa.dart:17— `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) mobile/lib/shared/community/community.dart:175— `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) mobile/lib/shared/community/community_icon_artwork.dart:78— `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) mobile/lib/shared/community/community_icon_provider.dart:88— `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) mobile/lib/shared/auth/auth_provider.dart:120— `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) mobile/lib/features/profile/animated_avatar_capture.dart:232— `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.
Duplicated block (11 lines × 2) crates/buzz-admin/src/main.rs:459— crates/buzz-admin/src/main.rs:459-469 | crates/buzz-admin/src/main.rs:498-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-cli/src/commands/agents.rs:34— crates/buzz-cli/src/commands/agents.rs:34-44 | crates/buzz-cli/src/commands/agents.rs:76-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-db/src/store/channel_members.rs:2005— crates/buzz-db/src/store/channel_members.rs:2005-2015 | crates/buzz-db/src/store/event.rs:1626-1636 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/buzz-db/src/store/community.rs:316— crates/buzz-db/src/store/community.rs:316-326 | crates/buzz-db/src/store/nip_fi_binding.rs:219-229 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/buzz-db/src/store/reaction.rs:390— crates/buzz-db/src/store/reaction.rs:390-400 | crates/buzz-db/src/store/relay_admin_actions.rs:1341-1351 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/buzz-pair-relay/src/lib.rs:301— crates/buzz-pair-relay/src/lib.rs:301-311 | crates/buzz-pair-relay/src/lib.rs:585-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/admin_action_worker.rs:49— crates/buzz-relay/src/handlers/admin_action_worker.rs:49-59 | crates/buzz-relay/src/handlers/admin_outbox_worker.rs:50-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/count.rs:241— crates/buzz-relay/src/handlers/count.rs:241-251 | crates/buzz-relay/src/handlers/count.rs:328-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:659— crates/buzz-relay/src/handlers/ingest.rs:659-669 | crates/buzz-relay/src/handlers/side_effects.rs:3021-3031 — before extracting anything, compare `crates/buzz-relay/src/handlers/ingest.rs` and `crates/buzz-relay/src/handlers/side_effects.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:2388— crates/buzz-relay/src/handlers/ingest.rs:2388-2398 | crates/buzz-relay/src/handlers/ingest.rs:2414-2424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:3680— crates/buzz-relay/src/handlers/side_effects.rs:3680-3690 | crates/buzz-relay/src/handlers/side_effects.rs:4137-4147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-voice/src/pocket_april.rs:418— crates/buzz-voice/src/pocket_april.rs:418-428 | crates/buzz-voice/src/pocket_april.rs:496-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-voice/src/pocket_april.rs:632— crates/buzz-voice/src/pocket_april.rs:632-642 | crates/buzz-voice/src/pocket_april.rs:921-931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-ws-client/src/connection.rs:234— crates/buzz-ws-client/src/connection.rs:234-244 | crates/buzz-ws-client/src/connection.rs:288-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) desktop/src-tauri/src/commands/agent_discovery.rs:592— desktop/src-tauri/src/commands/agent_discovery.rs:592-602 | desktop/src-tauri/src/commands/global_agent_config.rs:329-339 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) desktop/src-tauri/src/commands/messages.rs:273— desktop/src-tauri/src/commands/messages.rs:273-283 | desktop/src-tauri/src/commands/messages.rs:381-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:772— desktop/src-tauri/src/commands/personas/snapshot/import.rs:772-782 | desktop/src-tauri/src/commands/team_snapshot.rs:873-883 — before extracting anything, compare `desktop/src-tauri/src/commands/personas/snapshot/import.rs` and `desktop/src-tauri/src/commands/team_snapshot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) desktop/src-tauri/src/commands/project_git_branches.rs:58— desktop/src-tauri/src/commands/project_git_branches.rs:58-68 | desktop/src-tauri/src/commands/project_git_branches.rs:136-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) desktop/src-tauri/src/managed_agents/agent_snapshot.rs:371— desktop/src-tauri/src/managed_agents/agent_snapshot.rs:371-381 | desktop/src-tauri/src/managed_agents/team_snapshot.rs:149-159 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) desktop/src-tauri/src/managed_agents/config_bridge/reader.rs:330— desktop/src-tauri/src/managed_agents/config_bridge/reader.rs:330-340 | desktop/src-tauri/src/managed_agents/config_bridge/reader.rs:489-499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-db/src/store/allowlist.rs:122— crates/buzz-db/src/store/allowlist.rs:122-132 | crates/buzz-db/src/store/channel_members.rs:1851-1870 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/buzz-relay/src/protocol.rs:103— crates/buzz-relay/src/protocol.rs:103-115 | crates/buzz-relay/src/protocol.rs:178-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/buzz-db/src/store/git_repo.rs:54— crates/buzz-db/src/store/git_repo.rs:54-65 | crates/buzz-db/src/store/user.rs:398-408 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:1413— crates/buzz-relay/src/handlers/ingest.rs:1413-1424 | crates/buzz-relay/src/handlers/ingest.rs:1485-1495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) mobile/lib/features/activity/activity_page.dart:107— mobile/lib/features/activity/activity_page.dart:107-117 | mobile/lib/features/channels/me/me_page.dart:50-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
buzz_acp::run_harness (cognitive 398) crates/buzz-acp/src/lib.rs:2838— buzz_acp::run_harness has cognitive complexity 398 (threshold 15). Drivers by points: if/else 105 (276 pts), loops 21 (55 pts), match/switch 22 (54 pts), boolean chains 13 (nesting depth added 237). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_acp::relay::run_background_task (cognitive 171) crates/buzz-acp/src/relay.rs:1748— buzz_acp::relay::run_background_task has cognitive complexity 171 (threshold 15). Drivers by points: if/else 37 (128 pts), match/switch 10 (35 pts), boolean chains 7, loops 1 (nesting depth added 116). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_acp::pool::run_prompt_task (cognitive 143) crates/buzz-acp/src/pool.rs:2415— buzz_acp::pool::run_prompt_task has cognitive complexity 143 (threshold 15). Drivers by points: if/else 47 (96 pts), match/switch 22 (41 pts), boolean chains 6 (nesting depth added 68). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_acp::relay::handle_ws_message (cognitive 113) crates/buzz-acp/src/relay.rs:2185— buzz_acp::relay::handle_ws_message has cognitive complexity 113 (threshold 15). Drivers by points: if/else 32 (80 pts), match/switch 10 (30 pts), boolean chains 3 (nesting depth added 68). 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.
buzz_acp::handle_prompt_result (cognitive 55) crates/buzz-acp/src/lib.rs:5231— buzz_acp::handle_prompt_result has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (39 pts), match/switch 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::queue::format_context_hints (cognitive 49) crates/buzz-acp/src/queue.rs:1951— buzz_acp::queue::format_context_hints has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (45 pts), boolean chains 3, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::relay::resubscribe_after_reconnect (cognitive 44) crates/buzz-acp/src/relay.rs:2681— buzz_acp::relay::resubscribe_after_reconnect has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::config::resolve_channel_filters (cognitive 39) crates/buzz-acp/src/config.rs:1383— buzz_acp::config::resolve_channel_filters has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 5 (14 pts), match/switch 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::relay::execute_connected_command (cognitive 38) crates/buzz-acp/src/relay.rs:1560— buzz_acp::relay::execute_connected_command has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 2, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buzz_acp::run_models (cognitive 35) crates/buzz-acp/src/lib.rs:6316— buzz_acp::run_models has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (12 pts), match/switch 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_acp::relay::merge_discovered_channels (cognitive 33) crates/buzz-acp/src/relay.rs:181— buzz_acp::relay::merge_discovered_channels has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 2 (8 pts), loops 3 (6 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_acp::relay::wait_for_reconnect (cognitive 32) crates/buzz-acp/src/relay.rs:3215— buzz_acp::relay::wait_for_reconnect has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 5 (16 pts), if/else 6 (11 pts), loops 3 (5 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buzz_acp::config::resolve_dynamic_channel_filter (cognitive 30) crates/buzz-acp/src/config.rs:1478— buzz_acp::config::resolve_dynamic_channel_filter has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (6 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::relay::try_autonomous_reconnect (cognitive 29) crates/buzz-acp/src/relay.rs:3085— buzz_acp::relay::try_autonomous_reconnect has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 4 (9 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buzz_acp::pool::create_session_and_apply_model (cognitive 27) crates/buzz-acp/src/pool.rs:1581— buzz_acp::pool::create_session_and_apply_model has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::queue::format_prompt (cognitive 26) crates/buzz-acp/src/queue.rs:2338— buzz_acp::queue::format_prompt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (4 pts), boolean chains 1, 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.
buzz_acp::relay::drain_commands (cognitive 25) crates/buzz-acp/src/relay.rs:2985— buzz_acp::relay::drain_commands has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (10 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.
buzz_acp::pool::parse_nostr_thread_response_with_meta (cognitive 23) crates/buzz-acp/src/pool.rs:4748— buzz_acp::pool::parse_nostr_thread_response_with_meta has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::acp::resolve_model_switch_method (cognitive 22) crates/buzz-acp/src/acp.rs:2295— buzz_acp::acp::resolve_model_switch_method has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::setup_mode::run_setup_listener (cognitive 21) crates/buzz-acp/src/setup_mode.rs:321— buzz_acp::setup_mode::run_setup_listener has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2, 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.
buzz_acp::config::load_rules (cognitive 20) crates/buzz-acp/src/config.rs:1295— buzz_acp::config::load_rules has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::filter::match_event (cognitive 20) crates/buzz-acp/src/filter.rs:368— buzz_acp::filter::match_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::run_relay_observer_publisher (cognitive 18) crates/buzz-acp/src/lib.rs:1399— buzz_acp::run_relay_observer_publisher has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (5 pts), loops 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::dispatch_pending (cognitive 18) crates/buzz-acp/src/lib.rs:4942— buzz_acp::dispatch_pending has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_acp::acp::build_codex_config_env (cognitive 18) crates/buzz-acp/src/acp.rs:282— buzz_acp::acp::build_codex_config_env has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (12 lines × 2) crates/buzz-acp/src/queue.rs:507— crates/buzz-acp/src/queue.rs:507-518 | crates/buzz-acp/src/queue.rs:857-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-agent/src/llm.rs:2557— crates/buzz-agent/src/llm.rs:2557-2568 | crates/buzz-agent/src/llm.rs:2581-2592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-db/src/store/channel.rs:1125— crates/buzz-db/src/store/channel.rs:1125-1136 | crates/buzz-db/src/store/channel.rs:1169-1180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-db/src/store/community.rs:744— crates/buzz-db/src/store/community.rs:744-755 | crates/buzz-db/src/store/community.rs:802-813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-db/src/store/partition/maintenance.rs:580— crates/buzz-db/src/store/partition/maintenance.rs:580-591 | crates/buzz-db/src/store/partition/maintenance.rs:677-688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-relay/src/api/git/cas_publish.rs:878— crates/buzz-relay/src/api/git/cas_publish.rs:878-889 | crates/buzz-relay/src/api/git/transport.rs:1552-1563 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/buzz-relay/src/api/git/store.rs:371— crates/buzz-relay/src/api/git/store.rs:371-382 | crates/buzz-relay/src/api/git/store.rs:397-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-relay/src/handlers/event.rs:724— crates/buzz-relay/src/handlers/event.rs:724-738 | crates/buzz-relay/src/handlers/event.rs:859-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-sdk/src/broker/actions/args.rs:529— crates/buzz-sdk/src/broker/actions/args.rs:529-540 | crates/buzz-sdk/src/broker/actions/outcomes.rs:244-255 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/buzz-voice/src/pocket_april.rs:562— crates/buzz-voice/src/pocket_april.rs:562-573 | crates/buzz-voice/src/pocket_april.rs:872-883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) desktop/src-tauri/src/archive/store_migrations.rs:221— desktop/src-tauri/src/archive/store_migrations.rs:221-232 | desktop/src-tauri/src/archive/store_migrations.rs:294-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) desktop/src-tauri/src/commands/agent_discovery.rs:649— desktop/src-tauri/src/commands/agent_discovery.rs:649-660 | desktop/src-tauri/src/commands/global_agent_config.rs:387-398 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) desktop/src-tauri/src/commands/agents.rs:858— desktop/src-tauri/src/commands/agents.rs:858-869 | desktop/src-tauri/src/commands/agents.rs:1021-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-db/src/store/channel.rs:529— crates/buzz-db/src/store/channel.rs:529-540 | crates/buzz-db/src/store/workflow.rs:755-771 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) desktop/src-tauri/src/archive/store_migrations.rs:46— desktop/src-tauri/src/archive/store_migrations.rs:46-59 | desktop/src-tauri/src/archive/store_migrations.rs:195-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) desktop/src-tauri/src/app_state.rs:520— desktop/src-tauri/src/app_state.rs:520-531 | desktop/src-tauri/src/app_state.rs:604-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-agent/src/llm.rs:2045— crates/buzz-agent/src/llm.rs:2045-2056 | crates/buzz-agent/src/llm.rs:2479-2490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-db/src/store/community.rs:726— crates/buzz-db/src/store/community.rs:726-737 | crates/buzz-db/src/store/community.rs:785-796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-relay/src/api/git/store.rs:675— crates/buzz-relay/src/api/git/store.rs:675-686 | crates/buzz-relay/src/api/git/store.rs:770-781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) desktop/src-tauri/src/commands/project_git.rs:511— desktop/src-tauri/src/commands/project_git.rs:511-522 | desktop/src-tauri/src/commands/project_git.rs:525-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:2471— crates/buzz-relay/src/handlers/side_effects.rs:2471-2482 | crates/buzz-relay/src/handlers/side_effects.rs:2509-2520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) mobile/ios/Runner/NativeProfileTextEditor.swift:90— mobile/ios/Runner/NativeProfileTextEditor.swift:90-101 | mobile/ios/Runner/NativeProfileTextEditor.swift:309-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) mobile/ios/Runner/ConcentricSheetSurface.swift:16— mobile/ios/Runner/ConcentricSheetSurface.swift:16-27 | mobile/ios/Runner/NativeMessageActionSurface.swift:262-273 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) mobile/lib/features/channels/channel_detail_page/empty_messages.dart:14— mobile/lib/features/channels/channel_detail_page/empty_messages.dart:14-25 | mobile/lib/features/forum/forum_posts_view.dart:211-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) mobile/lib/features/pairing/pairing_provider.dart:220— mobile/lib/features/pairing/pairing_provider.dart:220-231 | mobile/lib/features/pairing/pairing_provider.dart:242-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 1 more in this group — see findings.md.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×24
Animation without a prefers-reduced-motion guard desktop/src/features/messages/ui/ComposerAddressControls.tsx:353— <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard desktop/src/shared/ui/progress.tsx:33— <div> moves — its `animate-[progress-indeterminate_1.2s_ease-in-out_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:2— `.sprout-arc-spinner` moves (`animation: sprout-arc-spinner-spin 500ms linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:282— `.buzz-poof-frame` moves (`animation: buzz-poof-frame 400ms linear both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:294— `.buzz-poof-frame-1` moves (`animation-name: buzz-poof-frame-1`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:298— `.buzz-poof-frame-2` moves (`animation-name: buzz-poof-frame-2`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:302— `.buzz-poof-frame-3` moves (`animation-name: buzz-poof-frame-3`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:306— `.buzz-poof-frame-4` moves (`animation-name: buzz-poof-frame-4`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:310— `.buzz-poof-frame-5` moves (`animation-name: buzz-poof-frame-5`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:518— `.buzz-sidebar-action-description__reel` moves (`animation: buzz-sidebar-action-description-roll-up 260ms
cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:577— `.buzz-animated-count__slot[data-direction="up"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:582— `.buzz-animated-count__slot[data-direction="down"] .buzz-animated-count__reel` moves (`animation: buzz-animated-count-roll-down 260ms cubic-bezier(0.2, 0.8, 0.2, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:592— `.buzz-animated-count__symbol[data-direction="up"]` moves (`animation: buzz-animated-count-symbol-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:597— `.buzz-animated-count__symbol[data-direction="down"]` moves (`animation: buzz-animated-count-symbol-down 220ms
cubic-bezier(0.2, 0.8, 0.2, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:875— `.bee-sprite .bee-wing-left` moves (`animation-name: bee-wing-left-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/animations.css:879— `.bee-sprite .bee-wing-right` moves (`animation-name: bee-wing-right-flap`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/avatar-framing.css:115— `.buzz-avatar-framing-slider-handle` moves (`transition: opacity 150ms ease,
transform 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/avatar-framing.css:141— `.buzz-avatar-framing-slider-tip` moves (`transition: opacity 150ms ease,
transform 150ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:195— `.buzz-huddle-speaking-avatar::after` moves (`transition: opacity 80ms linear,
transform 90ms cubic-bezier(0.2, 0, 0, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:530— `.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="forward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-forward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:535— `.buzz-onboarding-transition-line[data-onboarding-effect="line-slide"][data-onboarding-direction="backward"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-line-slide-backward`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:561— `.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-down"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-down`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard desktop/src/shared/styles/globals/components.css:566— `.buzz-onboarding-transition-line[data-onboarding-effect="mask-reveal-up"] > .buzz-onboarding-transition-content` moves (`animation-name: buzz-onboarding-mask-reveal-up`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard admin-web/src/styles.css:279— `.record-card` moves (`transition: transform 180ms ease,
box-shadow 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Duplicated block (14 lines × 2) crates/buzz-acp/src/usage.rs:494— crates/buzz-acp/src/usage.rs:494-507 | crates/buzz-acp/src/usage.rs:797-810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-db/src/store/partition.rs:460— crates/buzz-db/src/store/partition.rs:460-473 | crates/buzz-db/src/store/partition.rs:478-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/api/admin/mod.rs:1247— crates/buzz-relay/src/api/admin/mod.rs:1247-1260 | crates/buzz-relay/src/api/admin/mod.rs:1288-1301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/api/bridge.rs:1374— crates/buzz-relay/src/api/bridge.rs:1374-1388 | crates/buzz-relay/src/api/bridge.rs:2069-2082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/api/bridge.rs:1476— crates/buzz-relay/src/api/bridge.rs:1476-1489 | crates/buzz-relay/src/api/bridge.rs:2168-2181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/api/bridge.rs:1566— crates/buzz-relay/src/api/bridge.rs:1566-1579 | crates/buzz-relay/src/api/bridge.rs:2226-2239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/audio/handler.rs:3617— crates/buzz-relay/src/audio/handler.rs:3617-3630 | crates/buzz-relay/src/audio/handler.rs:3819-3832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/main.rs:2890— crates/buzz-relay/src/main.rs:2890-2903 | crates/buzz-relay/src/main.rs:3003-3016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/subscription.rs:394— crates/buzz-relay/src/subscription.rs:394-407 | crates/buzz-relay/src/subscription.rs:411-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) desktop/src-tauri/src/archive/agent_usage.rs:225— desktop/src-tauri/src/archive/agent_usage.rs:225-238 | desktop/src-tauri/src/archive/agent_usage.rs:247-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) desktop/src-tauri/src/commands/agent_models.rs:743— desktop/src-tauri/src/commands/agent_models.rs:743-756 | desktop/src-tauri/src/commands/agent_models.rs:767-780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) desktop/src-tauri/src/commands/teams/pending.rs:481— desktop/src-tauri/src/commands/teams/pending.rs:481-494 | desktop/src-tauri/src/event_sync.rs:555-568 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) desktop/src-tauri/src/event_sync.rs:133— desktop/src-tauri/src/event_sync.rs:133-147 | desktop/src-tauri/src/event_sync.rs:274-287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) desktop/src-tauri/src/huddle/agent_voice.rs:181— desktop/src-tauri/src/huddle/agent_voice.rs:181-194 | desktop/src-tauri/src/huddle/agent_voice.rs:207-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-db/src/store/channel_members.rs:1294— crates/buzz-db/src/store/channel_members.rs:1294-1307 | crates/buzz-db/src/store/channel_members.rs:1374-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-db/src/store/channel_members.rs:2032— crates/buzz-db/src/store/channel_members.rs:2032-2045 | crates/buzz-db/src/store/event.rs:1697-1712 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) REDACTED:320— REDACTED:320-334 | REDACTED:423-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-db/src/store/event.rs:1669— crates/buzz-db/src/store/event.rs:1669-1682 | crates/buzz-db/src/store/event.rs:1746-1759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/buzz-relay/src/api/operator.rs:928— crates/buzz-relay/src/api/operator.rs:928-941 | crates/buzz-relay/src/api/operator.rs:987-1000 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) mobile/ios/Runner/HuddleAudioEngine.swift:182— mobile/ios/Runner/HuddleAudioEngine.swift:182-195 | mobile/ios/Runner/HuddleAudioEngine.swift:272-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.
Duplicated block (14 lines × 2) mobile/lib/features/settings/theme_picker_page/theme_home_preview.dart:224— mobile/lib/features/settings/theme_picker_page/theme_home_preview.dart:224-238 | mobile/lib/features/settings/theme_picker_page/theme_home_preview.dart:300-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×20
Duplicated block (13 lines × 2) crates/buzz-acp/src/filter.rs:265— crates/buzz-acp/src/filter.rs:265-277 | crates/buzz-workflow/src/executor.rs:233-245 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/buzz-acp/src/lib.rs:5746— crates/buzz-acp/src/lib.rs:5746-5758 | crates/buzz-acp/src/lib.rs:5988-6000 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/buzz-acp/src/relay.rs:1991— crates/buzz-acp/src/relay.rs:1991-2003 | crates/buzz-acp/src/relay.rs:2011-2023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/buzz-acp/src/relay.rs:4096— crates/buzz-acp/src/relay.rs:4096-4108 | crates/buzz-acp/src/relay.rs:4174-4186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/buzz-db/src/store/event.rs:770— crates/buzz-db/src/store/event.rs:770-782 | crates/buzz-db/src/store/event.rs:1233-1245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/buzz-relay/src/api/admin/mod.rs:681— crates/buzz-relay/src/api/admin/mod.rs:681-693 | crates/buzz-relay/src/api/admin/mod.rs:758-770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/buzz-relay/src/audio/handler.rs:2519— crates/buzz-relay/src/audio/handler.rs:2519-2531 | crates/buzz-relay/src/audio/handler.rs:2558-2570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/buzz-relay/src/handlers/count.rs:184— crates/buzz-relay/src/handlers/count.rs:184-196 | crates/buzz-relay/src/handlers/req.rs:197-209 — before extracting anything, compare `crates/buzz-relay/src/handlers/count.rs` and `crates/buzz-relay/src/handlers/req.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) desktop/src-tauri/src/archive/store.rs:342— desktop/src-tauri/src/archive/store.rs:342-354 | desktop/src-tauri/src/archive/store.rs:418-430 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/nostr_convert.rs:536— desktop/src-tauri/src/nostr_convert.rs:536-548 | desktop/src-tauri/src/nostr_convert.rs:552-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.
Duplicated block (13 lines × 2) crates/buzz-db/src/store/channel_members.rs:1377— crates/buzz-db/src/store/channel_members.rs:1377-1393 | crates/buzz-db/src/store/user.rs:432-444 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/buzz-db/src/store/push.rs:1076— crates/buzz-db/src/store/push.rs:1076-1088 | crates/buzz-db/src/store/workflow.rs:800-816 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/buzz-acp/src/lib.rs:2065— crates/buzz-acp/src/lib.rs:2065-2077 | crates/buzz-acp/src/lib.rs:2157-2170 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/commands/media_transcode.rs:377— desktop/src-tauri/src/commands/media_transcode.rs:377-389 | desktop/src-tauri/src/commands/media_transcode.rs:463-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) REDACTED:2823— REDACTED:2823-2835 | REDACTED:2890-2902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/buzz-cli/src/commands/agents.rs:114— crates/buzz-cli/src/commands/agents.rs:114-126 | crates/buzz-cli/src/commands/agents.rs:152-164 — both copies are in the same file, so extract the block into 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) mobile/lib/features/activity/activity_page.dart:279— mobile/lib/features/activity/activity_page.dart:279-291 | mobile/lib/features/activity/activity_page.dart:310-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:122— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:122-134 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:98-110 — before extracting anything, compare `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) mobile/lib/features/forum/forum_thread_page.dart:183— mobile/lib/features/forum/forum_thread_page.dart:183-195 | mobile/lib/features/forum/forum_thread_page.dart:645-657 — both copies are in the same file, so extract the block into 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) mobile/lib/features/profile/profile_edit_page.dart:650— mobile/lib/features/profile/profile_edit_page.dart:650-662 | mobile/lib/shared/widgets/text_editor.dart:95-107 — before extracting anything, compare `mobile/lib/features/profile/profile_edit_page.dart` and `mobile/lib/shared/widgets/text_editor.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/buzz-acp/src/pool.rs:3560— crates/buzz-acp/src/pool.rs:3560-3574 | crates/buzz-acp/src/pool.rs:3589-3603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-cli/src/client.rs:800— crates/buzz-cli/src/client.rs:800-814 | crates/buzz-cli/src/client.rs:830-844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-cli/src/commands/agents.rs:90— crates/buzz-cli/src/commands/agents.rs:90-104 | crates/buzz-cli/src/commands/agents.rs:129-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-core/src/pairing/session.rs:268— crates/buzz-core/src/pairing/session.rs:268-282 | crates/buzz-core/src/pairing/session.rs:472-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) REDACTED:1469— REDACTED:1469-1483 | REDACTED:1754-1768 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) REDACTED:2297— REDACTED:2297-2311 | REDACTED:2316-2330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-db/src/store/feed.rs:93— crates/buzz-db/src/store/feed.rs:93-107 | crates/buzz-db/src/store/feed.rs:183-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-relay/src/audio/handler.rs:1327— crates/buzz-relay/src/audio/handler.rs:1327-1341 | crates/buzz-relay/src/audio/handler.rs:1353-1367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-relay/src/push_runtime.rs:470— crates/buzz-relay/src/push_runtime.rs:470-484 | crates/buzz-relay/src/push_runtime.rs:531-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-relay/src/subscription.rs:395— crates/buzz-relay/src/subscription.rs:395-409 | crates/buzz-relay/src/subscription.rs:455-469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-db/src/store/thread.rs:935— crates/buzz-db/src/store/thread.rs:935-949 | crates/buzz-db/src/store/thread.rs:1119-1137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-db/src/store/reaction.rs:189— crates/buzz-db/src/store/reaction.rs:189-203 | crates/buzz-db/src/store/relay_invite.rs:265-282 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) crates/git-sign-nostr/src/lib.rs:802— crates/git-sign-nostr/src/lib.rs:802-818 | crates/git-sign-nostr/src/lib.rs:1591-1605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/buzz-cli/src/commands/channels.rs:696— crates/buzz-cli/src/commands/channels.rs:696-711 | crates/buzz-cli/src/commands/channels.rs:1474-1488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:250— mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:250-264 | mobile/ios/Runner/NativeEmojiPicker.swift:178-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:431— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:431-445 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:394-408 — before extracting anything, compare `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) mobile/lib/features/channels/channel_detail_page/message_list.dart:669— mobile/lib/features/channels/channel_detail_page/message_list.dart:669-683 | mobile/lib/features/channels/thread_detail_page.dart:880-894 — 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 (15 lines × 2) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:918— mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:918-932 | mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:1009-1023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) mobile/lib/shared/widgets/bouncing_dots_indicator.dart:31— mobile/lib/shared/widgets/bouncing_dots_indicator.dart:31-45 | mobile/lib/shared/widgets/buzz_loading_indicator.dart:30-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) crates/buzz-acp/src/config.rs:1436— crates/buzz-acp/src/config.rs:1436-1451 | crates/buzz-acp/src/config.rs:1522-1537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/buzz-core/src/engram.rs:315— crates/buzz-core/src/engram.rs:315-330 | crates/buzz-core/src/private_managed_agent.rs:751-766 — before extracting anything, compare `crates/buzz-core/src/engram.rs` and `crates/buzz-core/src/private_managed_agent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/buzz-relay/src/audio/handler.rs:960— crates/buzz-relay/src/audio/handler.rs:960-975 | crates/buzz-relay/src/audio/handler.rs:1084-1099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/buzz-relay/src/audio/room.rs:782— crates/buzz-relay/src/audio/room.rs:782-797 | crates/buzz-relay/src/audio/room.rs:809-824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/buzz-relay/src/handlers/event.rs:280— crates/buzz-relay/src/handlers/event.rs:280-295 | crates/buzz-relay/src/handlers/event.rs:340-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/buzz-sdk/src/builders.rs:770— crates/buzz-sdk/src/builders.rs:770-785 | desktop/src-tauri/src/events.rs:449-464 — 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 (16 lines × 2) crates/buzz-sdk/src/builders.rs:1729— crates/buzz-sdk/src/builders.rs:1729-1744 | crates/buzz-sdk/src/builders.rs:1808-1823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/buzz-voice/src/pocket_april.rs:538— crates/buzz-voice/src/pocket_april.rs:538-553 | crates/buzz-voice/src/pocket_april.rs:850-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) desktop/src-tauri/src/relay.rs:721— desktop/src-tauri/src/relay.rs:721-736 | desktop/src-tauri/src/relay/submit.rs:39-54 — 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 (16 lines × 2) crates/buzz-db/src/store/event.rs:1555— crates/buzz-db/src/store/event.rs:1555-1570 | crates/buzz-db/src/store/thread.rs:226-244 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) crates/buzz-relay/src/handlers/moderation_commands.rs:223— crates/buzz-relay/src/handlers/moderation_commands.rs:223-239 | crates/buzz-relay/src/handlers/moderation_commands.rs:335-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/buzz-db/src/store/dm.rs:411— crates/buzz-db/src/store/dm.rs:411-426 | crates/buzz-db/src/store/workflow.rs:795-811 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) mobile/ios/Runner/InlinePhotoPicker.swift:92— mobile/ios/Runner/InlinePhotoPicker.swift:92-107 | mobile/ios/Runner/NativeAttachmentPopover.swift:182-197 — before extracting anything, compare `mobile/ios/Runner/InlinePhotoPicker.swift` and `mobile/ios/Runner/NativeAttachmentPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:127— mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:127-142 | mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:225-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) mobile/lib/features/channels/channel_detail_page/message_list.dart:630— mobile/lib/features/channels/channel_detail_page/message_list.dart:630-645 | mobile/lib/features/channels/thread_detail_page.dart:769-784 — 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 (16 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:122— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:122-137 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:122-137 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) mobile/lib/features/channels/compose_bar/suggestions.dart:28— mobile/lib/features/channels/compose_bar/suggestions.dart:28-43 | mobile/lib/features/channels/compose_bar/suggestions.dart:203-218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) mobile/lib/features/profile/profile_edit_page.dart:694— mobile/lib/features/profile/profile_edit_page.dart:694-709 | mobile/lib/shared/widgets/text_editor.dart:142-157 — before extracting anything, compare `mobile/lib/features/profile/profile_edit_page.dart` and `mobile/lib/shared/widgets/text_editor.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
buzz_db::store::partition::audit_table_on (cognitive 94) crates/buzz-db/src/store/partition.rs:622— buzz_db::store::partition::audit_table_on has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (60 pts), loops 9 (17 pts), boolean chains 14, match/switch 1 (3 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::event::build_query_events_sql (cognitive 68) crates/buzz-db/src/store/event.rs:603— buzz_db::store::event::build_query_events_sql has cognitive complexity 68 (threshold 15). Drivers by points: if/else 39 (52 pts), loops 6 (16 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::event::count_events_sql (cognitive 54) crates/buzz-db/src/store/event.rs:1116— buzz_db::store::event::count_events_sql has cognitive complexity 54 (threshold 15). Drivers by points: if/else 30 (40 pts), loops 5 (14 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl (cognitive 43) crates/buzz-db/src/store/replaceable.rs:105— buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 11, match/switch 2 (3 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.
buzz_db::store::partition::maintenance::plan_maintenance (cognitive 32) crates/buzz-db/src/store/partition/maintenance.rs:203— buzz_db::store::partition::maintenance::plan_maintenance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::event::insert_event_with_thread_metadata_tx (cognitive 28) crates/buzz-db/src/store/event.rs:1851— buzz_db::store::event::insert_event_with_thread_metadata_tx has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (28 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_db::store::deletion::validate_manifest_key_chunks (cognitive 27) REDACTED:3537— buzz_db::store::deletion::validate_manifest_key_chunks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::thread::get_channel_window_on (cognitive 26) crates/buzz-db/src/store/thread.rs:570— buzz_db::store::thread::get_channel_window_on has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (6 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::thread::get_thread_replies_on (cognitive 25) crates/buzz-db/src/store/thread.rs:295— buzz_db::store::thread::get_thread_replies_on has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::push::accept_lease_event (cognitive 23) crates/buzz-db/src/store/push.rs:199— buzz_db::store::push::accept_lease_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::channel_members::put_members (cognitive 21) crates/buzz-db/src/store/channel_members.rs:787— buzz_db::store::channel_members::put_members has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::channel::update_channel_on (cognitive 20) crates/buzz-db/src/store/channel.rs:1005— buzz_db::store::channel::update_channel_on has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (18 pts), match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_db::store::relay_admin_actions::finalize_success (cognitive 20) crates/buzz-db/src/store/relay_admin_actions.rs:875— buzz_db::store::relay_admin_actions::finalize_success has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_db::store::channel::group_metadata_tags (cognitive 18) crates/buzz-db/src/store/channel.rs:693— buzz_db::store::channel::group_metadata_tags has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 2 (3 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_db::store::partition::maintenance::apply_change (cognitive 17) crates/buzz-db/src/store/partition/maintenance.rs:549— buzz_db::store::partition::maintenance::apply_change has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
buzz_db::store::push::enqueue_wakes (cognitive 17) crates/buzz-db/src/store/push.rs:632— buzz_db::store::push::enqueue_wakes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
buzz_db::store::partition::maintenance::verify_applied (cognitive 16) crates/buzz-db/src/store/partition/maintenance.rs:956— buzz_db::store::partition::maintenance::verify_applied has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyMethods: Db crates/buzz-db/src/runtime/mod.rs:261— TooManyMethods — 368 methods, declared across 41 files: runtime/mod.rs (33), store/event.rs (26), store/relay_admin_actions.rs (26), store/workflow.rs (26), +37 more file(s). The bar is 30 methods; this is 338 over it, 12.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DeletionStore REDACTED:751— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.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.
TooManyMethods: RelaySessionNotifier mobile/lib/shared/relay/relay_session.dart:81— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.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.
TooManyMethods: RelayClient desktop/src/shared/api/relayClientSession.ts:79— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: ChannelMessagesNotifier mobile/lib/features/channels/channel_messages_provider.dart:31— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AcpClient crates/buzz-acp/src/acp.rs:148— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeAttachmentPopoverViewController mobile/ios/Runner/NativeAttachmentPopover.swift:7— TooManyMethods — 39 methods, declared across 2 files: Runner/NativeAttachmentPopover.swift (37), Runner/NativeAttachmentPopoverMenu.swift (2). The bar is 30 methods; this is 9 over it, 1.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HostedFlow mobile/lib/shared/hosted/hosted_flow.dart:68— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PairingSession crates/buzz-core/src/pairing/session.rs:90— TooManyMethods — 34 methods, declared across 2 files: pairing/session.rs (32), pairing/session_desktop_code.rs (2). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AppState crates/buzz-relay/src/state.rs:1177— 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: HuddleTransport mobile/lib/shared/huddle/huddle_transport.dart:135— 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: MeshMembership crates/buzz-relay-mesh/src/membership.rs:55— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReadStateManager desktop/src/features/channels/readState/readStateManager.ts:271— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PairingNotifier mobile/lib/features/pairing/pairing_provider.dart:48— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChannelsNotifier mobile/lib/features/channels/channels_provider.dart:38— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReadStateManager mobile/lib/shared/read_state/read_state_manager.dart:44— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MediaUploadService mobile/lib/shared/relay/media_upload.dart:238— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
No assertions: capture: add-community choices desktop/tests/e2e/add-community-screenshots.spec.ts:176— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: capture: join an existing community desktop/tests/e2e/add-community-screenshots.spec.ts:183— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: capture: create a new community desktop/tests/e2e/add-community-screenshots.spec.ts:195— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: capture: add-channel default state desktop/tests/e2e/channel-add-screenshots.spec.ts:12— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: capture: create row on partial match desktop/tests/e2e/channel-add-screenshots.spec.ts:20— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: capture: create row on no match desktop/tests/e2e/channel-add-screenshots.spec.ts:29— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: capture: prefilled create form desktop/tests/e2e/channel-add-screenshots.spec.ts:38— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: switches the active community on click desktop/tests/e2e/community-rail.spec.ts:461— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: picker survives cancel, same-file retry, and multiple selection desktop/tests/e2e/file-attachment.spec.ts:91— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: owner can add multiple admins directly by npub from live Invites UI desktop/tests/e2e/invites-settings-screenshots.spec.ts:185— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: stalled early AUTH signing times out and starts a replacement dial desktop/tests/e2e/relay-reconnect.spec.ts:168— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: settle releases every operation waiting on a successful reconnect desktop/src/shared/api/relayReconnectWaiters.test.mjs:6— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: closeWebSocket is idempotent when the native socket is gone desktop/src/shared/api/relayWebSocketClose.test.mjs:17— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: reveal resolves without the timer when the invoke chain settles desktop/src/features/notifications/lib/desktopActivations.test.mjs:80— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: draining is a no-op when nothing is pending desktop/src/features/messages/lib/mentionPasteBinding.test.mjs:442— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: ${row.name}: ${row.desc} desktop/src/features/admin-console/adminConsolePanel.test.mjs:1071— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
TodoComment web/src/features/repos/use-repo-refs.ts:52— // TODO: Filter by `authors: [relayPubkey]` once the relay's own pubkey is — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment desktop/src-tauri/src/managed_agents/restore.rs:127— // TODO: the three sweeps above each walk the PID table independently. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment desktop/src-tauri/src/managed_agents/config_bridge/goose.rs:17— // TODO: replace hardcoded field extraction with schema_walker once goose publishes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment desktop/src-tauri/src/commands/global_agent_config.rs:308— // TODO: busy/mid-turn deferral would slot in here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment desktop/src-tauri/src/commands/media.rs:386— // TODO(v2): Stream large video files to the relay instead of buffering in RAM. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment desktop/src/features/projects/projectEnumeration.ts:91— // TODO: add a telemetry event here so pathological relay states are — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/buzz-workflow/src/executor.rs:657— // TODO (WF-07): emit DM event.
TodoComment crates/buzz-workflow/src/executor.rs:663— // TODO (WF-07): update channel topic via DB.
TodoComment crates/buzz-workflow/src/executor.rs:738— // TODO (WF-08): create approval record in DB, emit kind:46010.
TodoComment crates/buzz-test-client/tests/conformance_multitenant.rs:1865— /// the executor's approval gate is an explicit TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/buzz-test-client/tests/conformance_multitenant.rs:1933— /// the executor approval gate is an explicit TODO (WF-08), and
TodoComment crates/buzz-relay/src/main.rs:2140— // TODO(coverage): `serve`'s shutdown wiring has no automated test. The — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:315— // TODO(v2): Add persistent per-pubkey storage quotas. Admission limits below — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/buzz-dev-mcp/src/lib.rs:113— /// todo list survives history truncation. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/buzz-cli/src/commands/users.rs:8— // TODO(phase-4): Replace raw nostr::EventBuilder usage in cmd_set_presence with buzz-sdk builder — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/buzz-cli/src/commands/workflows.rs:10— // TODO(phase-4): Replace raw nostr::EventBuilder usage with buzz-sdk builder functions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
buzz_agent::llm::openrouter_post (cognitive 86) crates/buzz-agent/src/llm.rs:2265— buzz_agent::llm::openrouter_post has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (66 pts), match/switch 4 (11 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_agent::llm::post (cognitive 58) crates/buzz-agent/src/llm.rs:1869— buzz_agent::llm::post has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 3 (7 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::model_capabilities::resolve (cognitive 58) crates/buzz-agent/src/model_capabilities.rs:345— buzz_agent::model_capabilities::resolve has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (36 pts), match/switch 2 (8 pts), boolean chains 7, loops 3 (7 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::databricks_label_grammar::generate_databricks_label (cognitive 42) crates/buzz-agent/src/databricks_label_grammar.rs:28— buzz_agent::databricks_label_grammar::generate_databricks_label has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (23 pts), match/switch 5 (9 pts), boolean chains 8, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::llm::parse_responses (cognitive 38) crates/buzz-agent/src/llm.rs:1018— buzz_agent::llm::parse_responses has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 3 (7 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::catalog::fetch_catalog_page (cognitive 32) crates/buzz-agent/src/catalog.rs:514— buzz_agent::catalog::fetch_catalog_page has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::llm::apply_anthropic_cache_control (cognitive 31) crates/buzz-agent/src/llm.rs:2550— buzz_agent::llm::apply_anthropic_cache_control has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_agent::llm::anthropic_body (cognitive 30) crates/buzz-agent/src/llm.rs:573— buzz_agent::llm::anthropic_body has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::model_capabilities::validate_manifest (cognitive 28) crates/buzz-agent/src/model_capabilities.rs:537— buzz_agent::model_capabilities::validate_manifest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 5 (6 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.
buzz_agent::llm::parse_anthropic (cognitive 21) crates/buzz-agent/src/llm.rs:1375— buzz_agent::llm::parse_anthropic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::config::pricing_authority (cognitive 18) crates/buzz-agent/src/config.rs:1012— buzz_agent::config::pricing_authority has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::llm::responses_body (cognitive 17) crates/buzz-agent/src/llm.rs:869— buzz_agent::llm::responses_body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::session_new (cognitive 16) crates/buzz-agent/src/lib.rs:432— buzz_agent::session_new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 6 (7 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.
buzz_agent::llm::openai_body (cognitive 16) crates/buzz-agent/src/llm.rs:734— buzz_agent::llm::openai_body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_agent::llm::parse_openai (cognitive 16) crates/buzz-agent/src/llm.rs:1463— buzz_agent::llm::parse_openai has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 1 (3 pts), match/switch 1 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buzz_agent::wire::read_bounded_line (cognitive 16) crates/buzz-agent/src/wire.rs:387— buzz_agent::wire::read_bounded_line has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Off the main sequence: buzz-audio-client — buzz-audio-client: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: buzz-core — buzz-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
Off the main sequence: buzz-persona — buzz-persona: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: buzz-voice — buzz-voice: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: buzz-ws-client — buzz-ws-client: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: git-credential-nostr — git-credential-nostr: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: git-sign-nostr — git-sign-nostr: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: buzz-agent — buzz-agent: 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.
Off the main sequence: buzz-conformance — buzz-conformance: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: buzz-terminal — buzz-terminal: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: buzz-relay-mesh — buzz-relay-mesh: abstractness 0.14, instability 0.00, distance 0.86 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: buzz-sdk — buzz-sdk: abstractness 0.05, instability 0.20, distance 0.75 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: buzz-media — buzz-media: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: buzz-db — buzz-db: abstractness 0.00, instability 0.29, distance 0.71 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
buzz_acp::run_harness (cyclomatic 171) crates/buzz-acp/src/lib.rs:2838— buzz_acp::run_harness has cyclomatic complexity 171 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_acp::pool::run_prompt_task (cyclomatic 74) crates/buzz-acp/src/pool.rs:2415— buzz_acp::pool::run_prompt_task has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_acp::relay::run_background_task (cyclomatic 64) crates/buzz-acp/src/relay.rs:1748— buzz_acp::relay::run_background_task has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_acp::relay::handle_ws_message (cyclomatic 51) crates/buzz-acp/src/relay.rs:2185— buzz_acp::relay::handle_ws_message has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_acp::handle_prompt_result (cyclomatic 46) crates/buzz-acp/src/lib.rs:5231— buzz_acp::handle_prompt_result has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_acp::queue::format_context_hints (cyclomatic 27) crates/buzz-acp/src/queue.rs:1951— buzz_acp::queue::format_context_hints 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.
buzz_acp::relay::execute_connected_command (cyclomatic 24) crates/buzz-acp/src/relay.rs:1560— buzz_acp::relay::execute_connected_command 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.
buzz_acp::relay::resubscribe_after_reconnect (cyclomatic 22) crates/buzz-acp/src/relay.rs:2681— buzz_acp::relay::resubscribe_after_reconnect 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.
buzz_acp::run_task::run (cyclomatic 18) crates/buzz-acp/src/run_task.rs:116— buzz_acp::run_task::run has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_acp::isolated_execution::execute (cyclomatic 17) crates/buzz-acp/src/isolated_execution.rs:13— buzz_acp::isolated_execution::execute has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_acp::pool::parse_nostr_thread_response_with_meta (cyclomatic 16) crates/buzz-acp/src/pool.rs:4748— buzz_acp::pool::parse_nostr_thread_response_with_meta 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.
buzz_acp::relay::drain_commands (cyclomatic 16) crates/buzz-acp/src/relay.rs:2985— buzz_acp::relay::drain_commands 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.
buzz_acp::relay::wait_for_reconnect (cyclomatic 16) crates/buzz-acp/src/relay.rs:3215— buzz_acp::relay::wait_for_reconnect has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×13
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-acp/src/relay.rs:1758— crates/buzz-acp/src/relay.rs:1758-2178 | crates/buzz-acp/src/relay.rs:2195-2576 | crates/buzz-acp/src/relay.rs:2687-2797 | crates/buzz-acp/src/relay/recovery.rs:21-60 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-cli/src/client.rs:789— crates/buzz-cli/src/client.rs:789-814 | crates/buzz-cli/src/client.rs:819-844 | crates/buzz-cli/src/client.rs:877-907 | crates/buzz-cli/src/client.rs:1131-1173 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-cli/src/commands/notes.rs:168— crates/buzz-cli/src/commands/notes.rs:168-182 | crates/buzz-cli/src/commands/notes.rs:352-363 | crates/buzz-cli/src/commands/projects.rs:256-274 | crates/buzz-cli/src/commands/repos.rs:20-31 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-db/src/store/api_token.rs:164— crates/buzz-db/src/store/api_token.rs:164-215 | crates/buzz-db/src/store/api_token.rs:228-282 | crates/buzz-db/src/store/api_token.rs:397-430 | crates/buzz-db/src/store/api_token.rs:560-591 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-db/src/store/relay_admin_actions.rs:469— crates/buzz-db/src/store/relay_admin_actions.rs:469-551 | crates/buzz-db/src/store/relay_admin_actions.rs:565-642 | crates/buzz-db/src/store/relay_admin_actions.rs:670-756 | crates/buzz-db/src/store/relay_admin_actions.rs:771-840 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-relay/src/handlers/identity_archive.rs:141— crates/buzz-relay/src/handlers/identity_archive.rs:141-154 | crates/buzz-relay/src/handlers/ingest.rs:2539-3779 | crates/buzz-relay/src/handlers/moderation_commands.rs:131-157 | crates/buzz-relay/src/handlers/relay_admin.rs:229-514 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) desktop/src-tauri/src/commands/agents_pending.rs:92— desktop/src-tauri/src/commands/agents_pending.rs:92-170 | desktop/src-tauri/src/commands/personas/pending.rs:242-300 | desktop/src-tauri/src/commands/teams/mod.rs:341-401 | desktop/src-tauri/src/managed_agents/team_catalog.rs:809-862 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:114— desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:114-178 | desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:232-298 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:128-182 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:284-331 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:301— desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:301-356 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:185-235 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:337-379 | desktop/src-tauri/src/managed_agents/runtime/sweep.rs:388-434 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) desktop/src-tauri/src/migration.rs:1209— desktop/src-tauri/src/migration.rs:1209-1233 | desktop/src-tauri/src/migration.rs:1239-1255 | desktop/src-tauri/src/migration.rs:1338-1363 | desktop/src-tauri/src/migration/materialize.rs:24-40 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:28— mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:28-89 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:28-93 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:31-96 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:28-89 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) mobile/lib/features/channels/me/new_me_chat.dart:5— mobile/lib/features/channels/me/new_me_chat.dart:5-193 | mobile/lib/features/profile/profile_edit_page.dart:648-718 | mobile/lib/features/profile/profile_text_edit_sheet.dart:39-164 | mobile/lib/shared/widgets/text_editor.dart:93-166 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) mobile/lib/shared/community/community_provider.dart:419— mobile/lib/shared/community/community_provider.dart:419-444 | mobile/lib/shared/community/community_provider.dart:509-546 | mobile/lib/shared/community/community_provider.dart:577-620 | mobile/lib/shared/community/community_provider.dart:622-637 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (20 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:1526— crates/buzz-db/src/store/relay_admin_actions.rs:1526-1545 | crates/buzz-db/src/store/relay_admin_actions.rs:1613-1632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/buzz-relay/src/api/bridge.rs:2307— crates/buzz-relay/src/api/bridge.rs:2307-2326 | crates/buzz-relay/src/api/bridge.rs:2380-2399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:1103— crates/buzz-relay/src/handlers/command_executor.rs:1103-1122 | crates/buzz-relay/src/handlers/command_executor.rs:1214-1233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) desktop/src-tauri/src/commands/media_animated.rs:65— desktop/src-tauri/src/commands/media_animated.rs:65-84 | desktop/src-tauri/src/commands/media_animated.rs:165-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/buzz-db/src/store/api_token.rs:103— crates/buzz-db/src/store/api_token.rs:103-127 | crates/buzz-db/src/store/api_token.rs:295-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/buzz-db/src/store/reaction.rs:253— crates/buzz-db/src/store/reaction.rs:253-274 | crates/buzz-db/src/store/reminder.rs:167-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20 lines × 2) crates/buzz-db/src/store/channel.rs:177— crates/buzz-db/src/store/channel.rs:177-197 | crates/buzz-db/src/store/dm.rs:208-227 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20 lines × 2) REDACTED:3797— REDACTED:3797-3816 | REDACTED:3825-3844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) mobile/lib/features/channels/channels_page/sheets.dart:69— mobile/lib/features/channels/channels_page/sheets.dart:69-88 | mobile/lib/features/channels/channels_page/sheets.dart:518-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) mobile/lib/features/pairing/pairing_socket.dart:175— mobile/lib/features/pairing/pairing_socket.dart:175-194 | mobile/lib/shared/relay/relay_socket.dart:181-200 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20 lines × 2) mobile/lib/features/profile/profile_edit_page.dart:676— mobile/lib/features/profile/profile_edit_page.dart:676-695 | mobile/lib/features/profile/profile_text_edit_sheet.dart:115-134 — before extracting anything, compare `mobile/lib/features/profile/profile_edit_page.dart` and `mobile/lib/features/profile/profile_text_edit_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:41— mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:41-60 | mobile/lib/shared/widgets/frosted_scaffold.dart:116-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) crates/buzz-acp/src/lib.rs:6211— crates/buzz-acp/src/lib.rs:6211-6227 | crates/buzz-acp/src/lib.rs:6259-6275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/buzz-cli/src/commands/issues.rs:504— crates/buzz-cli/src/commands/issues.rs:504-520 | crates/buzz-cli/src/commands/pr.rs:140-156 — before extracting anything, compare `crates/buzz-cli/src/commands/issues.rs` and `crates/buzz-cli/src/commands/pr.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:175— crates/buzz-db/src/store/relay_admin_actions.rs:175-191 | crates/buzz-db/src/store/relay_admin_actions.rs:316-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) desktop/src-tauri/src/commands/project_git_diff.rs:70— desktop/src-tauri/src/commands/project_git_diff.rs:70-86 | desktop/src-tauri/src/commands/project_git_diff.rs:87-103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) desktop/src-tauri/src/huddle/tts.rs:753— desktop/src-tauri/src/huddle/tts.rs:753-769 | desktop/src-tauri/src/huddle/tts.rs:833-849 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) desktop/src-tauri/src/managed_agents/backend.rs:112— desktop/src-tauri/src/managed_agents/backend.rs:112-128 | desktop/src-tauri/src/managed_agents/backend.rs:136-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/buzz-db/src/store/reaction.rs:373— crates/buzz-db/src/store/reaction.rs:373-394 | crates/buzz-db/src/store/reminder.rs:127-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) crates/buzz-db/src/store/community.rs:119— crates/buzz-db/src/store/community.rs:119-137 | crates/buzz-db/src/store/community.rs:847-863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/buzz-db/src/store/moderation.rs:323— crates/buzz-db/src/store/moderation.rs:323-339 | crates/buzz-db/src/store/relay_admin_actions.rs:146-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) REDACTED:2554— REDACTED:2554-2570 | REDACTED:2604-2620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:161— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:161-177 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:161-177 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 2) mobile/lib/features/profile/image_avatar_capture.dart:504— mobile/lib/features/profile/image_avatar_capture.dart:504-520 | mobile/lib/features/profile/image_avatar_capture.dart:579-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
buzz_db::store::partition::audit_table_on (cyclomatic 45) crates/buzz-db/src/store/partition.rs:622— buzz_db::store::partition::audit_table_on has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_db::store::event::build_query_events_sql (cyclomatic 37) crates/buzz-db/src/store/event.rs:603— buzz_db::store::event::build_query_events_sql has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl (cyclomatic 33) crates/buzz-db/src/store/replaceable.rs:105— buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl 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.
buzz_db::store::event::count_events_sql (cyclomatic 31) crates/buzz-db/src/store/event.rs:1116— buzz_db::store::event::count_events_sql has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_db::store::partition::maintenance::apply_change (cyclomatic 21) crates/buzz-db/src/store/partition/maintenance.rs:549— buzz_db::store::partition::maintenance::apply_change 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.
buzz_db::store::partition::maintenance::plan_maintenance (cyclomatic 20) crates/buzz-db/src/store/partition/maintenance.rs:203— buzz_db::store::partition::maintenance::plan_maintenance has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_db::store::channel::update_channel_on (cyclomatic 19) crates/buzz-db/src/store/channel.rs:1005— buzz_db::store::channel::update_channel_on 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.
buzz_db::store::channel::group_metadata_tags (cyclomatic 17) crates/buzz-db/src/store/channel.rs:693— buzz_db::store::channel::group_metadata_tags has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_db::store::push::accept_lease_event (cyclomatic 17) crates/buzz-db/src/store/push.rs:199— buzz_db::store::push::accept_lease_event 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.
buzz_db::store::relay_admin_actions::finalize_success (cyclomatic 16) crates/buzz-db/src/store/relay_admin_actions.rs:875— buzz_db::store::relay_admin_actions::finalize_success 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.
buzz_db::store::thread::get_thread_replies_on (cyclomatic 16) crates/buzz-db/src/store/thread.rs:295— buzz_db::store::thread::get_thread_replies_on has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Duplicated block (6 lines × 3) crates/buzz-cli/src/client.rs:1438— crates/buzz-cli/src/client.rs:1438-1444 | crates/buzz-cli/src/client.rs:1459-1465 | crates/buzz-cli/src/commands/channels.rs:642-647 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) crates/buzz-relay/src/connection.rs:1341— crates/buzz-relay/src/connection.rs:1341-1348 | crates/buzz-relay/src/connection.rs:1376-1381 | crates/buzz-relay/src/connection.rs:1398-1403 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/buzz-relay/src/handlers/command_executor.rs:434— crates/buzz-relay/src/handlers/command_executor.rs:434-439 | crates/buzz-relay/src/handlers/command_executor.rs:571-576 | crates/buzz-relay/src/handlers/command_executor.rs:644-649 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/buzz-relay/src/handlers/identity_archive.rs:142— crates/buzz-relay/src/handlers/identity_archive.rs:142-147 | crates/buzz-relay/src/handlers/ingest.rs:2966-2971 | crates/buzz-relay/src/handlers/relay_admin.rs:237-242 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) crates/buzz-sdk/src/builders.rs:1279— crates/buzz-sdk/src/builders.rs:1279-1284 | crates/buzz-sdk/src/builders.rs:1732-1737 | crates/buzz-sdk/src/builders.rs:1811-1816 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) desktop/src-tauri/src/commands/channel_templates.rs:21— desktop/src-tauri/src/commands/channel_templates.rs:21-26 | desktop/src-tauri/src/commands/personas/mod.rs:22-27 | desktop/src-tauri/src/commands/teams/mod.rs:22-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) desktop/src-tauri/src/media_proxy.rs:276— desktop/src-tauri/src/media_proxy.rs:276-281 | desktop/src-tauri/src/media_proxy.rs:286-297 | desktop/src-tauri/src/media_proxy.rs:302-307 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/buzz-acp/src/lib.rs:2746— crates/buzz-acp/src/lib.rs:2746-2753 | crates/buzz-acp/src/lib.rs:2758-2763 | crates/buzz-acp/src/lib.rs:2768-2773 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) desktop/src-tauri/src/managed_agents/retention.rs:499— desktop/src-tauri/src/managed_agents/retention.rs:499-504 | desktop/src-tauri/src/managed_agents/retention.rs:623-628 | desktop/src-tauri/src/managed_agents/retention/legacy_migration.rs:138-143 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) crates/buzz-acp/src/relay.rs:500— crates/buzz-acp/src/relay.rs:500-505 | crates/buzz-acp/src/relay.rs:513-518 | crates/buzz-acp/src/relay.rs:571-576 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) desktop/src-tauri/src/commands/agent_models.rs:515— desktop/src-tauri/src/commands/agent_models.rs:515-520 | desktop/src-tauri/src/commands/agent_models.rs:622-627 | desktop/src-tauri/src/commands/agent_models_openrouter.rs:67-72 — 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.
Focus outline removed inline desktop/src/features/agents/ui/PersonaModelCombobox.tsx:159— <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 desktop/src/features/communities/ui/CommunitySwitcher.tsx:415— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline desktop/src/features/projects/ui/ProjectsSectionSearch.tsx:104— <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 desktop/src/features/search/ui/SearchScopeControls.tsx:74— <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 desktop/src/features/sidebar/ui/CommunityRail.tsx:123— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline desktop/src/features/sidebar/ui/CommunityRail.tsx:417— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline desktop/src/features/sidebar/ui/SidebarProfileCard.tsx:113— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline desktop/src/features/sidebar/ui/SidebarProfileCard.tsx:191— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline desktop/src/features/sidebar/ui/SidebarProfileCard.tsx:211— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline desktop/src/features/user-status/ui/SetStatusDialog.tsx:407— <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).
buzz_media::auth::verify_blossom_auth_event_for_verb (cognitive 79) crates/buzz-media/src/auth.rs:65— buzz_media::auth::verify_blossom_auth_event_for_verb has cognitive complexity 79 (threshold 15). Drivers by points: if/else 29 (65 pts), match/switch 3 (8 pts), boolean chains 5, loops 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::validation::validate_gif_metadata_free (cognitive 38) crates/buzz-media/src/validation.rs:752— buzz_media::validation::validate_gif_metadata_free has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 5, match/switch 2 (5 pts), loops 2 (nesting depth added 20). Of this number, 35 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::validation::validate_jpeg_metadata_free (cognitive 35) crates/buzz-media/src/validation.rs:520— buzz_media::validation::validate_jpeg_metadata_free has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::validation::validate_video_file (cognitive 32) crates/buzz-media/src/validation.rs:303— buzz_media::validation::validate_video_file has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::validation::validate_mp4_metadata_free::walk (cognitive 24) crates/buzz-media/src/validation.rs:881— buzz_media::validation::validate_mp4_metadata_free::walk has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::validation::check_moov_before_mdat (cognitive 22) crates/buzz-media/src/validation.rs:426— buzz_media::validation::check_moov_before_mdat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::validation::validate_webp_metadata_free (cognitive 22) crates/buzz-media/src/validation.rs:677— buzz_media::validation::validate_webp_metadata_free has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 7). Of this number, 14 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::upload::process_video_upload (cognitive 21) crates/buzz-media/src/upload.rs:292— buzz_media::upload::process_video_upload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::validation::validate_png_metadata_free (cognitive 19) crates/buzz-media/src/validation.rs:610— buzz_media::validation::validate_png_metadata_free has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_media::bucket_index::sweep_bucket_taxonomy (cognitive 16) crates/buzz-media/src/bucket_index.rs:837— buzz_media::bucket_index::sweep_bucket_taxonomy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_dev_mcp::tree::run (cognitive 38) crates/buzz-dev-mcp/src/tree.rs:18— buzz_dev_mcp::tree::run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 4 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_dev_mcp::rg::scan_file (cognitive 34) crates/buzz-dev-mcp/src/rg.rs:263— buzz_dev_mcp::rg::scan_file has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_dev_mcp::rg::walk (cognitive 33) crates/buzz-dev-mcp/src/rg.rs:345— buzz_dev_mcp::rg::walk has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 3 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_dev_mcp::shell::run (cognitive 33) crates/buzz-dev-mcp/src/shell.rs:134— buzz_dev_mcp::shell::run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 10 (15 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_dev_mcp::view_image::gif_has_two_image_descriptors (cognitive 26) crates/buzz-dev-mcp/src/view_image.rs:445— buzz_dev_mcp::view_image::gif_has_two_image_descriptors has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 3 (6 pts), 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.
buzz_dev_mcp::rg::fallback (cognitive 22) crates/buzz-dev-mcp/src/rg.rs:168— buzz_dev_mcp::rg::fallback has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_dev_mcp::view_image::fetch_url (cognitive 20) crates/buzz-dev-mcp/src/view_image.rs:321— buzz_dev_mcp::view_image::fetch_url has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_dev_mcp::paths::msys_to_windows (cognitive 18) crates/buzz-dev-mcp/src/paths.rs:157— buzz_dev_mcp::paths::msys_to_windows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_dev_mcp::shell::resolve_bash (cognitive 17) crates/buzz-dev-mcp/src/shell.rs:406— buzz_dev_mcp::shell::resolve_bash has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 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.
buzz_dev_mcp::shell::read_capped (cognitive 16) crates/buzz-dev-mcp/src/shell.rs:863— buzz_dev_mcp::shell::read_capped has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFields: Config crates/buzz-relay/src/config.rs:118— TooManyFields — 67 stored fields beside 1 method. The bar is 30 stored fields; this is 37 over it, 2.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ManagedAgentRecord desktop/src-tauri/src/managed_agents/types.rs:247— TooManyFields — 58 stored fields beside 1 method. The bar is 30 stored fields; this is 28 over it, 1.93× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AppState crates/buzz-relay/src/state.rs:1177— TooManyFields — 57 stored fields beside 34 methods. The bar is 30 stored fields; this is 27 over it, 1.90× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CliArgs crates/buzz-acp/src/config.rs:250— TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Config crates/buzz-acp/src/config.rs:547— TooManyFields — 45 stored fields beside 3 methods. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ManagedAgentSummary desktop/src-tauri/src/managed_agents/types.rs:535— TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Config crates/buzz-agent/src/config.rs:544— TooManyFields — 34 stored fields beside 3 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: KnownAcpRuntime desktop/src-tauri/src/managed_agents/discovery/runtime_metadata.rs:68— TooManyFields — 33 stored fields beside 1 method. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: DeletionRequest REDACTED:269— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AppState desktop/src-tauri/src/app_state.rs:19— TooManyFields — 32 stored fields beside 14 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×10
Duplicated block (5 lines × 3) crates/buzz-cli/src/commands/mem.rs:363— crates/buzz-cli/src/commands/mem.rs:363-367 | crates/buzz-cli/src/commands/mem.rs:689-693 | crates/buzz-cli/src/commands/mem.rs:726-730 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/buzz-sdk/src/builders.rs:1287— crates/buzz-sdk/src/builders.rs:1287-1291 | crates/buzz-sdk/src/builders.rs:1740-1744 | crates/buzz-sdk/src/builders.rs:1819-1823 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/buzz-ws-client/src/message.rs:88— crates/buzz-ws-client/src/message.rs:88-92 | crates/buzz-ws-client/src/message.rs:116-122 | crates/buzz-ws-client/src/message.rs:148-154 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) desktop/src-tauri/src/commands/admin/mod.rs:553— desktop/src-tauri/src/commands/admin/mod.rs:553-557 | desktop/src-tauri/src/commands/admin/mod.rs:580-584 | desktop/src-tauri/src/commands/admin/mod.rs:607-611 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) desktop/src-tauri/src/commands/project_git_recipient_notes.rs:230— desktop/src-tauri/src/commands/project_git_recipient_notes.rs:230-234 | desktop/src-tauri/src/commands/project_git_recipient_notes.rs:272-276 | desktop/src-tauri/src/commands/project_git_workflow.rs:449-453 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) desktop/src-tauri/src/persona_catalog.rs:204— desktop/src-tauri/src/persona_catalog.rs:204-208 | desktop/src-tauri/src/persona_catalog.rs:217-221 | desktop/src-tauri/src/team_catalog.rs:322-326 — before extracting anything, compare `desktop/src-tauri/src/persona_catalog.rs` and `desktop/src-tauri/src/team_catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) crates/buzz-cli/src/commands/project_channel.rs:60— crates/buzz-cli/src/commands/project_channel.rs:60-64 | crates/buzz-cli/src/commands/project_channel.rs:154-161 | crates/buzz-cli/src/commands/projects.rs:153-160 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/buzz-relay/src/main.rs:2906— crates/buzz-relay/src/main.rs:2906-2910 | crates/buzz-relay/src/main.rs:3019-3023 | crates/buzz-relay/src/main.rs:3093-3099 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) desktop/src-tauri/src/archive/store_migrations.rs:65— desktop/src-tauri/src/archive/store_migrations.rs:65-69 | desktop/src-tauri/src/archive/store_migrations.rs:213-217 | desktop/src-tauri/src/archive/store_migrations.rs:286-290 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/buzz-acp/src/pool.rs:2004— crates/buzz-acp/src/pool.rs:2004-2008 | crates/buzz-acp/src/pool.rs:2092-2096 | crates/buzz-acp/src/pool.rs:2197-2201 — 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.
X2 · Cancellation propagation· Async function without AbortSignal · ×10
Async function without AbortSignal: resolveBuzzDownloadUrlForPlatform web/src/shared/lib/buzz-download.ts:160— `resolveBuzzDownloadUrlForPlatform` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: ensureClone web/src/features/repos/git-client.ts:68— `ensureClone` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: acceptPolicy web/src/features/invite/ui/InvitePage.tsx:92— `acceptPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: getJoinPolicy desktop/src/shared/api/invites.ts:131— `getJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: acceptJoinPolicy desktop/src/shared/api/invites.ts:170— `acceptJoinPolicy` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: moderationGet desktop/src/shared/api/moderation.ts:237— `moderationGet` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: tick desktop/src/features/sidebar/lib/useStaleReaderRecovery.ts:89— `tick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchAvatarDataUrl desktop/src/features/profile/lib/selfProfileStorage.ts:378— `fetchAvatarDataUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: doRequest admin-web/src/api.ts:94— `doRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: probeAuthMode admin-web/src/api.ts:157— `probeAuthMode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Swallowed exception (empty catch) web/src/shared/lib/buzz-download.ts:119— 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) web/src/shared/lib/buzz-download.ts:181— 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) web/src/shared/lib/buzz-download.ts:204— 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) web/src/shared/lib/nostr-client.ts:62— 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) web/src/features/repos/git-client.ts:82— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) web/src/features/repos/git-client.ts:98— 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) web/src/features/repos/git-client.ts:388— 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) mobile/lib/shared/relay/nostr_models.dart:261— 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) mobile/lib/shared/relay/nostr_models.dart:396— 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) mobile/lib/shared/relay/nostr_models.dart:403— 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.
buzz_agent::llm::openrouter_post (cyclomatic 36) crates/buzz-agent/src/llm.rs:2265— buzz_agent::llm::openrouter_post has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_agent::databricks_label_grammar::generate_databricks_label (cyclomatic 34) crates/buzz-agent/src/databricks_label_grammar.rs:28— buzz_agent::databricks_label_grammar::generate_databricks_label has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_agent::llm::post (cyclomatic 28) crates/buzz-agent/src/llm.rs:1869— buzz_agent::llm::post has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_agent::model_capabilities::resolve (cyclomatic 28) crates/buzz-agent/src/model_capabilities.rs:345— buzz_agent::model_capabilities::resolve has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_agent::catalog::fetch_catalog_page (cyclomatic 23) crates/buzz-agent/src/catalog.rs:514— buzz_agent::catalog::fetch_catalog_page has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_agent::model_capabilities::validate_manifest (cyclomatic 19) crates/buzz-agent/src/model_capabilities.rs:537— buzz_agent::model_capabilities::validate_manifest 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.
buzz_agent::llm::parse_responses (cyclomatic 18) crates/buzz-agent/src/llm.rs:1018— buzz_agent::llm::parse_responses 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.
buzz_agent::llm::anthropic_body (cyclomatic 17) crates/buzz-agent/src/llm.rs:573— buzz_agent::llm::anthropic_body 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.
buzz_agent::session_new (cyclomatic 16) crates/buzz-agent/src/lib.rs:432— buzz_agent::session_new has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_sdk::mentions::strip_code_regions (cognitive 70) crates/buzz-sdk/src/mentions.rs:244— buzz_sdk::mentions::strip_code_regions has cognitive complexity 70 (threshold 15). Drivers by points: if/else 14 (52 pts), loops 4 (15 pts), boolean chains 3 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_sdk::builders::build_repo_announcement (cognitive 30) crates/buzz-sdk/src/builders.rs:1089— buzz_sdk::builders::build_repo_announcement has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_sdk::mentions::extract_at_names (cognitive 30) crates/buzz-sdk/src/mentions.rs:64— buzz_sdk::mentions::extract_at_names has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_sdk::builders::build_update_channel (cognitive 18) crates/buzz-sdk/src/builders.rs:833— buzz_sdk::builders::build_update_channel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buzz_sdk::builders::validate_project_envelope (cognitive 18) crates/buzz-sdk/src/builders.rs:2341— buzz_sdk::builders::validate_project_envelope has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_sdk::mentions::extract_at_mentions_with_known (cognitive 18) crates/buzz-sdk/src/mentions.rs:107— buzz_sdk::mentions::extract_at_mentions_with_known has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_sdk::builders::build_diff_message (cognitive 17) crates/buzz-sdk/src/builders.rs:357— buzz_sdk::builders::build_diff_message has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_sdk::builders::build_contact_list (cognitive 17) crates/buzz-sdk/src/builders.rs:1019— buzz_sdk::builders::build_contact_list has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_sdk::builders::build_git_status (cognitive 16) crates/buzz-sdk/src/builders.rs:1602— buzz_sdk::builders::build_git_status has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, loops 4 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_core::filter::filter_match_one (cognitive 39) crates/buzz-core/src/filter.rs:92— buzz_core::filter::filter_match_one has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 3, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_core::artifact::validate (cognitive 34) crates/buzz-core/src/artifact.rs:80— buzz_core::artifact::validate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_core::network::is_not_global_unicast (cognitive 31) crates/buzz-core/src/network.rs:50— buzz_core::network::is_not_global_unicast has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 19, if/else 6 (11 pts), match/switch 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
buzz_core::artifact::parse_query (cognitive 25) crates/buzz-core/src/artifact.rs:327— buzz_core::artifact::parse_query has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_core::engram::extract_refs (cognitive 25) crates/buzz-core/src/engram.rs:384— buzz_core::engram::extract_refs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (17 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_core::pairing::qr::decode_qr (cognitive 20) crates/buzz-core/src/pairing/qr.rs:104— buzz_core::pairing::qr::decode_qr has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3 (6 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
buzz_core::git_perms::parse_protection_tag_with_warnings (cognitive 19) crates/buzz-core/src/git_perms.rs:327— buzz_core::git_perms::parse_protection_tag_with_warnings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_core::channel::decide_member_put (cognitive 17) crates/buzz-core/src/channel.rs:312— buzz_core::channel::decide_member_put has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
buzz_core::private_managed_agent::validate_envelope (cognitive 16) crates/buzz-core/src/private_managed_agent.rs:262— buzz_core::private_managed_agent::validate_envelope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
buzz_cli::commands::pack::cmd_inspect (cognitive 28) crates/buzz-cli/src/commands/pack.rs:52— buzz_cli::commands::pack::cmd_inspect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (27 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.
buzz_cli::commands::mem::cmd_ls (cognitive 19) crates/buzz-cli/src/commands/mem.rs:189— buzz_cli::commands::mem::cmd_ls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), match/switch 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.
buzz_cli::commands::messages::cmd_send_message (cognitive 19) crates/buzz-cli/src/commands/messages.rs:578— buzz_cli::commands::messages::cmd_send_message has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
buzz_cli::commands::projects::cmd_update (cognitive 19) crates/buzz-cli/src/commands/projects.rs:588— buzz_cli::commands::projects::cmd_update has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_cli::commands::mem::cmd_patch (cognitive 18) crates/buzz-cli/src/commands/mem.rs:538— buzz_cli::commands::mem::cmd_patch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, match/switch 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.
buzz_cli::commands::users::search_by_name (cognitive 18) crates/buzz-cli/src/commands/users.rs:289— buzz_cli::commands::users::search_by_name has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 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.
buzz_cli::commands::issues::reduce_assignment_operations (cognitive 17) crates/buzz-cli/src/commands/issues.rs:143— buzz_cli::commands::issues::reduce_assignment_operations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_cli::commands::notes::cmd_get (cognitive 17) crates/buzz-cli/src/commands/notes.rs:612— buzz_cli::commands::notes::cmd_get has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_cli::commands::projects::cmd_create (cognitive 16) crates/buzz-cli/src/commands/projects.rs:360— buzz_cli::commands::projects::cmd_create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Duplicated block (19 lines × 2) crates/buzz-acp/src/lib.rs:5504— crates/buzz-acp/src/lib.rs:5504-5522 | crates/buzz-acp/src/lib.rs:5544-5562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/buzz-admin/src/communities.rs:268— crates/buzz-admin/src/communities.rs:268-286 | crates/buzz-relay/src/handlers/community_provisioning.rs:181-199 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) crates/buzz-relay/src/conformance/mod.rs:277— crates/buzz-relay/src/conformance/mod.rs:277-295 | crates/buzz-relay/src/conformance/mod.rs:312-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:450— crates/buzz-relay/src/handlers/command_executor.rs:450-468 | crates/buzz-relay/src/handlers/command_executor.rs:580-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:1375— crates/buzz-relay/src/handlers/ingest.rs:1375-1393 | crates/buzz-relay/src/handlers/side_effects.rs:3069-3087 — before extracting anything, compare `crates/buzz-relay/src/handlers/ingest.rs` and `crates/buzz-relay/src/handlers/side_effects.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:137— crates/buzz-relay/src/handlers/side_effects.rs:137-155 | crates/buzz-relay/src/handlers/side_effects.rs:208-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) desktop/src-tauri/src/commands/project_git.rs:274— desktop/src-tauri/src/commands/project_git.rs:274-292 | desktop/src-tauri/src/commands/project_git.rs:344-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) desktop/src-tauri/src/migration.rs:900— desktop/src-tauri/src/migration.rs:900-918 | desktop/src-tauri/src/migration.rs:966-984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) mobile/lib/features/profile/avatar_editor_option_button.dart:81— mobile/lib/features/profile/avatar_editor_option_button.dart:81-99 | mobile/lib/shared/widgets/editor_option_button.dart:63-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 3) crates/buzz-cli/src/client.rs:794— crates/buzz-cli/src/client.rs:794-801 | crates/buzz-cli/src/client.rs:824-831 | crates/buzz-cli/src/client.rs:882-889 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/buzz-cli/src/commands/issues.rs:515— crates/buzz-cli/src/commands/issues.rs:515-522 | crates/buzz-cli/src/commands/patches.rs:106-113 | crates/buzz-cli/src/commands/pr.rs:151-158 — before extracting anything, compare `crates/buzz-cli/src/commands/issues.rs` and `crates/buzz-cli/src/commands/patches.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/buzz-relay/src/audio/handler.rs:960— crates/buzz-relay/src/audio/handler.rs:960-967 | crates/buzz-relay/src/audio/handler.rs:1084-1091 | crates/buzz-relay/src/audio/handler.rs:1391-1400 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/buzz-relay/src/audio/handler.rs:3620— crates/buzz-relay/src/audio/handler.rs:3620-3628 | crates/buzz-relay/src/audio/handler.rs:3822-3830 | crates/buzz-relay/src/handlers/event.rs:1151-1158 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) desktop/src-tauri/src/managed_agents/nest.rs:236— desktop/src-tauri/src/managed_agents/nest.rs:236-243 | desktop/src-tauri/src/managed_agents/nest.rs:249-256 | desktop/src-tauri/src/managed_agents/nest.rs:276-283 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/buzz-backend-kubernetes/src/env.rs:66— crates/buzz-backend-kubernetes/src/env.rs:66-73 | desktop/src-tauri/crates/buzz-terminal/src/context.rs:74-81 | desktop/src-tauri/src/managed_agents/env_vars.rs:58-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) desktop/src-tauri/src/commands/link_preview_cancellation.rs:14— desktop/src-tauri/src/commands/link_preview_cancellation.rs:14-22 | desktop/src-tauri/src/commands/media_fetch_cancellation.rs:21-28 | desktop/src-tauri/src/commands/media_upload_progress.rs:17-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) desktop/src-tauri/src/commands/link_preview_cancellation.rs:53— desktop/src-tauri/src/commands/link_preview_cancellation.rs:53-60 | desktop/src-tauri/src/commands/media_fetch_cancellation.rs:53-60 | desktop/src-tauri/src/commands/media_upload_progress.rs:53-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/buzz-acp/src/lib.rs:6220— crates/buzz-acp/src/lib.rs:6220-6227 | crates/buzz-acp/src/lib.rs:6268-6275 | crates/buzz-acp/src/lib.rs:6343-6350 — 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.
Change-coupling hub: AppSidebar.tsx → ChatHeader.tsx, ProfilePopover.tsx, TopbarSearch.tsx, ViewLoadingFallback.tsx desktop/src/features/sidebar/ui/AppSidebar.tsx— `desktop/src/features/sidebar/ui/AppSidebar.tsx` changes together with 4 other files — `desktop/src/features/chat/ui/ChatHeader.tsx`, `desktop/src/features/profile/ui/ProfilePopover.tsx`, `desktop/src/features/search/ui/TopbarSearch.tsx`, `desktop/src/shared/ui/ViewLoadingFallback.tsx` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: e2eBridge.ts → REDACTED, hooks.ts, SetupStep.tsx desktop/src/testing/e2eBridge.ts— `desktop/src/testing/e2eBridge.ts` changes together with 3 other files — `desktop/src-tauri/src/managed_agents/personas/tests.rs`, `desktop/src/features/onboarding/hooks.ts`, `desktop/src/features/onboarding/ui/SetupStep.tsx` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: MessageRow.tsx → inbox.ts, InboxMessageRow.tsx, threadPanel.ts, SystemMessageRow.tsx, TimelineMessageList.tsx desktop/src/features/messages/ui/MessageRow.tsx— `desktop/src/features/messages/ui/MessageRow.tsx` changes together with 5 other files — `desktop/src/features/home/lib/inbox.ts`, `desktop/src/features/home/ui/InboxMessageRow.tsx`, `desktop/src/features/messages/lib/threadPanel.ts`, `desktop/src/features/messages/ui/SystemMessageRow.tsx`, `desktop/src/features/messages/ui/TimelineMessageList.tsx` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: ChannelPane.tsx → AppShellContext.tsx, ChannelScreen.tsx, useChannelPaneHandlers.ts, threadPanel.ts, TimelineMessageList.tsx, TypingIndicatorRow.tsx desktop/src/features/channels/ui/ChannelPane.tsx— `desktop/src/features/channels/ui/ChannelPane.tsx` changes together with 6 other files — `desktop/src/app/AppShellContext.tsx`, `desktop/src/features/channels/ui/ChannelScreen.tsx`, `desktop/src/features/channels/useChannelPaneHandlers.ts`, `desktop/src/features/messages/lib/threadPanel.ts`, `desktop/src/features/messages/ui/TimelineMessageList.tsx`, `desktop/src/features/messages/ui/TypingIndicatorRow.tsx` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
Change-coupling hub: tauriPersonas.ts → personas.rs, types.rs, AgentDefinitionDialog.tsx desktop/src/shared/api/tauriPersonas.ts— `desktop/src/shared/api/tauriPersonas.ts` changes together with 3 other files — `desktop/src-tauri/src/managed_agents/personas.rs`, `desktop/src-tauri/src/managed_agents/types.rs`, `desktop/src/features/agents/ui/AgentDefinitionDialog.tsx` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: AppShell.tsx → ChannelBrowserDialog.tsx, ChatHeader.tsx, types.ts, desktop.ts, ProfilePopover.tsx, TopbarSearch.tsx, SettingsView.tsx, SidebarProfileCard.tsx, kinds.ts, ViewLoadingFallback.tsx desktop/src/app/AppShell.tsx— `desktop/src/app/AppShell.tsx` changes together with 10 other files — `desktop/src/features/channels/ui/ChannelBrowserDialog.tsx`, `desktop/src/features/chat/ui/ChatHeader.tsx`, `desktop/src/features/messages/types.ts`, `desktop/src/features/notifications/lib/desktop.ts`, `desktop/src/features/profile/ui/ProfilePopover.tsx`, `desktop/src/features/search/ui/TopbarSearch.tsx`, `desktop/src/features/settings/ui/SettingsView.tsx`, `desktop/src/features/sidebar/ui/SidebarProfileCard.tsx`, `desktop/src/shared/constants/kinds.ts`, `desktop/src/shared/ui/ViewLoadingFallback.tsx` — none of which declares a dependency on it: one file is the hub of 10 separate couplings, not 10 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 10.
Change-coupling hub: lib.rs → operator.rs, mod.rs, router.rs crates/buzz-db/src/lib.rs— `crates/buzz-db/src/lib.rs` changes together with 3 other files — `crates/buzz-relay/src/api/operator.rs`, `crates/buzz-relay/src/handlers/mod.rs`, `crates/buzz-relay/src/router.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: event.rs → REDACTED, auth.rs, count.rs crates/buzz-relay/src/handlers/event.rs— `crates/buzz-relay/src/handlers/event.rs` changes together with 3 other files — `REDACTED`, `crates/buzz-relay/src/handlers/auth.rs`, `crates/buzz-relay/src/handlers/count.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Duplicated block (18 lines × 2) crates/buzz-cli/src/commands/mem.rs:208— crates/buzz-cli/src/commands/mem.rs:208-225 | desktop/src-tauri/src/commands/engrams.rs:191-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) crates/buzz-relay/src/api/git/transport.rs:1456— crates/buzz-relay/src/api/git/transport.rs:1456-1473 | crates/buzz-relay/src/api/git/transport.rs:1860-1877 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:3497— crates/buzz-relay/src/handlers/ingest.rs:3497-3514 | crates/buzz-relay/src/handlers/ingest.rs:3743-3760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/buzz-relay/src/tunnel/directory.rs:378— crates/buzz-relay/src/tunnel/directory.rs:378-395 | crates/buzz-relay/src/tunnel/directory.rs:421-438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) desktop/src-tauri/src/managed_agents/discovery.rs:386— desktop/src-tauri/src/managed_agents/discovery.rs:386-403 | desktop/src-tauri/src/managed_agents/managed_node_paths.rs:84-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) crates/buzz-db/src/store/thread.rs:466— crates/buzz-db/src/store/thread.rs:466-483 | crates/buzz-db/src/store/thread.rs:766-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/buzz-relay/src/api/bridge.rs:2787— crates/buzz-relay/src/api/bridge.rs:2787-2804 | crates/buzz-relay/src/handlers/command_executor.rs:971-988 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) mobile/lib/shared/widgets/buzz_sheet_header.dart:128— mobile/lib/shared/widgets/buzz_sheet_header.dart:128-145 | mobile/lib/shared/widgets/modal_presentation.dart:169-186 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 3) crates/buzz-cli/src/commands/issues.rs:582— crates/buzz-cli/src/commands/issues.rs:582-590 | crates/buzz-cli/src/commands/patches.rs:183-191 | crates/buzz-cli/src/commands/pr.rs:216-224 — before extracting anything, compare `crates/buzz-cli/src/commands/issues.rs` and `crates/buzz-cli/src/commands/patches.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/buzz-cli/src/commands/mem.rs:94— crates/buzz-cli/src/commands/mem.rs:94-102 | crates/buzz-cli/src/commands/notes.rs:545-553 | crates/buzz-cli/src/commands/notes.rs:733-741 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) crates/buzz-relay/src/api/bridge.rs:986— crates/buzz-relay/src/api/bridge.rs:986-994 | crates/buzz-relay/src/api/bridge.rs:1380-1388 | crates/buzz-relay/src/api/bridge.rs:2074-2082 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) desktop/src-tauri/src/commands/agents.rs:273— desktop/src-tauri/src/commands/agents.rs:273-281 | desktop/src-tauri/src/managed_agents/restore.rs:451-459 | desktop/src-tauri/src/shutdown.rs:133-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) crates/buzz-acp/src/acp.rs:2516— crates/buzz-acp/src/acp.rs:2516-2524 | crates/buzz-agent/src/mcp.rs:1040-1048 | crates/buzz-dev-mcp/src/lib.rs:203-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) crates/buzz-relay/src/handlers/side_effects.rs:1157— crates/buzz-relay/src/handlers/side_effects.rs:1157-1166 | crates/buzz-relay/src/handlers/side_effects.rs:3682-3690 | crates/buzz-relay/src/handlers/side_effects.rs:4139-4147 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) desktop/src-tauri/src/migration.rs:494— desktop/src-tauri/src/migration.rs:494-502 | desktop/src-tauri/src/migration.rs:600-608 | desktop/src-tauri/src/migration/pollen.rs:23-31 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:240— mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:240-248 | mobile/ios/Runner/NativeEmojiPicker.swift:168-176 | mobile/ios/Runner/NativeProfileTextEditor.swift:193-201 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
buzz_core::network::is_not_global_unicast (cyclomatic 27) crates/buzz-core/src/network.rs:50— buzz_core::network::is_not_global_unicast has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
buzz_core::artifact::validate (cyclomatic 25) crates/buzz-core/src/artifact.rs:80— buzz_core::artifact::validate 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.
buzz_core::filter::filter_match_one (cyclomatic 22) crates/buzz-core/src/filter.rs:92— buzz_core::filter::filter_match_one 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.
buzz_core::private_managed_agent::validate_envelope (cyclomatic 19) crates/buzz-core/src/private_managed_agent.rs:262— buzz_core::private_managed_agent::validate_envelope has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_core::artifact::parse_query (cyclomatic 18) crates/buzz-core/src/artifact.rs:327— buzz_core::artifact::parse_query 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.
buzz_core::pairing::qr::decode_qr (cyclomatic 18) crates/buzz-core/src/pairing/qr.rs:104— buzz_core::pairing::qr::decode_qr has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_core::channel::decide_member_put (cyclomatic 17) crates/buzz-core/src/channel.rs:312— buzz_core::channel::decide_member_put has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (12–13 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:181— crates/buzz-db/src/store/relay_admin_actions.rs:181-193 | crates/buzz-db/src/store/workflow.rs:1087-1098 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 2) crates/buzz-relay/src/audio/handler.rs:1373— crates/buzz-relay/src/audio/handler.rs:1373-1385 | crates/buzz-relay/src/audio/handler.rs:1397-1408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/buzz-relay/src/connection.rs:1375— crates/buzz-relay/src/connection.rs:1375-1387 | crates/buzz-relay/src/connection.rs:1398-1409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:1434— crates/buzz-relay/src/handlers/side_effects.rs:1434-1445 | crates/buzz-relay/src/handlers/side_effects.rs:1491-1503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) desktop/src-tauri/src/relay.rs:583— desktop/src-tauri/src/relay.rs:583-594 | desktop/src-tauri/src/relay.rs:713-725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) mobile/lib/shared/widgets/ios_glass_navigation_action.dart:59— mobile/lib/shared/widgets/ios_glass_navigation_action.dart:59-70 | mobile/lib/shared/widgets/ios_glass_navigation_button.dart:128-140 — before extracting anything, compare `mobile/lib/shared/widgets/ios_glass_navigation_action.dart` and `mobile/lib/shared/widgets/ios_glass_navigation_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:49— mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:49-61 | mobile/lib/shared/widgets/ios_native_skin_tone_control.dart:41-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 3) crates/buzz-relay/src/handlers/count.rs:133— crates/buzz-relay/src/handlers/count.rs:133-144 | crates/buzz-relay/src/handlers/req.rs:249-260 | crates/buzz-relay/src/handlers/req.rs:375-385 — before extracting anything, compare `crates/buzz-relay/src/handlers/count.rs` and `crates/buzz-relay/src/handlers/req.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/buzz-db/src/store/channel_members.rs:1967— crates/buzz-db/src/store/channel_members.rs:1967-1977 | crates/buzz-db/src/store/git_repo.rs:161-172 | crates/buzz-db/src/store/moderation.rs:631-654 — before extracting anything, compare `crates/buzz-db/src/store/git_repo.rs` and `crates/buzz-db/src/store/moderation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/buzz-relay/src/handlers/command_executor.rs:451— crates/buzz-relay/src/handlers/command_executor.rs:451-461 | crates/buzz-relay/src/handlers/command_executor.rs:581-591 | crates/buzz-relay/src/handlers/command_executor.rs:659-670 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:30— mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:30-40 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:30-40 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:30-40 — `mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_provider.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 3) mobile/lib/features/channels/channels_page/body.dart:266— mobile/lib/features/channels/channels_page/body.dart:266-276 | mobile/lib/features/channels/channels_page/body.dart:377-387 | mobile/lib/features/channels/channels_page/body.dart:391-401 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) mobile/lib/features/forum/forum_post_card.dart:304— mobile/lib/features/forum/forum_post_card.dart:304-314 | mobile/lib/features/forum/forum_thread_page.dart:180-190 | mobile/lib/features/forum/forum_thread_page.dart:642-652 — before extracting anything, compare `mobile/lib/features/forum/forum_post_card.dart` and `mobile/lib/features/forum/forum_thread_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:82— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:82-92 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:85-95 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:82-92 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) crates/buzz-admin/src/communities.rs:278— crates/buzz-admin/src/communities.rs:278-284 | crates/buzz-relay/src/handlers/community_provisioning.rs:107-117 | crates/buzz-relay/src/handlers/community_provisioning.rs:191-197 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/buzz-cli/src/commands/emoji.rs:107— crates/buzz-cli/src/commands/emoji.rs:107-113 | crates/buzz-cli/src/commands/emoji.rs:247-253 | crates/buzz-cli/src/commands/emoji.rs:363-369 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) desktop/src-tauri/src/commands/channel_templates.rs:13— desktop/src-tauri/src/commands/channel_templates.rs:13-19 | desktop/src-tauri/src/commands/personas/mod.rs:14-20 | desktop/src-tauri/src/commands/teams/mod.rs:14-20 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) desktop/src-tauri/src/managed_agents/config_bridge/claude.rs:70— desktop/src-tauri/src/managed_agents/config_bridge/claude.rs:70-76 | desktop/src-tauri/src/managed_agents/config_bridge/codex.rs:108-114 | desktop/src-tauri/src/managed_agents/config_bridge/codex.rs:116-123 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) desktop/src-tauri/src/commands/link_preview_cancellation.rs:39— desktop/src-tauri/src/commands/link_preview_cancellation.rs:39-45 | desktop/src-tauri/src/commands/media_fetch_cancellation.rs:45-51 | desktop/src-tauri/src/commands/media_upload_progress.rs:39-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) desktop/src-tauri/src/archive/store_migrations.rs:117— desktop/src-tauri/src/archive/store_migrations.rs:117-124 | desktop/src-tauri/src/archive/store_migrations.rs:240-247 | desktop/src-tauri/src/archive/store_migrations.rs:317-323 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) mobile/lib/features/profile/profile_edit_page.dart:648— mobile/lib/features/profile/profile_edit_page.dart:648-654 | mobile/lib/features/profile/profile_text_edit_sheet.dart:39-45 | mobile/lib/shared/widgets/text_editor.dart:93-99 — before extracting anything, compare `mobile/lib/features/profile/profile_edit_page.dart` and `mobile/lib/features/profile/profile_text_edit_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
buzz_media::auth::verify_blossom_auth_event_for_verb (cyclomatic 40) crates/buzz-media/src/auth.rs:65— buzz_media::auth::verify_blossom_auth_event_for_verb has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_media::validation::validate_jpeg_metadata_free (cyclomatic 24) crates/buzz-media/src/validation.rs:520— buzz_media::validation::validate_jpeg_metadata_free 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. This is NOT this file's highest cyclomatic complexity: buzz_media::validation::file_mime_to_ext (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
buzz_media::validation::validate_gif_metadata_free (cyclomatic 22) crates/buzz-media/src/validation.rs:752— buzz_media::validation::validate_gif_metadata_free has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: buzz_media::validation::file_mime_to_ext (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
buzz_media::validation::validate_webp_metadata_free (cyclomatic 19) crates/buzz-media/src/validation.rs:677— buzz_media::validation::validate_webp_metadata_free has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: buzz_media::validation::file_mime_to_ext (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
buzz_media::upload::process_video_upload (cyclomatic 16) crates/buzz-media/src/upload.rs:292— buzz_media::upload::process_video_upload 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.
buzz_media::validation::validate_video_file (cyclomatic 16) crates/buzz-media/src/validation.rs:303— buzz_media::validation::validate_video_file has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: buzz_media::validation::file_mime_to_ext (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
buzz_persona::validate::advisory_check_skill_names (cognitive 47) crates/buzz-persona/src/validate.rs:354— buzz_persona::validate::advisory_check_skill_names has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (31 pts), match/switch 4 (8 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buzz_persona::validate::advisory_check_manifest_keys (cognitive 21) crates/buzz-persona/src/validate.rs:302— buzz_persona::validate::advisory_check_manifest_keys has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), match/switch 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_persona::pack::load_pack (cognitive 18) crates/buzz-persona/src/pack.rs:125— buzz_persona::pack::load_pack has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_persona::validate::check_respond_to_value (cognitive 17) crates/buzz-persona/src/validate.rs:236— buzz_persona::validate::check_respond_to_value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_persona::pack::resolve_skills (cognitive 16) crates/buzz-persona/src/pack.rs:249— buzz_persona::pack::resolve_skills has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_persona::resolve::merge_mcp_servers (cognitive 16) crates/buzz-persona/src/resolve.rs:277— buzz_persona::resolve::merge_mcp_servers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×6
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
AC1 · Text alternatives· <canvas> without a text alternative · ×5
<canvas> without a text alternative desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:768— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative desktop/src/features/terminal/TerminalSubstrate.tsx:681— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative desktop/src/features/terminal/TerminalSubstrate.tsx:759— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative desktop/src/shared/ui/EmojiBurstProvider.tsx:720— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative desktop/src/shared/ui/SpoilerParticles.tsx:71— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
D10 · Test Quality· Fixed-sleep synchronisation · ×5
Fixed-sleep synchronisation: an orphaned metadata load is cancelled after its re-entry grace period desktop/src/shared/lib/useResolvedLinkPreviews.test.mjs:629— This test starts work it did not wait for (`rejection`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 1_050))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: hard-caps active work and removes queued work on cancellation desktop/src/features/messages/lib/audioMediaLoadScheduler.test.mjs:32— This test starts work it did not wait for (`settlements`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: settled work promotes only enough queued work to refill the cap desktop/src/features/messages/lib/audioMediaLoadScheduler.test.mjs:58— This test starts work it did not wait for (`settlements`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: supported transitions wait for target readiness desktop/src/app/communityViewTransition.test.mjs:51— This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: a newer transition releases the previous transition desktop/src/app/communityViewTransition.test.mjs:71— This test starts work it did not wait for (`first`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Duplicated block (13–14 lines × 2) crates/buzz-acp/src/relay.rs:2277— crates/buzz-acp/src/relay.rs:2277-2289 | crates/buzz-acp/src/relay.rs:2316-2329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/buzz-db/src/store/moderation.rs:450— crates/buzz-db/src/store/moderation.rs:450-463 | crates/buzz-db/src/store/moderation.rs:506-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/buzz-search/src/query.rs:344— crates/buzz-search/src/query.rs:344-357 | crates/buzz-search/src/query.rs:461-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:742— desktop/src-tauri/src/commands/personas/snapshot/import.rs:742-755 | desktop/src-tauri/src/commands/team_snapshot.rs:838-850 — before extracting anything, compare `desktop/src-tauri/src/commands/personas/snapshot/import.rs` and `desktop/src-tauri/src/commands/team_snapshot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 2) mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:107— mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:107-119 | mobile/ios/Runner/NativeProfileTextEditor.swift:42-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 3) crates/buzz-db/src/store/api_token.rs:185— crates/buzz-db/src/store/api_token.rs:185-196 | crates/buzz-db/src/store/api_token.rs:247-258 | crates/buzz-db/src/store/api_token.rs:400-411 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/buzz-db/src/store/workflow.rs:694— crates/buzz-db/src/store/workflow.rs:694-705 | crates/buzz-db/src/store/workflow.rs:731-742 | crates/buzz-db/src/store/workflow.rs:768-779 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) desktop/src-tauri/src/commands/bestie.rs:82— desktop/src-tauri/src/commands/bestie.rs:82-93 | desktop/src-tauri/src/commands/bestie.rs:107-118 | desktop/src-tauri/src/commands/bestie.rs:131-142 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) mobile/ios/Runner/NativeProfileTextEditor.swift:323— mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPendingEnrollmentRecord.swift:47-58 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:77-88 | mobile/ios/Runner/NativeProfileTextEditor.swift:323-334 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPendingEnrollmentRecord.swift:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) mobile/lib/features/channels/me/new_me_chat.dart:36— mobile/lib/features/channels/me/new_me_chat.dart:36-47 | mobile/lib/features/profile/profile_edit_page.dart:675-686 | mobile/lib/features/profile/profile_text_edit_sheet.dart:114-125 — before extracting anything, compare `mobile/lib/features/profile/profile_edit_page.dart` and `mobile/lib/features/profile/profile_text_edit_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
buzz_sdk::builders::build_repo_announcement (cyclomatic 23) crates/buzz-sdk/src/builders.rs:1089— buzz_sdk::builders::build_repo_announcement has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_sdk::mentions::strip_code_regions (cyclomatic 20) crates/buzz-sdk/src/mentions.rs:244— buzz_sdk::mentions::strip_code_regions has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_sdk::builders::build_diff_message (cyclomatic 17) crates/buzz-sdk/src/builders.rs:357— buzz_sdk::builders::build_diff_message has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_sdk::builders::build_git_status (cyclomatic 16) crates/buzz-sdk/src/builders.rs:1602— buzz_sdk::builders::build_git_status has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
RunCtx::run (cognitive 68) crates/buzz-agent/src/agent.rs:318— RunCtx::run has cognitive complexity 68 (threshold 15). Drivers by points: if/else 23 (53 pts), match/switch 4 (9 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunCtx::execute_parallel (cognitive 32) crates/buzz-agent/src/agent.rs:909— RunCtx::execute_parallel has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 7 (13 pts), loops 4 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunCtx::execute_calls (cognitive 22) crates/buzz-agent/src/agent.rs:834— RunCtx::execute_calls has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunCtx::build_handoff_prompt (cognitive 16) crates/buzz-agent/src/handoff.rs:304— RunCtx::build_handoff_prompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
git_sign_nostr::parse_args (cognitive 36) crates/git-sign-nostr/src/lib.rs:196— git_sign_nostr::parse_args has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
git_sign_nostr::enforce_conditions (cognitive 19) crates/git-sign-nostr/src/lib.rs:591— git_sign_nostr::enforce_conditions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
git_sign_nostr::do_verify (cognitive 18) crates/git-sign-nostr/src/lib.rs:1099— git_sign_nostr::do_verify has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (18 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
git_sign_nostr::do_sign (cognitive 16) crates/git-sign-nostr/src/lib.rs:943— git_sign_nostr::do_sign has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_deletion::enumerate_tenant_prefixes (cognitive 27) crates/buzz-deletion/src/lib.rs:767— buzz_deletion::enumerate_tenant_prefixes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 3 (6 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.
buzz_deletion::run_loop (cognitive 24) crates/buzz-deletion/src/lib.rs:972— buzz_deletion::run_loop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_deletion::execute_stage (cognitive 21) crates/buzz-deletion/src/lib.rs:1431— buzz_deletion::execute_stage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (7 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_deletion::prepare_owner_claim_with (cognitive 20) crates/buzz-deletion/src/lib.rs:1087— buzz_deletion::prepare_owner_claim_with has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 5 (7 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_backend_kubernetes::env::build_env (cognitive 20) crates/buzz-backend-kubernetes/src/env.rs:166— buzz_backend_kubernetes::env::build_env has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buzz_backend_kubernetes::gc::plan (cognitive 19) crates/buzz-backend-kubernetes/src/gc.rs:51— buzz_backend_kubernetes::gc::plan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_backend_kubernetes::observe::decode_startup (cognitive 19) crates/buzz-backend-kubernetes/src/observe.rs:74— buzz_backend_kubernetes::observe::decode_startup has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 4 (7 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buzz_backend_kubernetes::reconcile::try_preflight_gc (cognitive 18) crates/buzz-backend-kubernetes/src/reconcile.rs:162— buzz_backend_kubernetes::reconcile::try_preflight_gc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (24 lines × 2) crates/buzz-relay/src/audio/handler.rs:1789— crates/buzz-relay/src/audio/handler.rs:1789-1812 | crates/buzz-relay/src/audio/handler.rs:1832-1855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:1955— crates/buzz-relay/src/handlers/side_effects.rs:1955-1978 | crates/buzz-relay/src/handlers/side_effects.rs:2690-2713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) desktop/src-tauri/src/managed_agents/runtime/process.rs:323— desktop/src-tauri/src/managed_agents/runtime/process.rs:323-346 | desktop/src-tauri/src/managed_agents/runtime/process.rs:357-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) mobile/lib/features/activity/activity_page.dart:83— mobile/lib/features/activity/activity_page.dart:83-106 | mobile/lib/features/channels/channels_page.dart:193-216 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (19–20 lines × 2) crates/buzz-acp/src/lib.rs:3607— crates/buzz-acp/src/lib.rs:3607-3626 | crates/buzz-acp/src/lib.rs:3660-3678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) crates/buzz-db/src/store/moderation.rs:492— crates/buzz-db/src/store/moderation.rs:492-511 | crates/buzz-db/src/store/moderation.rs:582-600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) crates/buzz-relay/src/api/bridge.rs:2540— crates/buzz-relay/src/api/bridge.rs:2540-2559 | crates/buzz-relay/src/handlers/req.rs:828-846 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/handlers/req.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19–20 lines × 2) mobile/lib/features/channels/composer_dock_size_reporter.dart:30— mobile/lib/features/channels/composer_dock_size_reporter.dart:30-49 | mobile/lib/features/channels/thread_detail_page/head_layout.dart:21-39 — 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 (15–16 lines × 2) crates/buzz-agent/src/llm.rs:1893— crates/buzz-agent/src/llm.rs:1893-1908 | crates/buzz-agent/src/llm.rs:2288-2302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:717— desktop/src-tauri/src/commands/personas/snapshot/import.rs:717-731 | desktop/src-tauri/src/commands/team_snapshot.rs:806-821 — before extracting anything, compare `desktop/src-tauri/src/commands/personas/snapshot/import.rs` and `desktop/src-tauri/src/commands/team_snapshot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 2) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:129— desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:129-143 | desktop/src-tauri/src/managed_agents/runtime/sweep.rs:333-348 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–16 lines × 2) mobile/lib/features/channels/channels_page/channel_tile.dart:125— mobile/lib/features/channels/channels_page/channel_tile.dart:125-139 | mobile/lib/features/search/search_page.dart:511-526 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 3) crates/buzz-cli/src/commands/issues.rs:499— crates/buzz-cli/src/commands/issues.rs:499-512 | crates/buzz-cli/src/commands/patches.rs:93-106 | crates/buzz-cli/src/commands/pr.rs:135-148 — before extracting anything, compare `crates/buzz-cli/src/commands/issues.rs` and `crates/buzz-cli/src/commands/patches.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) desktop/src-tauri/src/commands/media_transcode.rs:254— desktop/src-tauri/src/commands/media_transcode.rs:254-267 | desktop/src-tauri/src/commands/media_transcode.rs:339-352 | desktop/src-tauri/src/commands/media_transcode.rs:405-418 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:205— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:205-218 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:305-318 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:205-218 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 3) mobile/lib/features/profile/profile_edit_page.dart:687— mobile/lib/features/profile/profile_edit_page.dart:687-700 | mobile/lib/features/profile/profile_text_edit_sheet.dart:126-139 | mobile/lib/shared/widgets/text_editor.dart:135-148 — before extracting anything, compare `mobile/lib/features/profile/profile_edit_page.dart` and `mobile/lib/features/profile/profile_text_edit_sheet.dart` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) crates/buzz-db/src/store/nip_fi_binding.rs:74— crates/buzz-db/src/store/nip_fi_binding.rs:74-83 | crates/buzz-db/src/store/nip_fi_binding.rs:110-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/buzz-relay/src/handlers/event.rs:1017— crates/buzz-relay/src/handlers/event.rs:1017-1026 | crates/buzz-relay/src/handlers/event.rs:1393-1401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/buzz-relay/src/router.rs:676— crates/buzz-relay/src/router.rs:676-684 | crates/buzz-relay/src/router.rs:772-781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) desktop/src-tauri/src/commands/media_transcode.rs:147— desktop/src-tauri/src/commands/media_transcode.rs:147-156 | desktop/src-tauri/src/commands/relay_reconnect.rs:65-73 — 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 (22 lines × 2) crates/buzz-db/src/store/moderation.rs:358— crates/buzz-db/src/store/moderation.rs:358-380 | crates/buzz-db/src/store/moderation.rs:546-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/buzz-db/src/store/event.rs:340— crates/buzz-db/src/store/event.rs:340-361 | crates/buzz-db/src/store/event.rs:392-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:97— mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:97-118 | mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:195-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.
Duplicated block (22 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:90— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:90-111 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:66-87 — before extracting anything, compare `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
AC1 · Text alternatives· <video> without a captions track · ×3
<video> without a captions track desktop/src/features/messages/ui/ComposerAttachments.tsx:432— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track desktop/src/shared/ui/VideoPlayer.tsx:992— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track desktop/src/shared/ui/VideoPlayer.tsx:1698— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC2 · Forms & labels· <Textarea> field component without a label · ×3
<Textarea> field component without a label desktop/src/features/agents/ui/AgentCardMintDialog.tsx:306— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Textarea> field component without a label desktop/src/features/agents/ui/RespondToField.tsx:501— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Textarea> field component without a label desktop/src/features/settings/ui/SendFeedbackDialog.tsx:234— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <fieldset> without a <legend> · ×3
<fieldset> without a <legend> desktop/src/features/forum/ui/ForumComposer.tsx:681— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> desktop/src/features/onboarding/ui/DefaultConfigStep.tsx:231— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:454— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×3
Focus outline removed in CSS without a :focus replacement desktop/src/shared/styles/globals/animations.css:433— `.buzz-avatar-hue-scrubber` 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.
Focus outline removed in CSS without a :focus replacement desktop/src/shared/styles/globals/composer.css:97— `.rich-text-composer .tiptap` 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.
Focus outline removed in CSS without a :focus replacement desktop/src/shared/styles/globals/media-controls.css:11— `.video-volume-slider:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Config::from_env (cyclomatic 71) crates/buzz-relay/src/config.rs:633— Config::from_env has cyclomatic complexity 71 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Config::from_args (cyclomatic 38) crates/buzz-acp/src/config.rs:965— Config::from_args has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Config::validate (cyclomatic 20) crates/buzz-agent/src/config.rs:812— Config::validate has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AcpClient::read_until_response_with_idle_timeout (cyclomatic 46) crates/buzz-acp/src/acp.rs:1395— AcpClient::read_until_response_with_idle_timeout has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AcpClient::spawn_with_env (cyclomatic 18) crates/buzz-acp/src/acp.rs:476— AcpClient::spawn_with_env 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.
AcpClient::read_until_response (cyclomatic 16) crates/buzz-acp/src/acp.rs:1271— AcpClient::read_until_response 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.
buzz_voice::imported::decode_wav (cyclomatic 27) crates/buzz-voice/src/imported.rs:321— buzz_voice::imported::decode_wav 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.
buzz_voice::pocket_april::split_at_natural_boundaries (cyclomatic 20) crates/buzz-voice/src/pocket_april.rs:983— buzz_voice::pocket_april::split_at_natural_boundaries has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_voice::imported::decode_media (cyclomatic 16) crates/buzz-voice/src/imported.rs:425— buzz_voice::imported::decode_media 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.
buzz_dev_mcp::tree::run (cyclomatic 23) crates/buzz-dev-mcp/src/tree.rs:18— buzz_dev_mcp::tree::run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_dev_mcp::shell::run (cyclomatic 22) crates/buzz-dev-mcp/src/shell.rs:134— buzz_dev_mcp::shell::run has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_dev_mcp::rg::scan_file (cyclomatic 16) crates/buzz-dev-mcp/src/rg.rs:263— buzz_dev_mcp::rg::scan_file 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.
buzz_cli::commands::projects::cmd_update (cyclomatic 20) crates/buzz-cli/src/commands/projects.rs:588— buzz_cli::commands::projects::cmd_update has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_cli::commands::pack::cmd_inspect (cyclomatic 19) crates/buzz-cli/src/commands/pack.rs:52— buzz_cli::commands::pack::cmd_inspect 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.
buzz_cli::commands::mem::cmd_patch (cyclomatic 16) crates/buzz-cli/src/commands/mem.rs:538— buzz_cli::commands::mem::cmd_patch 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.
huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile (cyclomatic 19) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:435— huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds (cyclomatic 17) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:284— huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness (cyclomatic 17) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:363— huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Db::accept_artifact (cyclomatic 18) crates/buzz-db/src/store/artifact.rs:97— Db::accept_artifact 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.
Db::route_read (cyclomatic 16) crates/buzz-db/src/runtime/mod.rs:1739— Db::route_read has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Db::sidebar (cyclomatic 16) crates/buzz-db/src/store/personal_read/projection.rs:58— Db::sidebar 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.
AcpClient::read_until_response_with_idle_timeout (cognitive 155) crates/buzz-acp/src/acp.rs:1395— AcpClient::read_until_response_with_idle_timeout has cognitive complexity 155 (threshold 15). Drivers by points: if/else 27 (103 pts), match/switch 12 (50 pts), boolean chains 1, loops 1 (nesting depth added 114). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AcpClient::read_until_response (cognitive 26) crates/buzz-acp/src/acp.rs:1271— AcpClient::read_until_response has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AcpClient::spawn_with_env (cognitive 22) crates/buzz-acp/src/acp.rs:476— AcpClient::spawn_with_env has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::from_env (cognitive 82) crates/buzz-relay/src/config.rs:633— Config::from_env has cognitive complexity 82 (threshold 15). Drivers by points: if/else 27 (43 pts), boolean chains 21, match/switch 13 (15 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::from_args (cognitive 54) crates/buzz-acp/src/config.rs:965— Config::from_args has cognitive complexity 54 (threshold 15). Drivers by points: if/else 38 (45 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Config::validate (cognitive 20) crates/buzz-agent/src/config.rs:812— Config::validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SubscriptionRegistry::remove_from_index (cognitive 78) crates/buzz-relay/src/subscription.rs:564— SubscriptionRegistry::remove_from_index has cognitive complexity 78 (threshold 15). Drivers by points: if/else 14 (54 pts), loops 4 (13 pts), match/switch 2 (6 pts), boolean chains 5 (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SubscriptionRegistry::fan_out_scoped (cognitive 31) crates/buzz-relay/src/subscription.rs:379— SubscriptionRegistry::fan_out_scoped has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 7 (13 pts) (nesting depth added 18). 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.
SubscriptionRegistry::register_with_scope (cognitive 24) crates/buzz-relay/src/subscription.rs:142— SubscriptionRegistry::register_with_scope has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (13 pts), match/switch 2 (6 pts), if/else 4 (5 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
buzz_voice::pocket_april::split_at_natural_boundaries (cognitive 40) crates/buzz-voice/src/pocket_april.rs:983— buzz_voice::pocket_april::split_at_natural_boundaries has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (10 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_voice::imported::decode_wav (cognitive 34) crates/buzz-voice/src/imported.rs:321— buzz_voice::imported::decode_wav has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (3 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.
buzz_voice::imported::decode_media (cognitive 22) crates/buzz-voice/src/imported.rs:425— buzz_voice::imported::decode_media has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Db::sidebar (cognitive 35) crates/buzz-db/src/store/personal_read/projection.rs:58— Db::sidebar has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Db::accept_artifact (cognitive 18) crates/buzz-db/src/store/artifact.rs:97— Db::accept_artifact has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Db::route_read (cognitive 16) crates/buzz-db/src/runtime/mod.rs:1739— Db::route_read has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 5 (7 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds (cognitive 26) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:284— huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness (cognitive 26) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:363— huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile (cognitive 25) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:435— huddlePresenceRuntime.startHuddlePresenceRuntime::reconcile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (huddlePresenceRuntime.startHuddlePresenceRuntime::fetchActiveSessionIds, huddlePresenceRuntime.startHuddlePresenceRuntime::refreshLiveness) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Duplicated block (19–21 lines × 2) crates/buzz-acp/src/queue.rs:740— crates/buzz-acp/src/queue.rs:740-760 | crates/buzz-acp/src/queue.rs:805-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–21 lines × 2) crates/buzz-relay/src/audio/room.rs:390— crates/buzz-relay/src/audio/room.rs:390-410 | crates/buzz-relay/src/audio/room.rs:573-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–21 lines × 2) desktop/src-tauri/src/huddle/tts.rs:542— desktop/src-tauri/src/huddle/tts.rs:542-562 | desktop/src-tauri/src/huddle/tts.rs:607-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/buzz-admin/src/communities.rs:314— crates/buzz-admin/src/communities.rs:314-334 | crates/buzz-relay/src/handlers/community_provisioning.rs:151-171 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) crates/buzz-db/src/store/channel.rs:175— crates/buzz-db/src/store/channel.rs:175-195 | crates/buzz-db/src/store/channel.rs:237-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/buzz-voice/src/pocket_april.rs:513— crates/buzz-voice/src/pocket_april.rs:513-533 | crates/buzz-voice/src/pocket_april.rs:828-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–20 lines × 2) crates/buzz-relay/src/audio/room.rs:326— crates/buzz-relay/src/audio/room.rs:326-345 | crates/buzz-relay/src/audio/room.rs:516-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–20 lines × 2) desktop/src-tauri/src/commands/admin/mod.rs:184— desktop/src-tauri/src/commands/admin/mod.rs:184-203 | desktop/src-tauri/src/commands/admin/mod.rs:232-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–20 lines × 2) mobile/ios/Runner/AppDelegate.swift:1009— mobile/ios/Runner/AppDelegate.swift:1009-1028 | mobile/ios/Runner/VoiceNotePackager.swift:290-305 — 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 `mobile/ios/Runner/AppDelegate.swift:1009` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) crates/buzz-acp/src/pool.rs:3308— crates/buzz-acp/src/pool.rs:3308-3325 | crates/buzz-acp/src/pool.rs:3614-3630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) crates/buzz-relay/src/api/bridge.rs:3039— crates/buzz-relay/src/api/bridge.rs:3039-3056 | crates/buzz-relay/src/api/bridge.rs:3079-3095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) mobile/lib/features/channels/channels_page/sections.dart:116— mobile/lib/features/channels/channels_page/sections.dart:116-132 | mobile/lib/features/channels/channels_page/sections.dart:467-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) crates/buzz-agent/src/auth.rs:696— crates/buzz-agent/src/auth.rs:696-712 | crates/buzz-agent/src/auth.rs:2169-2184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) mobile/ios/Runner/HuddleAudioEngine.swift:185— mobile/ios/Runner/HuddleAudioEngine.swift:185-200 | mobile/ios/Runner/HuddleAudioEngine.swift:787-803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/Runner/HuddleAudioEngine.swift:185` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16–17 lines × 2) mobile/lib/features/forum/forum_posts_view.dart:81— mobile/lib/features/forum/forum_posts_view.dart:81-96 | mobile/lib/features/forum/forum_thread_page.dart:97-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14–17 lines × 2) crates/buzz-relay/src/handlers/count.rs:227— crates/buzz-relay/src/handlers/count.rs:227-240 | crates/buzz-relay/src/handlers/count.rs:310-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–17 lines × 2) desktop/src-tauri/src/commands/teams/pending.rs:280— desktop/src-tauri/src/commands/teams/pending.rs:280-293 | desktop/src-tauri/src/commands/teams/pending.rs:316-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–17 lines × 2) mobile/ios/Runner/InlinePhotoPicker.swift:196— mobile/ios/Runner/InlinePhotoPicker.swift:196-212 | mobile/ios/Runner/NativeAttachmentPopover.swift:504-517 — before extracting anything, compare `mobile/ios/Runner/InlinePhotoPicker.swift` and `mobile/ios/Runner/NativeAttachmentPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `mobile/ios/Runner/InlinePhotoPicker.swift:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–16 lines × 2) crates/buzz-acp/src/queue.rs:520— crates/buzz-acp/src/queue.rs:520-535 | crates/buzz-acp/src/queue.rs:870-883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) crates/buzz-relay/src/api/git/cas_publish.rs:1195— crates/buzz-relay/src/api/git/cas_publish.rs:1195-1208 | crates/buzz-relay/src/api/git/cas_publish.rs:1218-1233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) crates/buzz-relay/src/audio/handler.rs:127— crates/buzz-relay/src/audio/handler.rs:127-140 | crates/buzz-relay/src/router.rs:733-748 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14–15 lines × 2) REDACTED:2638— REDACTED:2638-2651 | REDACTED:2954-2968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:76— mobile/ios/Runner/NativeAttachmentPopoverCoordinator.swift:76-90 | mobile/ios/Runner/NativeProfileTextEditor.swift:12-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14–15 lines × 2) mobile/lib/shared/push/push_bootstrap.dart:246— mobile/lib/shared/push/push_bootstrap.dart:246-259 | mobile/lib/shared/push/push_bootstrap.dart:319-333 — both copies are in the same file, so extract the block into 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–15 lines × 2) crates/buzz-pairing-cli/src/main.rs:569— crates/buzz-pairing-cli/src/main.rs:569-583 | desktop/src-tauri/src/commands/pairing.rs:770-782 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–15 lines × 2) crates/buzz-relay/src/invite_token.rs:162— crates/buzz-relay/src/invite_token.rs:162-176 | crates/buzz-relay/src/invite_token.rs:366-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.
Duplicated block (13–15 lines × 2) desktop/src-tauri/src/mesh_llm/mod.rs:386— desktop/src-tauri/src/mesh_llm/mod.rs:386-400 | desktop/src-tauri/src/mesh_llm/mod.rs:420-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 4) crates/buzz-relay/src/handlers/command_executor.rs:333— crates/buzz-relay/src/handlers/command_executor.rs:333-342 | crates/buzz-relay/src/handlers/command_executor.rs:495-504 | crates/buzz-relay/src/handlers/command_executor.rs:601-610 | crates/buzz-relay/src/handlers/command_executor.rs:753-762 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) desktop/src-tauri/src/commands/agents_pending.rs:102— desktop/src-tauri/src/commands/agents_pending.rs:102-117 | desktop/src-tauri/src/commands/personas/pending.rs:251-267 | desktop/src-tauri/src/commands/teams/mod.rs:351-366 | desktop/src-tauri/src/managed_agents/team_catalog.rs:815-824 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (10 lines × 4) mobile/lib/shared/theme/app_theme.dart:141— mobile/lib/shared/theme/app_theme.dart:141-150 | mobile/lib/shared/theme/app_theme.dart:156-165 | mobile/lib/shared/theme/app_theme.dart:171-180 | mobile/lib/shared/theme/app_theme.dart:184-193 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 2) crates/buzz-relay/src/api/git/cas_publish.rs:611— crates/buzz-relay/src/api/git/cas_publish.rs:611-618 | crates/buzz-relay/src/api/git/cas_publish.rs:719-727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/buzz-relay/src/handlers/req.rs:514— crates/buzz-relay/src/handlers/req.rs:514-521 | crates/buzz-relay/src/handlers/req.rs:923-931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/buzz-search/src/query.rs:330— crates/buzz-search/src/query.rs:330-338 | crates/buzz-search/src/query.rs:448-455 — both copies are in the same file, so extract the block into 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 × 4) crates/buzz-relay/src/handlers/identity_archive.rs:142— crates/buzz-relay/src/handlers/identity_archive.rs:142-146 | crates/buzz-relay/src/handlers/ingest.rs:2966-2970 | crates/buzz-relay/src/handlers/moderation_commands.rs:135-139 | crates/buzz-relay/src/handlers/relay_admin.rs:237-241 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (5 lines × 4) desktop/src-tauri/src/events/message_tags.rs:82— desktop/src-tauri/src/events/message_tags.rs:82-86 | desktop/src-tauri/src/events/message_tags.rs:99-103 | desktop/src-tauri/src/events/message_tags.rs:119-123 | desktop/src-tauri/src/link_preview_tags.rs:92-96 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 4) mobile/lib/shared/community/community_provider.dart:423— mobile/lib/shared/community/community_provider.dart:423-428 | mobile/lib/shared/community/community_provider.dart:512-517 | mobile/lib/shared/community/community_provider.dart:584-588 | mobile/lib/shared/community/community_provider.dart:624-628 — 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.
Outbound HTTP without resilience desktop/src-tauri/src/app_state.rs:183— `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience desktop/src-tauri/src/app_state.rs:208— `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience desktop/src-tauri/src/app_state.rs:213— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Sync-over-async blocking desktop/src/testing/e2eBridge.ts:12901— a busy-wait on the clock in `handleMockCommand` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking desktop/test-loader-hooks.mjs:168— `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking desktop/test-loader-hooks.mjs:184— `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication· Duplicated block with local edits (153 matched lines × 2 locations) · ×3
Duplicated block with local edits (153 matched lines × 2 locations) desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119— desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:119 · desktop/src/features/agents/ui/PersonaAdvancedFields.tsx:100 — the two spans are one implementation copied and then locally edited — 607 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (153 matched lines × 2 locations) desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277— desktop/src/features/onboarding/ui/BackupTestFlow.tsx:277 · desktop/src/features/settings/ui/BackupTestFlow.tsx:160 — the two spans are one implementation copied and then locally edited — 823 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (153 matched lines × 2 locations) desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114— desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:114 · desktop/src/features/workflows/ui/WorkflowMessagePicker.tsx:195 — the two spans are one implementation copied and then locally edited — 720 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.
Boundary violation [package:relative-cross-package] desktop/scripts/check-file-sizes.mjs:4— desktop/scripts/check-file-sizes.mjs:4 reaches into another package with a relative path (../../scripts/check-file-sizes-core.mjs) — import the package by name instead.
Boundary violation [package:relative-cross-package] desktop/scripts/check-pubkey-truncation.mjs:3— desktop/scripts/check-pubkey-truncation.mjs:3 reaches into another package with a relative path (../../scripts/check-pubkey-truncation-core.mjs) — import the package by name instead.
Boundary violation [package:relative-cross-package] desktop/scripts/check-px-text.mjs:3— desktop/scripts/check-px-text.mjs:3 reaches into another package with a relative path (../../scripts/check-px-text-core.mjs) — import the package by name instead.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×2
Modal dialog does not manage focus web/src/features/invite/ui/InvitePage.tsx:306— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus web/src/features/invite/ui/InvitePage.tsx:378— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
buzz_pair_relay::handle_conn (cyclomatic 41) crates/buzz-pair-relay/src/lib.rs:622— buzz_pair_relay::handle_conn has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buzz_pair_relay::validate_nip44_content (cyclomatic 16) crates/buzz-pair-relay/src/lib.rs:345— buzz_pair_relay::validate_nip44_content 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.
RunCtx::run (cyclomatic 38) crates/buzz-agent/src/agent.rs:318— RunCtx::run has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RunCtx::execute_parallel (cyclomatic 21) crates/buzz-agent/src/agent.rs:909— RunCtx::execute_parallel has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_deletion::execute_stage (cyclomatic 19) crates/buzz-deletion/src/lib.rs:1431— buzz_deletion::execute_stage has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_deletion::prepare_owner_claim_with (cyclomatic 16) crates/buzz-deletion/src/lib.rs:1087— buzz_deletion::prepare_owner_claim_with has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
encryptedBackup.encryptedBackupReducer (cyclomatic 16) desktop/src/features/onboarding/lib/encryptedBackup.ts:35— encryptedBackup.encryptedBackupReducer 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.
encryptedBackup.encryptedBackupReducer (cyclomatic 16) desktop/src/features/settings/lib/encryptedBackup.ts:34— encryptedBackup.encryptedBackupReducer 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.
Races the wall clock: shows a large elapsed for a turn that started well in the past desktop/src/features/agents/activeAgentTurnsStore.test.mjs:1126— This test reads `Date.now()` and compares it against the value the code under test computed from its own clock read, compared exactly in `assert.equal(Date.now() - summary.anchorAt, 5 * 60_000 - 1_000, " ",)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
Races the wall clock: resurrects a pruned turn at startedAt from the first recovered ACP frame desktop/src/features/agents/activeAgentTurnsStore.test.mjs:1265— This test reads `Date.now()` and compares it against the value the code under test computed from its own clock read, compared exactly in `assert.equal(Date.now() - resurrected.anchorAt, 45_000, " ",)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
buzz_pair_relay::handle_conn (cognitive 106) crates/buzz-pair-relay/src/lib.rs:622— buzz_pair_relay::handle_conn has cognitive complexity 106 (threshold 15). Drivers by points: if/else 16 (60 pts), match/switch 13 (44 pts), boolean chains 1, loops 1 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_pair_relay::validate_nip44_content (cognitive 17) crates/buzz-pair-relay/src/lib.rs:345— buzz_pair_relay::validate_nip44_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowEngine::run (cognitive 60) crates/buzz-workflow/src/lib.rs:490— WorkflowEngine::run has cognitive complexity 60 (threshold 15). Drivers by points: match/switch 10 (34 pts), if/else 7 (23 pts), loops 2 (3 pts) (nesting depth added 41). 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.
WorkflowEngine::on_event (cognitive 17) crates/buzz-workflow/src/lib.rs:321— WorkflowEngine::on_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PkceOAuthTokenSource::acquire_locked (cognitive 34) crates/buzz-agent/src/auth.rs:1090— PkceOAuthTokenSource::acquire_locked has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 4 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PkceOAuthTokenSource::acquire (cognitive 17) crates/buzz-agent/src/auth.rs:853— PkceOAuthTokenSource::acquire has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpRegistry::call_hooks (cognitive 26) crates/buzz-agent/src/mcp.rs:345— McpRegistry::call_hooks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpRegistry::spawn_all (cognitive 22) crates/buzz-agent/src/mcp.rs:202— McpRegistry::spawn_all has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_auth::nip_fi::startup::validate_nip_fi_config (cognitive 19) crates/buzz-auth/src/nip_fi/startup/mod.rs:107— buzz_auth::nip_fi::startup::validate_nip_fi_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_auth::nip98::verify_nip98_event (cognitive 17) crates/buzz-auth/src/nip98.rs:55— buzz_auth::nip98::verify_nip98_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 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.
buzz_pairing_cli::cmd_target (cognitive 16) crates/buzz-pairing-cli/src/main.rs:211— buzz_pairing_cli::cmd_target has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (5 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buzz_pairing_cli::wait_for_eose (cognitive 16) crates/buzz-pairing-cli/src/main.rs:537— buzz_pairing_cli::wait_for_eose has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TooManyFunctions: buzz_desktop::managed_agents::storage desktop/src-tauri/src/managed_agents/storage.rs:18— TooManyFunctions — 50 free functions. The bar is 30 free functions; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: buzz_desktop::events desktop/src-tauri/src/events.rs:33— TooManyFunctions — 43 free functions. The bar is 30 free functions; 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.
Near-duplicate member pair (25 shared lines) crates/buzz-acp/src/filter.rs:264— crates/buzz-acp/src/filter.rs:264-334 | crates/buzz-workflow/src/executor.rs:232-328 — These two members are variants of one another: 25 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (25 shared lines) crates/buzz-voice/src/pocket_april.rs:631— crates/buzz-voice/src/pocket_april.rs:631-667 | crates/buzz-voice/src/pocket_april.rs:920-958 — These two members are variants of one another: 25 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) desktop/src-tauri/src/commands/agent_config.rs:260— desktop/src-tauri/src/commands/agent_config.rs:260-329 | desktop/src-tauri/src/commands/agent_models.rs:40-155 | desktop/src-tauri/src/commands/agent_models_update.rs:147-477 | desktop/src-tauri/src/commands/agents.rs:404-882 | desktop/src-tauri/src/commands/agents.rs:893-1068 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) mobile/lib/shared/widgets/ios_glass_navigation_action.dart:43— mobile/lib/shared/widgets/ios_glass_navigation_action.dart:43-107 | mobile/lib/shared/widgets/ios_glass_navigation_button.dart:109-316 | mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:39-113 | mobile/lib/shared/widgets/ios_native_segmented_control.dart:35-85 | mobile/lib/shared/widgets/ios_native_skin_tone_control.dart:35-77 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (40 lines × 2) desktop/src-tauri/src/commands/personas/snapshot/import.rs:834— desktop/src-tauri/src/commands/personas/snapshot/import.rs:834-873 | desktop/src-tauri/src/commands/team_snapshot.rs:935-974 — before extracting anything, compare `desktop/src-tauri/src/commands/personas/snapshot/import.rs` and `desktop/src-tauri/src/commands/team_snapshot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (40 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:340— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:340-379 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:340-379 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (35–36 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:334— crates/buzz-relay/src/handlers/command_executor.rs:334-369 | crates/buzz-relay/src/handlers/command_executor.rs:496-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (35–36 lines × 2) crates/buzz-relay/src/handlers/count.rs:254— crates/buzz-relay/src/handlers/count.rs:254-288 | crates/buzz-relay/src/handlers/count.rs:340-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) crates/buzz-acp/src/acp.rs:1337— crates/buzz-acp/src/acp.rs:1337-1362 | crates/buzz-acp/src/acp.rs:1785-1810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:354— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:354-379 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:319-344 — before extracting anything, compare `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) crates/buzz-acp/src/relay.rs:3785— crates/buzz-acp/src/relay.rs:3785-3807 | crates/buzz-ws-client/src/message.rs:120-142 — before extracting anything, compare `crates/buzz-acp/src/relay.rs` and `crates/buzz-ws-client/src/message.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) desktop/src-tauri/src/archive/store.rs:637— desktop/src-tauri/src/archive/store.rs:637-661 | desktop/src-tauri/src/archive/store.rs:796-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:705— crates/buzz-db/src/store/relay_admin_actions.rs:705-725 | crates/buzz-db/src/store/relay_admin_actions.rs:1696-1717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:2400— crates/buzz-relay/src/handlers/side_effects.rs:2400-2421 | crates/buzz-relay/src/handlers/side_effects.rs:2424-2444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 3) crates/buzz-db/src/store/feed.rs:372— crates/buzz-db/src/store/feed.rs:372-392 | crates/buzz-db/src/store/feed.rs:463-483 | crates/buzz-db/src/store/feed.rs:545-564 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20–21 lines × 3) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:311— desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:311-330 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:195-215 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:347-366 — before extracting anything, compare `desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs` and `desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–19 lines × 2) crates/buzz-db/src/store/relay_invite.rs:368— crates/buzz-db/src/store/relay_invite.rs:368-386 | crates/buzz-db/src/store/relay_members.rs:217-233 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17–19 lines × 2) crates/buzz-pairing-cli/src/main.rs:137— crates/buzz-pairing-cli/src/main.rs:137-153 | crates/buzz-pairing-cli/src/main.rs:239-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 3) crates/buzz-acp/src/pool.rs:3474— crates/buzz-acp/src/pool.rs:3474-3489 | crates/buzz-acp/src/pool.rs:3533-3549 | crates/buzz-acp/src/pool.rs:3587-3603 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–17 lines × 3) desktop/src-tauri/src/commands/messages.rs:121— desktop/src-tauri/src/commands/messages.rs:121-137 | desktop/src-tauri/src/commands/messages/forum.rs:174-189 | desktop/src-tauri/src/commands/messages/forum.rs:229-244 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (15–16 lines × 3) crates/buzz-relay/src/audio/handler.rs:1929— crates/buzz-relay/src/audio/handler.rs:1929-1943 | crates/buzz-relay/src/audio/handler.rs:1958-1973 | crates/buzz-relay/src/audio/handler.rs:1987-2001 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–16 lines × 3) desktop/src-tauri/src/commands/project_git_diff.rs:54— desktop/src-tauri/src/commands/project_git_diff.rs:54-68 | desktop/src-tauri/src/commands/project_git_diff.rs:70-84 | desktop/src-tauri/src/commands/project_git_diff.rs:86-101 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) crates/buzz-db/src/store/moderation.rs:335— crates/buzz-db/src/store/moderation.rs:335-346 | crates/buzz-db/src/store/reaction.rs:270-282 | crates/buzz-db/src/store/reaction.rs:392-403 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12–13 lines × 3) crates/buzz-relay/src/audio/room.rs:360— crates/buzz-relay/src/audio/room.rs:360-372 | crates/buzz-relay/src/audio/room.rs:426-438 | crates/buzz-relay/src/audio/room.rs:651-662 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–13 lines × 2) crates/git-sign-nostr/src/lib.rs:221— crates/git-sign-nostr/src/lib.rs:221-233 | crates/git-sign-nostr/src/lib.rs:243-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–13 lines × 2) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:530— mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:530-538 | mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:578-590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 4) desktop/src-tauri/src/huddle/tts.rs:541— desktop/src-tauri/src/huddle/tts.rs:541-552 | desktop/src-tauri/src/huddle/tts.rs:606-617 | desktop/src-tauri/src/huddle/tts.rs:754-765 | desktop/src-tauri/src/huddle/tts.rs:834-845 — 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 × 4) desktop/src-tauri/src/migration.rs:1210— desktop/src-tauri/src/migration.rs:1210-1221 | desktop/src-tauri/src/migration.rs:1240-1251 | desktop/src-tauri/src/migration.rs:1348-1359 | desktop/src-tauri/src/migration/materialize.rs:25-36 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11–12 lines × 2) crates/buzz-cli/src/commands/channels.rs:713— crates/buzz-cli/src/commands/channels.rs:713-724 | crates/buzz-cli/src/commands/channels.rs:1500-1510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:143— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:143-153 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:149-160 — before extracting anything, compare `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–12 lines × 2) crates/buzz-pairing-cli/src/main.rs:167— crates/buzz-pairing-cli/src/main.rs:167-178 | crates/buzz-pairing-cli/src/main.rs:298-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) desktop/src-tauri/src/archive/store.rs:669— desktop/src-tauri/src/archive/store.rs:669-680 | desktop/src-tauri/src/archive/store.rs:822-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/buzz-pair-relay/src/lib.rs:392— crates/buzz-pair-relay/src/lib.rs:392-401 | crates/buzz-relay/src/handlers/ingest.rs:2097-2107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–11 lines × 2) crates/buzz-relay/src/handlers/imeta.rs:401— crates/buzz-relay/src/handlers/imeta.rs:401-411 | desktop/src-tauri/src/link_preview_tags.rs:31-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8–10 lines × 2) crates/buzz-relay/src/api/invites.rs:461— crates/buzz-relay/src/api/invites.rs:461-468 | crates/buzz-relay/src/api/invites.rs:538-547 — both copies are in the same file, so extract the block into 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) desktop/src-tauri/src/huddle/playout.rs:544— desktop/src-tauri/src/huddle/playout.rs:544-553 | desktop/src-tauri/src/huddle/playout.rs:583-590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) crates/buzz-db/src/store/operator_listener.rs:70— crates/buzz-db/src/store/operator_listener.rs:70-76 | desktop/src-tauri/src/huddle/relay_api.rs:477-482 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6–7 lines × 2) crates/buzz-db/src/store/push.rs:745— crates/buzz-db/src/store/push.rs:745-750 | crates/buzz-db/src/store/push.rs:768-774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 4) crates/buzz-cli/src/commands/dms.rs:15— crates/buzz-cli/src/commands/dms.rs:15-20 | crates/buzz-cli/src/commands/users.rs:474-479 | crates/buzz-cli/src/commands/workflows.rs:18-23 | crates/buzz-cli/src/commands/workflows.rs:77-82 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) crates/buzz-cli/src/commands/reactions.rs:82— crates/buzz-cli/src/commands/reactions.rs:82-87 | crates/buzz-cli/src/commands/workflows.rs:15-20 | crates/buzz-cli/src/commands/workflows.rs:40-45 | crates/buzz-cli/src/commands/workflows.rs:129-134 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) crates/buzz-cli/src/commands/issues.rs:480— crates/buzz-cli/src/commands/issues.rs:480-489 | crates/buzz-cli/src/commands/patches.rs:75-84 | crates/buzz-cli/src/commands/pr.rs:116-125 — before extracting anything, compare `crates/buzz-cli/src/commands/issues.rs` and `crates/buzz-cli/src/commands/patches.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/buzz-relay/src/handlers/ingest.rs:1608— crates/buzz-relay/src/handlers/ingest.rs:1608-1617 | crates/buzz-relay/src/handlers/ingest.rs:2153-2165 | crates/buzz-relay/src/handlers/ingest.rs:2171-2180 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 4) crates/buzz-db/src/store/feed.rs:137— crates/buzz-db/src/store/feed.rs:137-152 | crates/buzz-db/src/store/feed.rs:226-241 | crates/buzz-db/src/store/thread.rs:274-289 | crates/buzz-db/src/store/thread.rs:548-563 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (16 lines × 4) crates/buzz-db/src/store/archived_identities.rs:67— crates/buzz-db/src/store/archived_identities.rs:67-82 | crates/buzz-db/src/store/thread.rs:134-155 | crates/buzz-db/src/store/workflow.rs:338-362 | crates/buzz-db/src/store/workflow.rs:599-618 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (16 lines × 3) crates/buzz-db/src/store/moderation.rs:442— crates/buzz-db/src/store/moderation.rs:442-459 | crates/buzz-db/src/store/moderation.rs:499-514 | crates/buzz-db/src/store/relay_admin_actions.rs:335-350 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (16 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:164— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:164-179 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:191-206 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:164-179 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 6) crates/buzz-db/src/store/event.rs:2825— crates/buzz-db/src/store/event.rs:2825-2837 | crates/buzz-db/src/store/git_repo.rs:192-203 | crates/buzz-db/src/store/moderation.rs:399-415 | crates/buzz-db/src/store/moderation.rs:586-601 | crates/buzz-db/src/store/push.rs:1261-1273 | crates/buzz-db/src/store/push.rs:1317-1329 — before extracting anything, compare `crates/buzz-db/src/store/git_repo.rs` and `crates/buzz-db/src/store/moderation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 6) mobile/ios/Runner/JumpToLatestGlassButton.swift:16— mobile/ios/Runner/JumpToLatestGlassButton.swift:16-27 | mobile/ios/Runner/JumpToLatestGlassButton.swift:151-162 | mobile/ios/Runner/JumpToLatestGlassButton.swift:519-530 | mobile/ios/Runner/NativeSkinToneControl.swift:16-27 | mobile/ios/Runner/StickyDateGlassHeader.swift:23-34 | mobile/ios/Runner/ThemePaginationGlassControl.swift:16-27 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13 lines × 3) REDACTED:285— REDACTED:285-299 | REDACTED:356-368 | REDACTED:391-403 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) desktop/src-tauri/src/commands/agents_pending.rs:158— desktop/src-tauri/src/commands/agents_pending.rs:158-170 | desktop/src-tauri/src/commands/personas/pending.rs:288-300 | desktop/src-tauri/src/commands/teams/mod.rs:389-401 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (22–23 lines × 2) mobile/ios/Runner/AppDelegate.swift:757— mobile/ios/Runner/AppDelegate.swift:757-779 | mobile/ios/Runner/AppDelegate.swift:802-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/Runner/AppDelegate.swift:757` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 2) mobile/ios/Runner/InlinePhotoPicker.swift:148— mobile/ios/Runner/InlinePhotoPicker.swift:148-169 | mobile/ios/Runner/NativeAttachmentPopover.swift:596-618 — before extracting anything, compare `mobile/ios/Runner/InlinePhotoPicker.swift` and `mobile/ios/Runner/NativeAttachmentPopover.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `mobile/ios/Runner/InlinePhotoPicker.swift:148` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:242— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:242-266 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:242-266 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_stars/channel_stars_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 226 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (25 lines × 2) mobile/lib/features/forum/forum_post_card.dart:139— mobile/lib/features/forum/forum_post_card.dart:139-163 | mobile/lib/features/forum/forum_thread_page.dart:400-424 — before extracting anything, compare `mobile/lib/features/forum/forum_post_card.dart` and `mobile/lib/features/forum/forum_thread_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) mobile/lib/shared/widgets/ios_glass_navigation_action.dart:59— mobile/lib/shared/widgets/ios_glass_navigation_action.dart:59-66 | mobile/lib/shared/widgets/ios_glass_navigation_button.dart:128-136 | mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:57-65 | mobile/lib/shared/widgets/ios_native_segmented_control.dart:51-58 — before extracting anything, compare `mobile/lib/shared/widgets/ios_glass_navigation_action.dart` and `mobile/lib/shared/widgets/ios_glass_navigation_button.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:95— mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:95-102 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:113-120 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:105-112 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:95-102 — `mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_provider.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
R10 · Code Duplication· Duplicated block with local edits (92 matched lines × 2 locations) · ×2
Duplicated block with local edits (92 matched lines × 2 locations) desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89— desktop/src/features/agents/ui/AgentSnapshotExportDialog.tsx:89 · desktop/src/features/agents/ui/TeamSnapshotExportDialog.tsx:72 — the two spans are one implementation copied and then locally edited — 401 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (92 matched lines × 2 locations) desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141— desktop/src/features/channels/ui/WelcomeComposerBanner.tsx:141 · desktop/src/features/search/ui/SearchPromptPlaceholder.tsx:62 — the two spans are one implementation copied and then locally edited — 526 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (65 matched lines × 2 locations) · ×2
Duplicated block with local edits (65 matched lines × 2 locations) desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76— desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:76 · desktop/src/features/projects/ui/ProjectsAgentPromptPage.tsx:427 — the two spans are one implementation copied and then locally edited — 284 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (65 matched lines × 2 locations) desktop/src/shared/ui/rich-link-preview-attachment.tsx:168— desktop/src/shared/ui/rich-link-preview-attachment.tsx:168 · desktop/src/shared/ui/rich-link-preview-attachment.tsx:267 — the two spans are one implementation copied and then locally edited — 282 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Dead file (~98 LoC) desktop/src/features/channels/ui/QuickBotBar.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~98 LoC) desktop/src/features/home/ui/RecentNotesSection.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~56 LoC) desktop/src/features/sidebar/data/sidebarData.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~56 LoC) desktop/src/shared/ui/step-progress.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~45 LoC) desktop/src/features/channels/ui/AddChannelBotReuseGuard.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~45 LoC) desktop/src/features/projects/lib/projectLanguages.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~23 LoC) desktop/src/features/profile/ui/ProfileAvatarUploadPreview.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~23 LoC) desktop/src/features/projects/ui/ProjectsWorkItemTable.tsx— no import path from any entry point (80 application, 32 tooling, 943 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
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×2
Recursive walk over a caller-supplied document has no depth cap desktop/src/features/sidebar/lib/sidebarLwwMap.ts:187— `validTree` is exported and takes `node: unknown` from its caller, and it calls itself at line 187 (`validTree`) with a piece of `node` — and nowhere in `validTree` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `validTree` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap desktop/src/features/sidebar/lib/sidebarLwwMap.ts:195— `canonical` is exported and takes `value: unknown` from its caller, and it calls itself at line 195 (`canonical`) with a piece of `value` (and at line 200) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×2
Untrusted text written into markup unescaped REDACTED:64— `escapeHtml(attachment.url)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped REDACTED:31— `svgHtml` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — your Biome config enables no a11y rules and there's no axe/pa11y/Lighthouse in tests or CI. Start by turning on Biome's own a11y rule group to catch issues at author time. What was searched, so you can tell an absence from a miss: the 744 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
_MessageList.build (cyclomatic 203) mobile/lib/features/channels/channel_detail_page/message_list.dart:50— _MessageList.build has cyclomatic complexity 203 (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.
AgentConfigFields.AgentConfigFields (cyclomatic 170) desktop/src/features/agents/ui/AgentConfigFields.tsx:212— AgentConfigFields.AgentConfigFields has cyclomatic complexity 170 (threshold 15). Of this number, 108 points are the body's own statements and 62 belong to 17 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.
AnimatedAvatarCapture.AnimatedAvatarCapture (cyclomatic 162) desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:71— AnimatedAvatarCapture.AnimatedAvatarCapture has cyclomatic complexity 162 (threshold 15). Of this number, 98 points are the body's own statements and 64 belong to 19 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ThreadDetailPage.build (cyclomatic 152) mobile/lib/features/channels/thread_detail_page.dart:110— ThreadDetailPage.build has cyclomatic complexity 152 (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.
ProfileAvatarEditor.ProfileAvatarEditor (cyclomatic 148) desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:67— ProfileAvatarEditor.ProfileAvatarEditor has cyclomatic complexity 148 (threshold 15). Of this number, 85 points are the body's own statements and 63 belong to 26 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserProfilePanel.UserProfilePanel (cyclomatic 148) desktop/src/features/profile/ui/UserProfilePanel.tsx:105— UserProfilePanel.UserProfilePanel has cyclomatic complexity 148 (threshold 15). Of this number, 93 points are the body's own statements and 55 belong to 22 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentCreationPreview.AgentCreationPreview (cyclomatic 138) desktop/src/features/agents/ui/AgentCreationPreview.tsx:47— AgentCreationPreview.AgentCreationPreview has cyclomatic complexity 138 (threshold 15). Of this number, 85 points are the body's own statements and 53 belong to 18 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.
ChannelPane.ChannelPane (cyclomatic 128) desktop/src/features/channels/ui/ChannelPane.tsx:78— ChannelPane.ChannelPane has cyclomatic complexity 128 (threshold 15). Of this number, 97 points are the body's own statements and 31 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentDefinitionDialog.AgentDefinitionDialog (cyclomatic 124) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128— AgentDefinitionDialog.AgentDefinitionDialog has cyclomatic complexity 124 (threshold 15). Of this number, 65 points are the body's own statements and 59 belong to 14 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.
TerminalSubstrate.TerminalSubstrate (cyclomatic 123) desktop/src/features/terminal/TerminalSubstrate.tsx:80— TerminalSubstrate.TerminalSubstrate has cyclomatic complexity 123 (threshold 15). Most of this is not in the body itself: 10 of the 123 points are its own statements and the rest belongs to 39 function items inside it that branch (a function literal at line 398, a function literal at line 685, a function literal at line 190, …). 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.
_ResolvedChannelDetailPage.build (cyclomatic 116) mobile/lib/features/channels/channel_detail_page.dart:285— _ResolvedChannelDetailPage.build has cyclomatic complexity 116 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ImageAvatarCapture.build (cyclomatic 114) mobile/lib/features/profile/image_avatar_capture.dart:84— ImageAvatarCapture.build has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComposeBar.build (cyclomatic 113) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:33— ComposeBar.build has cyclomatic complexity 113 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ForumComposer.ForumComposerVisit (cyclomatic 112) desktop/src/features/forum/ui/ForumComposer.tsx:52— ForumComposer.ForumComposerVisit has cyclomatic complexity 112 (threshold 15). Of this number, 39 points are the body's own statements and 73 belong to 21 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
markdown.ImageZoomOverlay (cyclomatic 112) desktop/src/shared/ui/markdown.tsx:149— markdown.ImageZoomOverlay has cyclomatic complexity 112 (threshold 15). Of this number, 49 points are the body's own statements and 63 belong to 24 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MessageComposer.MessageComposerImpl (cyclomatic 109) desktop/src/features/messages/ui/MessageComposer.tsx:70— MessageComposer.MessageComposerImpl has cyclomatic complexity 109 (threshold 15). Of this number, 42 points are the body's own statements and 67 belong to 17 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MessageTimeline.MessageTimelineBase (cyclomatic 109) desktop/src/features/messages/ui/MessageTimeline.tsx:162— MessageTimeline.MessageTimelineBase has cyclomatic complexity 109 (threshold 15). Of this number, 75 points are the body's own statements and 34 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HostedCommunityOnboarding.HostedCommunityOnboarding (cyclomatic 103) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:76— HostedCommunityOnboarding.HostedCommunityOnboarding has cyclomatic complexity 103 (threshold 15). Of this number, 54 points are the body's own statements and 49 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.
HuddleBar.HuddleBar (cyclomatic 103) desktop/src/features/huddle/components/HuddleBar.tsx:150— HuddleBar.HuddleBar has cyclomatic complexity 103 (threshold 15). Of this number, 34 points are the body's own statements and 69 belong to 28 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.
NostrKeyImportForm.NostrKeyImportForm (cyclomatic 100) desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:60— NostrKeyImportForm.NostrKeyImportForm has cyclomatic complexity 100 (threshold 15). Of this number, 67 points are the body's own statements and 33 belong to 17 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowDialog.WorkflowDialog (cyclomatic 96) desktop/src/features/workflows/ui/WorkflowDialog.tsx:216— WorkflowDialog.WorkflowDialog has cyclomatic complexity 96 (threshold 15). Of this number, 43 points are the body's own statements and 53 belong to 20 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.
MembersSidebar.MembersSidebar (cyclomatic 95) desktop/src/features/channels/ui/MembersSidebar.tsx:138— MembersSidebar.MembersSidebar has cyclomatic complexity 95 (threshold 15). Of this number, 38 points are the body's own statements and 57 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommunityOnboardingFlow.CommunityOnboardingFlow (cyclomatic 93) desktop/src/features/onboarding/ui/CommunityOnboardingFlow.tsx:157— CommunityOnboardingFlow.CommunityOnboardingFlow has cyclomatic complexity 93 (threshold 15). Of this number, 44 points are the body's own statements and 49 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.
MessageThreadPanel.MessageThreadPanel (cyclomatic 91) desktop/src/features/messages/ui/MessageThreadPanel.tsx:145— MessageThreadPanel.MessageThreadPanel has cyclomatic complexity 91 (threshold 15). Of this number, 41 points are the body's own statements and 50 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HuddleContext.HuddleProvider (cyclomatic 89) desktop/src/features/huddle/HuddleContext.tsx:65— HuddleContext.HuddleProvider has cyclomatic complexity 89 (threshold 15). Most of this is not in the body itself: 10 of the 89 points are its own statements and the rest belongs to 35 function literals inside it that branch (lines 832, 626, 706, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HomeView.HomeView (cyclomatic 87) desktop/src/features/home/ui/HomeView.tsx:101— HomeView.HomeView has cyclomatic complexity 87 (threshold 15). Of this number, 43 points are the body's own statements and 44 belong to 22 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InviteRedeemForm.InviteRedeemForm (cyclomatic 87) desktop/src/features/onboarding/ui/InviteRedeemForm.tsx:63— InviteRedeemForm.InviteRedeemForm has cyclomatic complexity 87 (threshold 15). Of this number, 48 points are the body's own statements and 39 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VideoPlayer.VideoReviewDialog (cyclomatic 87) desktop/src/shared/ui/VideoPlayer.tsx:1198— VideoPlayer.VideoReviewDialog has cyclomatic complexity 87 (threshold 15). Of this number, 36 points are the body's own statements and 51 belong to 20 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnimatedAvatarCapture.build (cyclomatic 86) mobile/lib/features/profile/animated_avatar_capture.dart:68— AnimatedAvatarCapture.build has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useObservedUnreadPersistence.useObservedUnreadPersistence (cyclomatic 86) desktop/src/features/channels/useObservedUnreadPersistence.ts:78— useObservedUnreadPersistence.useObservedUnreadPersistence has cyclomatic complexity 86 (threshold 15). Most of this is not in the body itself: 1 of the 86 points is its own statement and the rest belongs to 27 function literals inside it that branch (lines 147, 379, 285, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectDetailScreen.ProjectDetailScreen (cyclomatic 86) desktop/src/features/projects/ui/ProjectDetailScreen.tsx:87— ProjectDetailScreen.ProjectDetailScreen has cyclomatic complexity 86 (threshold 15). Of this number, 49 points are the body's own statements and 37 belong to 16 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MessageRow.MessageRow (cyclomatic 85) desktop/src/features/messages/ui/MessageRow.tsx:72— MessageRow.MessageRow has cyclomatic complexity 85 (threshold 15). Of this number, 65 points are the body's own statements and 20 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cyclomatic 85) desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:70— HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard has cyclomatic complexity 85 (threshold 15). Of this number, 39 points are the body's own statements and 46 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProfileSettingsCard.ProfileSettingsCard (cyclomatic 85) desktop/src/features/settings/ui/ProfileSettingsCard.tsx:135— ProfileSettingsCard.ProfileSettingsCard has cyclomatic complexity 85 (threshold 15). Of this number, 50 points are the body's own statements and 35 belong to 18 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NostrBindConsentDialog.NostrBindConsentDialog (cyclomatic 84) desktop/src/features/profile/ui/NostrBindConsentDialog.tsx:213— NostrBindConsentDialog.NostrBindConsentDialog has cyclomatic complexity 84 (threshold 15). Of this number, 24 points are the body's own statements and 60 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserProfilePanelSections.ProfileSummaryView (cyclomatic 83) desktop/src/features/profile/ui/UserProfilePanelSections.tsx:136— UserProfilePanelSections.ProfileSummaryView has cyclomatic complexity 83 (threshold 15). Of this number, 66 points are the body's own statements and 17 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowFormBuilder.WorkflowFormBuilder (cyclomatic 83) desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx:357— WorkflowFormBuilder.WorkflowFormBuilder has cyclomatic complexity 83 (threshold 15). Of this number, 31 points are the body's own statements and 52 belong to 18 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelDetailsPage.build (cyclomatic 82) mobile/lib/features/channels/channel_details_page.dart:41— ChannelDetailsPage.build has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useMentionSendFlow.useMentionSendFlow.completeSend (cyclomatic 82) desktop/src/features/messages/ui/useMentionSendFlow.ts:284— useMentionSendFlow.useMentionSendFlow.completeSend has cyclomatic complexity 82 (threshold 15). Of this number, 37 points are the body's own statements and 45 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CommunityCatalogDialog.CommunityCatalogDialog (cyclomatic 81) desktop/src/features/agents/ui/CommunityCatalogDialog.tsx:101— CommunityCatalogDialog.CommunityCatalogDialog has cyclomatic complexity 81 (threshold 15). Of this number, 37 points are the body's own statements and 44 belong to 20 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.
EncryptedBackupCreator.EncryptedBackupCreator (cyclomatic 80) desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:361— EncryptedBackupCreator.EncryptedBackupCreator has cyclomatic complexity 80 (threshold 15). Of this number, 40 points are the body's own statements and 40 belong to 15 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentsView.AgentsView (cyclomatic 79) desktop/src/features/agents/ui/AgentsView.tsx:40— AgentsView.AgentsView has cyclomatic complexity 79 (threshold 15). Of this number, 48 points are the body's own statements and 31 belong to 26 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.
ChannelBrowserDialog.ChannelBrowserDialog (cyclomatic 74) desktop/src/features/channels/ui/ChannelBrowserDialog.tsx:102— ChannelBrowserDialog.ChannelBrowserDialog has cyclomatic complexity 74 (threshold 15). Of this number, 29 points are the body's own statements and 45 belong to 18 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.
AudioMessageAttachment.AudioMessageAttachment (cyclomatic 74) desktop/src/features/messages/ui/AudioMessageAttachment.tsx:111— AudioMessageAttachment.AudioMessageAttachment has cyclomatic complexity 74 (threshold 15). Of this number, 26 points are the body's own statements and 48 belong to 27 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProfileEditPage.build (cyclomatic 73) mobile/lib/features/profile/profile_edit_page.dart:51— ProfileEditPage.build has cyclomatic complexity 73 (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.
useMediaUpload.useMediaUpload (cyclomatic 72) desktop/src/features/messages/lib/useMediaUpload.ts:161— useMediaUpload.useMediaUpload has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 3 of the 72 points are its own statements and the rest belongs to 41 function literals inside it that branch (lines 626, 283, 322, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkflowMessagePicker.WorkflowMessagePicker (cyclomatic 72) desktop/src/features/workflows/ui/WorkflowMessagePicker.tsx:46— WorkflowMessagePicker.WorkflowMessagePicker has cyclomatic complexity 72 (threshold 15). Of this number, 34 points are the body's own statements and 38 belong to 17 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InboxDetailPane.InboxMessageDetailPane (cyclomatic 71) desktop/src/features/home/ui/InboxDetailPane.tsx:166— InboxDetailPane.InboxMessageDetailPane has cyclomatic complexity 71 (threshold 15). Of this number, 49 points are the body's own statements and 22 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NewMessageScreen.NewMessageScreen (cyclomatic 71) desktop/src/features/messages/ui/NewMessageScreen.tsx:29— NewMessageScreen.NewMessageScreen has cyclomatic complexity 71 (threshold 15). Of this number, 19 points are the body's own statements and 52 belong to 14 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChannelsPage.build (cyclomatic 67) mobile/lib/features/channels/channels_page.dart:145— ChannelsPage.build has cyclomatic complexity 67 (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.
ChannelScreen.ChannelScreen (cyclomatic 66) desktop/src/features/channels/ui/ChannelScreen.tsx:90— ChannelScreen.ChannelScreen has cyclomatic complexity 66 (threshold 15). Of this number, 40 points are the body's own statements and 26 belong to 13 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HostedCommunityCreateFlow.HostedCommunityCreateFlow (cyclomatic 66) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:39— HostedCommunityCreateFlow.HostedCommunityCreateFlow has cyclomatic complexity 66 (threshold 15). Of this number, 33 points are the body's own statements and 33 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_PairingWelcomeView.build (cyclomatic 65) mobile/lib/features/pairing/pairing_page/pairing_welcome_view.dart:56— _PairingWelcomeView.build has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
agentSessionTranscript.processTranscriptEvent (cyclomatic 65) desktop/src/features/agents/ui/agentSessionTranscript.ts:700— agentSessionTranscript.processTranscriptEvent has cyclomatic complexity 65 (threshold 15). Of this number, 63 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserProfilePopover.UserProfilePopoverBody (cyclomatic 64) desktop/src/features/profile/ui/UserProfilePopover.tsx:257— UserProfilePopover.UserProfilePopoverBody has cyclomatic complexity 64 (threshold 15). Of this number, 63 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectsView.ProjectsView (cyclomatic 64) desktop/src/features/projects/ui/ProjectsView.tsx:111— ProjectsView.ProjectsView has cyclomatic complexity 64 (threshold 15). Of this number, 34 points are the body's own statements and 30 belong to 15 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProfileAvatarEditor.build (cyclomatic 62) mobile/lib/features/profile/profile_avatar_editor.dart:133— ProfileAvatarEditor.build has cyclomatic complexity 62 (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.
ChannelManagementSheet.ChannelManagementSheet (cyclomatic 62) desktop/src/features/channels/ui/ChannelManagementSheet.tsx:99— ChannelManagementSheet.ChannelManagementSheet has cyclomatic complexity 62 (threshold 15). Of this number, 43 points are the body's own statements and 19 belong to 8 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.
MentionAutocomplete.MentionAutocomplete (cyclomatic 62) desktop/src/features/messages/ui/MentionAutocomplete.tsx:71— MentionAutocomplete.MentionAutocomplete has cyclomatic complexity 62 (threshold 15). Most of this is not in the body itself: 7 of the 62 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 246, 109, 137, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useAnchoredScroll.useAnchoredScroll (cyclomatic 62) desktop/src/features/messages/ui/useAnchoredScroll.ts:150— useAnchoredScroll.useAnchoredScroll has cyclomatic complexity 62 (threshold 15). Most of this is not in the body itself: 2 of the 62 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 607, 880, 217, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectRepositoryActionsPanel.ProjectRepositoryActionsPanel (cyclomatic 62) desktop/src/features/projects/ui/ProjectRepositoryActionsPanel.tsx:139— ProjectRepositoryActionsPanel.ProjectRepositoryActionsPanel has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectWorkspaceTabs.WorkspaceTabs (cyclomatic 61) desktop/src/features/projects/ui/ProjectWorkspaceTabs.tsx:86— ProjectWorkspaceTabs.WorkspaceTabs has cyclomatic complexity 61 (threshold 15). Of this number, 50 points are the body's own statements and 11 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppSidebar.AppSidebar (cyclomatic 61) desktop/src/features/sidebar/ui/AppSidebar.tsx:80— AppSidebar.AppSidebar has cyclomatic complexity 61 (threshold 15). Of this number, 23 points are the body's own statements and 38 belong to 21 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HuddlePresenceTracker.apply (cyclomatic 60) desktop/src/features/huddle/lib/huddlePresence.ts:260— HuddlePresenceTracker.apply has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
workflowFormTypes.yamlToFormState (cyclomatic 59) desktop/src/features/workflows/ui/workflowFormTypes.ts:408— workflowFormTypes.yamlToFormState has cyclomatic complexity 59 (threshold 15). Of this number, 58 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HostedIdentityService._resolve (cyclomatic 58) mobile/lib/shared/hosted/hosted_identity_service.dart:49— HostedIdentityService._resolve has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MachineOnboardingFlow.MachineOnboardingFlow (cyclomatic 58) desktop/src/features/onboarding/ui/MachineOnboardingFlow.tsx:57— MachineOnboardingFlow.MachineOnboardingFlow has cyclomatic complexity 58 (threshold 15). Of this number, 42 points are the body's own statements and 16 belong to 10 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useRichTextEditor.useRichTextEditor (cyclomatic 56) desktop/src/features/messages/lib/useRichTextEditor.ts:145— useRichTextEditor.useRichTextEditor has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 1 of the 56 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 424, exitListIfEmptyLast, a function literal at line 281, …). 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.
VideoPlayer.VideoPlayer (cyclomatic 56) desktop/src/shared/ui/VideoPlayer.tsx:674— VideoPlayer.VideoPlayer has cyclomatic complexity 56 (threshold 15). Of this number, 19 points are the body's own statements and 37 belong to 18 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OnboardingAppEntry.build (cyclomatic 55) mobile/lib/onboarding_app_entry.dart:20— OnboardingAppEntry.build has cyclomatic complexity 55 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BeeRefreshIndicator.build (cyclomatic 55) mobile/lib/shared/widgets/bee_refresh_indicator.dart:57— BeeRefreshIndicator.build has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActivityPage.build (cyclomatic 54) mobile/lib/features/activity/activity_page.dart:75— ActivityPage.build has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_SystemMessageRow.build (cyclomatic 54) mobile/lib/features/channels/channel_detail_page/system_rows.dart:26— _SystemMessageRow.build has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IosNavigationBar.build (cyclomatic 54) mobile/lib/shared/widgets/ios_navigation_bar.dart:162— IosNavigationBar.build has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
formatTimelineMessages.formatTimelineMessages (cyclomatic 54) desktop/src/features/messages/lib/formatTimelineMessages.ts:217— formatTimelineMessages.formatTimelineMessages has cyclomatic complexity 54 (threshold 15). Of this number, 34 points are the body's own statements and 20 belong to 8 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.
welcomeKickoff.useWelcomeKickoff (cyclomatic 53) desktop/src/features/onboarding/welcomeKickoff.ts:494— welcomeKickoff.useWelcomeKickoff has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 5 of the 53 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 576, 725, 560, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ManageChannelSheet.build (cyclomatic 52) mobile/lib/features/channels/manage_channel_sheet.dart:218— ManageChannelSheet.build has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectPullRequestsPanel.ProjectPullRequestDetail (cyclomatic 52) desktop/src/features/projects/ui/ProjectPullRequestsPanel.tsx:400— ProjectPullRequestsPanel.ProjectPullRequestDetail has cyclomatic complexity 52 (threshold 15). Of this number, 21 points are the body's own statements and 31 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelsNotifier._fetchChannels (cyclomatic 51) mobile/lib/features/channels/channels_provider.dart:258— ChannelsNotifier._fetchChannels has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TerminalBootstrap.TerminalBootstrap (cyclomatic 51) desktop/src/features/terminal/TerminalBootstrap.tsx:50— TerminalBootstrap.TerminalBootstrap has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 8 of the 51 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 147, 283, 103, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HostedAppGate.build (cyclomatic 50) mobile/lib/hosted_app_gate.dart:31— HostedAppGate.build has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useLiveChannelUpdates.useLiveChannelUpdates (cyclomatic 50) desktop/src/features/channels/useLiveChannelUpdates.ts:151— useLiveChannelUpdates.useLiveChannelUpdates has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 2 of the 50 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 245, 209, 390, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BackupStep.BackupStep (cyclomatic 50) desktop/src/features/onboarding/ui/BackupStep.tsx:72— BackupStep.BackupStep has cyclomatic complexity 50 (threshold 15). Of this number, 36 points are the body's own statements and 14 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowTriggerConditions.WorkflowTriggerConditions (cyclomatic 50) desktop/src/features/workflows/ui/WorkflowTriggerConditions.tsx:130— WorkflowTriggerConditions.WorkflowTriggerConditions has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 8 of the 50 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 275, a function literal at line 177, a function literal at line 154, …). 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.
useUnreadChannels.useUnreadChannels (cyclomatic 49) desktop/src/features/channels/useUnreadChannels.ts:126— useUnreadChannels.useUnreadChannels has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 3 of the 49 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 677, 267, 225, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HuddleIndicator.HuddleIndicator (cyclomatic 49) desktop/src/features/huddle/components/HuddleIndicator.tsx:47— HuddleIndicator.HuddleIndicator has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 12 of the 49 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 79, a function literal at line 220, doJoin, …). 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.
TimelineMessageList.VirtualizedTimelineRows (cyclomatic 49) desktop/src/features/messages/ui/TimelineMessageList.tsx:430— TimelineMessageList.VirtualizedTimelineRows has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 3 of the 49 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 504, 637, 720, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddChannelMembersSheet.build (cyclomatic 48) mobile/lib/features/channels/add_members_sheet.dart:77— AddChannelMembersSheet.build has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MessageContent.build (cyclomatic 48) mobile/lib/features/channels/message_content.dart:198— MessageContent.build has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectConversationPanel.ProjectConversationPanel (cyclomatic 48) desktop/src/features/projects/ui/ProjectConversationPanel.tsx:37— ProjectConversationPanel.ProjectConversationPanel has cyclomatic complexity 48 (threshold 15). Of this number, 42 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CommunitySwitcherPage.build (cyclomatic 47) mobile/lib/features/channels/channels_page/community_switcher.dart:90— CommunitySwitcherPage.build has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
App.CommunityApp (cyclomatic 47) desktop/src/app/App.tsx:362— App.CommunityApp has cyclomatic complexity 47 (threshold 15). Of this number, 26 points are the body's own statements and 21 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PullRequestReviewersRow.PullRequestReviewersRow (cyclomatic 47) desktop/src/features/projects/ui/PullRequestReviewersRow.tsx:60— PullRequestReviewersRow.PullRequestReviewersRow has cyclomatic complexity 47 (threshold 15). Of this number, 24 points are the body's own statements and 23 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HuddleControlAcceptor::serve_control_loop (cyclomatic 46) crates/buzz-relay/src/audio/join.rs:1302— HuddleControlAcceptor::serve_control_loop has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HostedFlow._continue (cyclomatic 46) mobile/lib/shared/hosted/hosted_flow.dart:450— HostedFlow._continue has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MobilePairingCard.MobilePairingCard (cyclomatic 46) desktop/src/features/settings/ui/MobilePairingCard.tsx:264— MobilePairingCard.MobilePairingCard has cyclomatic complexity 46 (threshold 15). Of this number, 21 points are the body's own statements and 25 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_MessageBubble.build (cyclomatic 45) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40— _MessageBubble.build has cyclomatic complexity 45 (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.
MediaImageViewerPage.build (cyclomatic 45) mobile/lib/features/channels/media_viewer_page.dart:201— MediaImageViewerPage.build has cyclomatic complexity 45 (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.
modelCapabilities.labelFromModelBody (cyclomatic 45) desktop/src/features/agents/ui/modelCapabilities.ts:541— modelCapabilities.labelFromModelBody has cyclomatic complexity 45 (threshold 15). Of this number, 42 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SetStatusDialog.SetStatusDialog (cyclomatic 45) desktop/src/features/user-status/ui/SetStatusDialog.tsx:184— SetStatusDialog.SetStatusDialog has cyclomatic complexity 45 (threshold 15). Of this number, 23 points are the body's own statements and 22 belong to 8 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AppShell.AppShell (cyclomatic 44) desktop/src/app/AppShell.tsx:110— AppShell.AppShell has cyclomatic complexity 44 (threshold 15). Of this number, 25 points are the body's own statements and 19 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentDefaultsEditor.AgentDefaultsEditor (cyclomatic 44) desktop/src/features/agents/ui/AgentDefaultsEditor.tsx:69— AgentDefaultsEditor.AgentDefaultsEditor has cyclomatic complexity 44 (threshold 15). Of this number, 34 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelManagementSheet.ChannelManagementPanelContent (cyclomatic 44) desktop/src/features/channels/ui/ChannelManagementSheet.tsx:673— ChannelManagementSheet.ChannelManagementPanelContent has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrostedScaffold.build (cyclomatic 43) mobile/lib/shared/widgets/frosted_scaffold.dart:62— FrostedScaffold.build has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PersonaShareDialog.SnapshotShareDialog (cyclomatic 43) desktop/src/features/agents/ui/PersonaShareDialog.tsx:228— PersonaShareDialog.SnapshotShareDialog has cyclomatic complexity 43 (threshold 15). Of this number, 23 points are the body's own statements and 20 belong to 10 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useInboxSelectionAnchor.useInboxSelectionAnchor (cyclomatic 43) desktop/src/features/home/useInboxSelectionAnchor.ts:66— useInboxSelectionAnchor.useInboxSelectionAnchor has cyclomatic complexity 43 (threshold 15). Of this number, 20 points are the body's own statements and 23 belong to 9 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OnboardingFlow.OnboardingFlow (cyclomatic 43) desktop/src/features/onboarding/ui/OnboardingFlow.tsx:154— OnboardingFlow.OnboardingFlow has cyclomatic complexity 43 (threshold 15). Of this number, 24 points are the body's own statements and 19 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IssueAssigneesRow.IssueAssigneesRow (cyclomatic 43) desktop/src/features/projects/ui/IssueAssigneesRow.tsx:99— IssueAssigneesRow.IssueAssigneesRow has cyclomatic complexity 43 (threshold 15). Of this number, 25 points are the body's own statements and 18 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PullRequestReviewCard.PullRequestReviewCard (cyclomatic 43) desktop/src/features/projects/ui/PullRequestReviewCard.tsx:47— PullRequestReviewCard.PullRequestReviewCard has cyclomatic complexity 43 (threshold 15). Of this number, 30 points are the body's own statements and 13 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_ThreadMessage.build (cyclomatic 42) mobile/lib/features/channels/thread_detail_page/thread_message.dart:41— _ThreadMessage.build has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HuddleTransport._handleJoined (cyclomatic 42) mobile/lib/shared/huddle/huddle_transport.dart:450— HuddleTransport._handleJoined has cyclomatic complexity 42 (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.
AdminConsoleSettingsCard.AdminConsoleSettingsSession (cyclomatic 42) desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:239— AdminConsoleSettingsCard.AdminConsoleSettingsSession has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 15 of the 42 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 326, handleSave, a function literal at line 410, …). 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.
useCommunityJoinAlerts.useCommunityJoinAlerts (cyclomatic 42) desktop/src/features/community-members/useCommunityJoinAlerts.ts:149— useCommunityJoinAlerts.useCommunityJoinAlerts has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 5 of the 42 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 303, 231, 523, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useTtsSubscription.useTtsSubscription (cyclomatic 42) desktop/src/features/huddle/lib/useTtsSubscription.ts:36— useTtsSubscription.useTtsSubscription has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 16 function literals inside it that branch (lines 130, 105, 193, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkflowAuthorPicker.WorkflowAuthorPicker (cyclomatic 42) desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:27— WorkflowAuthorPicker.WorkflowAuthorPicker has cyclomatic complexity 42 (threshold 15). Of this number, 16 points are the body's own statements and 26 belong to 10 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InvitePage.InvitePage (cyclomatic 42) web/src/features/invite/ui/InvitePage.tsx:42— InvitePage.InvitePage has cyclomatic complexity 42 (threshold 15). Of this number, 25 points are the body's own statements and 17 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.
FrostedAppBar._build (cyclomatic 41) mobile/lib/shared/widgets/frosted_app_bar.dart:246— FrostedAppBar._build has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentInstanceEditDialog.AgentInstanceEditDialog (cyclomatic 41) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:102— AgentInstanceEditDialog.AgentInstanceEditDialog has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
CommunityEditForm.CommunityEditForm (cyclomatic 41) desktop/src/features/communities/ui/CommunityEditForm.tsx:29— CommunityEditForm.CommunityEditForm has cyclomatic complexity 41 (threshold 15). Of this number, 19 points are the body's own statements and 22 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MeshComputeSettingsCard.MeshComputeSettingsCard (cyclomatic 41) desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx:87— MeshComputeSettingsCard.MeshComputeSettingsCard has cyclomatic complexity 41 (threshold 15). Of this number, 21 points are the body's own statements and 20 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowDetailPanel.WorkflowDetailPanel (cyclomatic 41) desktop/src/features/workflows/ui/WorkflowDetailPanel.tsx:29— WorkflowDetailPanel.WorkflowDetailPanel has cyclomatic complexity 41 (threshold 15). Of this number, 29 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HostedConnectSheet.build (cyclomatic 40) mobile/lib/features/onboarding/hosted_connect_sheet.dart:19— HostedConnectSheet.build has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
_CommunityLinkForm.build (cyclomatic 40) mobile/lib/features/pairing/pairing_page/community_link_form.dart:29— _CommunityLinkForm.build has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_SasVerificationView.build (cyclomatic 40) mobile/lib/features/pairing/pairing_page/sas_verification_view.dart:28— _SasVerificationView.build has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommunitySwitcher.CommunitySwitcher (cyclomatic 40) desktop/src/features/communities/ui/CommunitySwitcher.tsx:113— CommunitySwitcher.CommunitySwitcher has cyclomatic complexity 40 (threshold 15). Of this number, 22 points are the body's own statements and 18 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IdentityRecoveryPairing.IdentityRecoveryPairing (cyclomatic 40) desktop/src/features/onboarding/ui/IdentityRecoveryPairing.tsx:39— IdentityRecoveryPairing.IdentityRecoveryPairing has cyclomatic complexity 40 (threshold 15). Of this number, 17 points are the body's own statements and 23 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PairingPage.build (cyclomatic 39) mobile/lib/features/pairing/pairing_page.dart:86— PairingPage.build has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProfileSetupPage.build (cyclomatic 39) mobile/lib/features/profile/profile_setup_page.dart:28— ProfileSetupPage.build has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AdminConsoleStaffingTab.RestrictionsSection (cyclomatic 39) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:160— AdminConsoleStaffingTab.RestrictionsSection has cyclomatic complexity 39 (threshold 15). Of this number, 27 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buildMentionCandidates.buildMentionCandidates (cyclomatic 39) desktop/src/features/messages/lib/buildMentionCandidates.ts:56— buildMentionCandidates.buildMentionCandidates has cyclomatic complexity 39 (threshold 15). Of this number, 25 points are the body's own statements and 14 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ComposerImageEditor.ComposerImageEditor (cyclomatic 39) desktop/src/features/messages/ui/ComposerImageEditor.tsx:134— ComposerImageEditor.ComposerImageEditor has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 5 of the 39 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 220, 252, 274, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ComposerAttachments.MediaAttachmentItem (cyclomatic 39) desktop/src/features/messages/ui/ComposerAttachments.tsx:253— ComposerAttachments.MediaAttachmentItem has cyclomatic complexity 39 (threshold 15). Of this number, 35 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelContextMenu.ChannelContextMenuItems (cyclomatic 39) desktop/src/features/sidebar/ui/ChannelContextMenu.tsx:142— ChannelContextMenu.ChannelContextMenuItems has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChannelCombobox.ChannelCombobox (cyclomatic 39) desktop/src/features/workflows/ui/ChannelCombobox.tsx:52— ChannelCombobox.ChannelCombobox has cyclomatic complexity 39 (threshold 15). Of this number, 20 points are the body's own statements and 19 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_NewDirectMessageSheet.build (cyclomatic 38) mobile/lib/features/channels/channels_page/sheets.dart:441— _NewDirectMessageSheet.build has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AdminConsoleActionsTab.ActionsSection (cyclomatic 38) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:375— AdminConsoleActionsTab.ActionsSection has cyclomatic complexity 38 (threshold 15). Of this number, 30 points are the body's own statements and 8 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.
agentConfigControls.AgentModelField (cyclomatic 38) desktop/src/features/agents/ui/agentConfigControls.tsx:337— agentConfigControls.AgentModelField has cyclomatic complexity 38 (threshold 15). Of this number, 34 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AgentSessionThreadPanel.AgentSessionThreadPanel (cyclomatic 38) desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx:90— AgentSessionThreadPanel.AgentSessionThreadPanel has cyclomatic complexity 38 (threshold 15). Of this number, 31 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MaskedAvatarBadgeFrame.MaskedAvatarBadgeFrame (cyclomatic 38) desktop/src/features/profile/ui/MaskedAvatarBadgeFrame.tsx:751— MaskedAvatarBadgeFrame.MaskedAvatarBadgeFrame has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeProfileSetupCoordinator.openAvatar (cyclomatic 37) mobile/ios/Runner/NativeProfileSetup.swift:74— NativeProfileSetupCoordinator.openAvatar has cyclomatic complexity 37 (threshold 15). Of this number, 30 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentRuntimeAvatarControl.AgentRuntimeAvatarControl (cyclomatic 37) desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:136— AgentRuntimeAvatarControl.AgentRuntimeAvatarControl has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AddMemberDialog.DirectAddMemberForm (cyclomatic 37) desktop/src/features/community-members/ui/AddMemberDialog.tsx:51— AddMemberDialog.DirectAddMemberForm has cyclomatic complexity 37 (threshold 15). Of this number, 19 points are the body's own statements and 18 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.
MicControls.MicControls (cyclomatic 37) desktop/src/features/huddle/components/MicControls.tsx:94— MicControls.MicControls has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useVoiceNoteRecorder.useVoiceNoteRecorder.start (cyclomatic 37) desktop/src/features/messages/lib/useVoiceNoteRecorder.ts:68— useVoiceNoteRecorder.useVoiceNoteRecorder.start has cyclomatic complexity 37 (threshold 15). Of this number, 16 points are the body's own statements and 21 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SystemMessageRow.SystemMessageRow (cyclomatic 37) desktop/src/features/messages/ui/SystemMessageRow.tsx:649— SystemMessageRow.SystemMessageRow has cyclomatic complexity 37 (threshold 15). Of this number, 27 points are the body's own statements and 10 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TopbarSearch.TopbarSearch (cyclomatic 37) desktop/src/features/search/ui/TopbarSearch.tsx:376— TopbarSearch.TopbarSearch has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch::renderSearchResultRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsPanels.ThemeSettingsCard (cyclomatic 37) desktop/src/features/settings/ui/SettingsPanels.tsx:421— SettingsPanels.ThemeSettingsCard has cyclomatic complexity 37 (threshold 15). Of this number, 24 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
workflowTriggerDescription.workflowTriggerDescription (cyclomatic 37) desktop/src/features/workflows/ui/workflowTriggerDescription.ts:121— workflowTriggerDescription.workflowTriggerDescription has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsageTracker::record (cyclomatic 36) crates/buzz-acp/src/usage.rs:560— UsageTracker::record has cyclomatic complexity 36 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
_HuddleCallAvatar.build (cyclomatic 36) mobile/lib/features/channels/channel_detail_page/huddle_call_avatar.dart:32— _HuddleCallAvatar.build has cyclomatic complexity 36 (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.
SelfHostedEntrySheet.build (cyclomatic 36) mobile/lib/features/onboarding/self_hosted_entry_sheet.dart:95— SelfHostedEntrySheet.build has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MePage.build (cyclomatic 35) mobile/lib/features/channels/me/me_page.dart:48— MePage.build has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_NewMeChat.build (cyclomatic 35) mobile/lib/features/channels/me/new_me_chat.dart:5— _NewMeChat.build has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeviceVoiceNotePlayerController._loadPendingRemote (cyclomatic 35) mobile/lib/features/channels/voice_note_recording.dart:592— DeviceVoiceNotePlayerController._loadPendingRemote 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.
TeamDialog.TeamDialog (cyclomatic 35) desktop/src/features/agents/ui/TeamDialog.tsx:44— TeamDialog.TeamDialog has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 11 of the 35 points are its own statements and the rest belongs to 12 function items inside it that branch (buildSubmitInput, handleSubmit, a function literal at line 112, …). 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.
useCommunityInit.useCommunityInit (cyclomatic 35) desktop/src/features/communities/useCommunityInit.ts:131— useCommunityInit.useCommunityInit has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to one function literal inside it that branches (line 186). 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.
CustomEmojiSettingsCard.CustomEmojiSettingsCard (cyclomatic 35) desktop/src/features/custom-emoji/ui/CustomEmojiSettingsCard.tsx:31— CustomEmojiSettingsCard.CustomEmojiSettingsCard has cyclomatic complexity 35 (threshold 15). Of this number, 21 points are the body's own statements and 14 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
machineOnboarding.useMachineOnboardingState (cyclomatic 35) desktop/src/features/onboarding/machineOnboarding.ts:99— machineOnboarding.useMachineOnboardingState has cyclomatic complexity 35 (threshold 15). Of this number, 23 points are the body's own statements and 12 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PulseView.PulseView (cyclomatic 35) desktop/src/features/pulse/ui/PulseView.tsx:75— PulseView.PulseView has cyclomatic complexity 35 (threshold 15). Of this number, 17 points are the body's own statements and 18 belong to 8 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.
_SliverChannelsList.build (cyclomatic 34) mobile/lib/features/channels/channels_page/body.dart:107— _SliverChannelsList.build has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MessageContent._buildLink (cyclomatic 34) mobile/lib/features/channels/message_content.dart:580— MessageContent._buildLink has cyclomatic complexity 34 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow (cyclomatic 34) desktop/src/features/messages/ui/useMentionSendFlow.ts:723— useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VoiceSettingsCard.VoiceSettingsCard (cyclomatic 34) desktop/src/features/settings/ui/VoiceSettingsCard.tsx:49— VoiceSettingsCard.VoiceSettingsCard has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 84, 135, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BestiePopover.BestiePopover (cyclomatic 34) desktop/src/protectedFeatures/bestie/BestiePopover.tsx:195— BestiePopover.BestiePopover has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 467, sendMessage, a function literal at line 357, …). 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.
mentionBoundaries.maskMarkdownCode (cyclomatic 34) REDACTED:35— mentionBoundaries.maskMarkdownCode has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
entityLink.parseEntityLink (cyclomatic 34) desktop/src/shared/lib/entityLink.ts:187— entityLink.parseEntityLink has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IosNavigationBarView.configure (cyclomatic 33) mobile/ios/Runner/IosNavigationBar.swift:377— IosNavigationBarView.configure 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.
ChannelActionsSheet.build (cyclomatic 33) mobile/lib/features/channels/channel_actions_sheet.dart:81— ChannelActionsSheet.build 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.
ChannelMemberProfileActions.build (cyclomatic 33) mobile/lib/features/channels/channel_member_profile_actions.dart:26— ChannelMemberProfileActions.build 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.
MediaVideoViewerPage.build (cyclomatic 33) mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19— MediaVideoViewerPage.build 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.
ComposerAttachments.ComposerAttachments (cyclomatic 33) desktop/src/features/messages/ui/ComposerAttachments.tsx:591— ComposerAttachments.ComposerAttachments has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 10 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 750, 635, 875). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectRepositoryManagement.ProjectRepositoryManagement (cyclomatic 33) desktop/src/features/projects/ui/ProjectRepositoryManagement.tsx:24— ProjectRepositoryManagement.ProjectRepositoryManagement has cyclomatic complexity 33 (threshold 15). Of this number, 22 points are the body's own statements and 11 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_InboxRow.build (cyclomatic 32) mobile/lib/features/activity/activity_page/inbox_row.dart:68— _InboxRow.build has cyclomatic complexity 32 (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.
AdminConsoleCommunities.CommunitiesTab (cyclomatic 32) desktop/src/features/admin-console/AdminConsoleCommunities.tsx:37— AdminConsoleCommunities.CommunitiesTab has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AddTeamToChannelDialog.AddTeamToChannelDialog (cyclomatic 32) desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:47— AddTeamToChannelDialog.AddTeamToChannelDialog has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModelPicker.ModelPicker (cyclomatic 32) desktop/src/features/agents/ui/ModelPicker.tsx:34— ModelPicker.ModelPicker has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 15 of the 32 points are its own statements and the rest belongs to 4 function items inside it that branch (handleModelChange, a function literal at line 80, a function literal at line 66, …). 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.
useInboxThreadContext.useInboxThreadContext (cyclomatic 32) desktop/src/features/home/useInboxThreadContext.ts:49— useInboxThreadContext.useInboxThreadContext has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 93, 110, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HuddleAttachment.HuddleAttachment (cyclomatic 32) desktop/src/features/huddle/components/HuddleAttachment.tsx:116— HuddleAttachment.HuddleAttachment has cyclomatic complexity 32 (threshold 15). Of this number, 18 points are the body's own statements and 14 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
nostr-client.queryEvents (cyclomatic 32) web/src/shared/lib/nostr-client.ts:33— nostr-client.queryEvents has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 80, 55, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
_IOSInlinePhotoPicker.build (cyclomatic 31) mobile/lib/features/channels/compose_bar/ios_photo_picker.dart:23— _IOSInlinePhotoPicker.build has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VoiceNoteAttachment.build (cyclomatic 31) mobile/lib/features/channels/voice_note_attachment.dart:45— VoiceNoteAttachment.build has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeCommunityEntry.show (cyclomatic 31) mobile/lib/shared/identity_transfer/native_community_entry.dart:14— NativeCommunityEntry.show has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IosGlassNavigationButton.build (cyclomatic 31) mobile/lib/shared/widgets/ios_glass_navigation_button.dart:109— IosGlassNavigationButton.build has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit (cyclomatic 31) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:649— AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
useComposerLinkPreviews.useComposerLinkPreviews (cyclomatic 31) desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:273— useComposerLinkPreviews.useComposerLinkPreviews has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 443, 457, 385, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DownloadKeyStep.DownloadKeyStep (cyclomatic 31) desktop/src/features/onboarding/ui/DownloadKeyStep.tsx:34— DownloadKeyStep.DownloadKeyStep has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useAddProjectRepository.addProjectRepository (cyclomatic 31) desktop/src/features/projects/useAddProjectRepository.ts:55— useAddProjectRepository.addProjectRepository has cyclomatic complexity 31 (threshold 15). Of this number, 30 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.
relayReconnectReplay.replayLiveSubscriptions (cyclomatic 31) desktop/src/shared/api/relayReconnectReplay.ts:181— relayReconnectReplay.replayLiveSubscriptions has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 231, a function literal at line 352, a function literal at line 308, …). 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.
VoiceNoteComposerRecorder.build (cyclomatic 30) mobile/lib/features/channels/voice_note_composer_recorder.dart:35— VoiceNoteComposerRecorder.build has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProfileAvatarCropPage.build (cyclomatic 30) mobile/lib/features/profile/profile_avatar_crop_page.dart:23— ProfileAvatarCropPage.build has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AdminConsoleStaffingTab.StaffingTab (cyclomatic 30) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:442— AdminConsoleStaffingTab.StaffingTab has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
agentSessionTranscriptHelpers.parseSystemPromptSections (cyclomatic 30) REDACTED:138— agentSessionTranscriptHelpers.parseSystemPromptSections has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserMessageBubble.UserMessageBubble (cyclomatic 30) desktop/src/features/agents/ui/activityRenderClasses/UserMessageBubble.tsx:17— UserMessageBubble.UserMessageBubble has cyclomatic complexity 30 (threshold 15). Of this number, 23 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InviteLinkSection.InviteLinkSection (cyclomatic 30) desktop/src/features/community-members/ui/InviteLinkSection.tsx:47— InviteLinkSection.InviteLinkSection has cyclomatic complexity 30 (threshold 15). Of this number, 16 points are the body's own statements and 14 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.
hooks.useChannelSubscription (cyclomatic 30) desktop/src/features/messages/hooks.ts:319— hooks.useChannelSubscription has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 328, 399, 407, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useDrafts.draftStatesEqual (cyclomatic 30) desktop/src/features/messages/lib/useDrafts.ts:386— useDrafts.draftStatesEqual has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MessageActionBar.MessageActionBar (cyclomatic 30) desktop/src/features/messages/ui/MessageActionBar.tsx:396— MessageActionBar.MessageActionBar has cyclomatic complexity 30 (threshold 15). Of this number, 24 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
hooks.useAppOnboardingState (cyclomatic 30) desktop/src/features/onboarding/hooks.ts:466— hooks.useAppOnboardingState has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 13 of the 30 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 521, 574, 623, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CreatePullRequestDialog.CreatePullRequestDialog (cyclomatic 30) desktop/src/features/projects/ui/CreatePullRequestDialog.tsx:21— CreatePullRequestDialog.CreatePullRequestDialog has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectEntityListRow.ProjectEntityListRow (cyclomatic 30) desktop/src/features/projects/ui/ProjectEntityListRow.tsx:137— ProjectEntityListRow.ProjectEntityListRow has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MergePullRequestButton.MergePullRequestButton (cyclomatic 30) desktop/src/features/projects/ui/MergePullRequestButton.tsx:38— MergePullRequestButton.MergePullRequestButton has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 79, 125, 161, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectRepositoryPanel.RepositoryFilesPanel (cyclomatic 30) desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:614— ProjectRepositoryPanel.RepositoryFilesPanel has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectHomeWorkspaceSheet.ProjectHomeWorkspaceSheet (cyclomatic 30) desktop/src/features/projects/ui/ProjectHomeWorkspaceSheet.tsx:47— ProjectHomeWorkspaceSheet.ProjectHomeWorkspaceSheet has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 215, 272, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BestieGlobalOverlay.BestieGlobalOverlay (cyclomatic 30) desktop/src/protectedFeatures/bestie/BestieGlobalOverlay.tsx:41— BestieGlobalOverlay.BestieGlobalOverlay has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 94, a function literal at line 140, a function literal at line 85, …). 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.
VideoPlayer.VideoScrubber (cyclomatic 30) desktop/src/shared/ui/VideoPlayer.tsx:353— VideoPlayer.VideoScrubber has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 9 of the 30 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 442, 398, 418, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AppDelegate.didInitializeImplicitFlutterEngine (cyclomatic 29) mobile/ios/Runner/AppDelegate.swift:68— AppDelegate.didInitializeImplicitFlutterEngine 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.
PairingNotifier._handlePairingEvent (cyclomatic 29) mobile/lib/features/pairing/pairing_provider.dart:499— PairingNotifier._handlePairingEvent 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.
useHuddlePresentation.useHuddlePresentation (cyclomatic 29) desktop/src/app/useHuddlePresentation.ts:31— useHuddlePresentation.useHuddlePresentation has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 5 of the 29 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 395, 109, 384, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PersonaShareRecipients.PersonaShareRecipients (cyclomatic 29) desktop/src/features/agents/ui/PersonaShareRecipients.tsx:32— PersonaShareRecipients.PersonaShareRecipients has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 187, a function literal at line 72, a function literal at line 236, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FormattingToolbar.FormattingToolbar (cyclomatic 29) desktop/src/features/messages/ui/FormattingToolbar.tsx:127— FormattingToolbar.FormattingToolbar has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 231, 165, 155, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SetupStep.SetupStepContent (cyclomatic 29) desktop/src/features/onboarding/ui/SetupStep.tsx:963— SetupStep.SetupStepContent has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (openRuntime, a function literal at line 1008, a function literal at line 1035, …). 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.
ProfileAvatar.ProfileAvatar (cyclomatic 29) desktop/src/features/profile/ui/ProfileAvatar.tsx:57— ProfileAvatar.ProfileAvatar has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectsAgentPromptPage.ProjectsAgentPromptPage (cyclomatic 29) desktop/src/features/projects/ui/ProjectsAgentPromptPage.tsx:393— ProjectsAgentPromptPage.ProjectsAgentPromptPage has cyclomatic complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProjectAgentChatPanel.ProjectAgentChatPanel (cyclomatic 29) desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:50— ProjectAgentChatPanel.ProjectAgentChatPanel has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LaneReconciler.runAttempt (cyclomatic 29) desktop/src/features/sidebar/lib/sidebarLaneReconciler.ts:194— LaneReconciler.runAttempt has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SidebarSection.ChannelMenuButton (cyclomatic 29) desktop/src/features/sidebar/ui/SidebarSection.tsx:246— SidebarSection.ChannelMenuButton has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
terminalBanner.buildTerminalBanner (cyclomatic 29) desktop/src/features/terminal/terminalBanner.ts:121— terminalBanner.buildTerminalBanner has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeBlock.SyntaxHighlightedCode (cyclomatic 29) desktop/src/shared/ui/markdown/CodeBlock.tsx:134— CodeBlock.SyntaxHighlightedCode has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 152, 190, 235, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
_HuddleJoinSurface.build (cyclomatic 28) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:294— _HuddleJoinSurface.build has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_ThreadMessageList.build (cyclomatic 28) mobile/lib/features/channels/thread_detail_page/message_list.dart:146— _ThreadMessageList.build has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_OnboardingConnectionView.build (cyclomatic 28) mobile/lib/features/pairing/pairing_page/onboarding_connection_view.dart:24— _OnboardingConnectionView.build has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PairingNotifier._continueAfterSas (cyclomatic 28) mobile/lib/features/pairing/pairing_provider.dart:188— PairingNotifier._continueAfterSas has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProfileSetupAvatarEditor.build (cyclomatic 28) mobile/lib/features/profile/profile_setup_avatar_editor.dart:28— ProfileSetupAvatarEditor.build has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BrowserAuth.receive (cyclomatic 28) mobile/lib/shared/hosted/browser_auth.dart:169— BrowserAuth.receive has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HostedBackupService._backup (cyclomatic 28) mobile/lib/shared/hosted/hosted_backup_service.dart:47— HostedBackupService._backup has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelRouteScreen.ChannelRouteScreen (cyclomatic 28) desktop/src/app/routes/ChannelRouteScreen.tsx:114— ChannelRouteScreen.ChannelRouteScreen has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 177, 230, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddAgentToChannelDialog.AddAgentToChannelDialog (cyclomatic 28) desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:27— AddAgentToChannelDialog.AddAgentToChannelDialog has cyclomatic complexity 28 (threshold 15). Of this number, 18 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChannelMemberInviteCard.ChannelMemberInviteCard (cyclomatic 28) desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx:26— ChannelMemberInviteCard.ChannelMemberInviteCard has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MembersSidebarMemberCard.MembersSidebarMemberCard (cyclomatic 28) desktop/src/features/channels/ui/MembersSidebarMemberCard.tsx:121— MembersSidebarMemberCard.MembersSidebarMemberCard has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InboxMessageRow.InboxMessageRow (cyclomatic 28) desktop/src/features/home/ui/InboxMessageRow.tsx:55— InboxMessageRow.InboxMessageRow has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MessageActionBar.MoreActionsMenu (cyclomatic 28) desktop/src/features/messages/ui/MessageActionBar.tsx:86— MessageActionBar.MoreActionsMenu has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SetupStep.RuntimeCard (cyclomatic 28) desktop/src/features/onboarding/ui/SetupStep.tsx:420— SetupStep.RuntimeCard has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useProjectSidebarMembership.useProjectSidebarMembership (cyclomatic 28) desktop/src/features/projects/lib/useProjectSidebarMembership.ts:20— useProjectSidebarMembership.useProjectSidebarMembership has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 13 function literals inside it that branch (lines 90, 157, 33, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectChannelHome.ProjectChannelHome (cyclomatic 28) desktop/src/features/projects/ui/ProjectChannelHome.tsx:87— ProjectChannelHome.ProjectChannelHome has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TopbarSearch.TopbarSearch::renderSearchResultRow (cyclomatic 28) desktop/src/features/search/ui/TopbarSearch.tsx:655— TopbarSearch.TopbarSearch::renderSearchResultRow has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
useSearchResults.useSearchResults (cyclomatic 28) desktop/src/features/search/useSearchResults.ts:102— useSearchResults.useSearchResults has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HarnessRow.HarnessRow (cyclomatic 28) desktop/src/features/settings/ui/HarnessRow.tsx:297— HarnessRow.HarnessRow has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GitStore::run_conformance_probe (cyclomatic 27) crates/buzz-relay/src/api/git/store.rs:576— GitStore::run_conformance_probe has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ChannelsNotifier._catchUpUnreadEvents (cyclomatic 27) mobile/lib/features/channels/channels_provider.dart:713— ChannelsNotifier._catchUpUnreadEvents 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.
_RecentPhotoGalleryPicker.build (cyclomatic 27) mobile/lib/features/channels/compose_bar/photo_gallery_picker.dart:48— _RecentPhotoGalleryPicker.build 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.
HostedFlow._initialize (cyclomatic 27) mobile/lib/shared/hosted/hosted_flow.dart:208— HostedFlow._initialize 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.
useAppShellKeyboardShortcuts.useAppShellKeyboardShortcuts (cyclomatic 27) desktop/src/app/useAppShellKeyboardShortcuts.ts:21— useAppShellKeyboardShortcuts.useAppShellKeyboardShortcuts has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 56, 39, 32). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
modelCapabilities.resolveModelCapabilities (cyclomatic 27) desktop/src/features/agents/ui/modelCapabilities.ts:335— modelCapabilities.resolveModelCapabilities 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.
CompactMessageSummary.CompactMessageSummary (cyclomatic 27) desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx:18— CompactMessageSummary.CompactMessageSummary has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnimatedAvatarControls.AvatarFramingSlider (cyclomatic 27) desktop/src/features/profile/ui/AnimatedAvatarControls.tsx:85— AnimatedAvatarControls.AvatarFramingSlider has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 186, 125, 145, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfilePanelTabs.ProfileRuntimeTabContent (cyclomatic 27) desktop/src/features/profile/ui/UserProfilePanelTabs.tsx:713— UserProfilePanelTabs.ProfileRuntimeTabContent has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommunityThemeController.CommunityThemeController (cyclomatic 27) desktop/src/shared/theme/CommunityThemeController.tsx:30— CommunityThemeController.CommunityThemeController has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 189, 96, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SubscriptionRegistry::remove_from_index (cyclomatic 26) crates/buzz-relay/src/subscription.rs:564— SubscriptionRegistry::remove_from_index has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeProfileTextEditorViewController.tableView (cyclomatic 26) mobile/ios/Runner/NativeProfileTextEditor.swift:561— NativeProfileTextEditorViewController.tableView has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelQuickActionsLauncher.build (cyclomatic 26) mobile/lib/features/channels/channels_page/quick_actions_launcher.dart:51— ChannelQuickActionsLauncher.build has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_InlineCameraPreview.build (cyclomatic 26) mobile/lib/features/channels/compose_bar/camera_preview.dart:14— _InlineCameraPreview.build has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
usePersonaModelDiscovery.usePersonaModelDiscovery (cyclomatic 26) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:200— usePersonaModelDiscovery.usePersonaModelDiscovery has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body's own statements and 12 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PersonaModelCombobox.PersonaModelCombobox (cyclomatic 26) desktop/src/features/agents/ui/PersonaModelCombobox.tsx:22— PersonaModelCombobox.PersonaModelCombobox has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 8 function items inside it that branch (handleKeyDown, a function literal at line 182, a function literal at line 104, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MembersSidebarMemberCard.MemberActionsMenu (cyclomatic 26) desktop/src/features/channels/ui/MembersSidebarMemberCard.tsx:306— MembersSidebarMemberCard.MemberActionsMenu has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WelcomeSetup.WelcomeSetup (cyclomatic 26) desktop/src/features/communities/ui/WelcomeSetup.tsx:33— WelcomeSetup.WelcomeSetup has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
homePaneLayout.getHomePaneLayout (cyclomatic 26) desktop/src/features/home/lib/homePaneLayout.ts:18— homePaneLayout.getHomePaneLayout has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
InboxListPane.InboxListPane::renderItem (cyclomatic 26) desktop/src/features/home/ui/InboxListPane.tsx:309— InboxListPane.InboxListPane::renderItem has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ParticipantList.HuddleParticipantsControl (cyclomatic 26) desktop/src/features/huddle/components/ParticipantList.tsx:141— ParticipantList.HuddleParticipantsControl has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 310, 257, 154, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
hooks.useSendMessageMutation (cyclomatic 26) desktop/src/features/messages/hooks.ts:476— hooks.useSendMessageMutation has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 499, 657, 584, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
agentSnapshotClipboard.parseSnapshotClipboardHtml (cyclomatic 26) REDACTED:86— agentSnapshotClipboard.parseSnapshotClipboardHtml has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HarnessCatalogDialog.HarnessCatalogDialog (cyclomatic 26) desktop/src/features/settings/ui/HarnessCatalogDialog.tsx:57— HarnessCatalogDialog.HarnessCatalogDialog has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelTemplatesSettingsCard.TemplateFormDialog (cyclomatic 26) desktop/src/features/settings/ui/ChannelTemplatesSettingsCard.tsx:291— ChannelTemplatesSettingsCard.TemplateFormDialog has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 326, handleSubmit, a function literal at line 361, …). 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.
workflowFormTypes.actionFieldsForStep (cyclomatic 26) desktop/src/features/workflows/ui/workflowFormTypes.ts:183— workflowFormTypes.actionFieldsForStep has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RelayClient.handleWsMessage (cyclomatic 26) desktop/src/shared/api/relayClientSession.ts:867— RelayClient.handleWsMessage has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useResolvedLinkPreviews.useResolvedLinkPreviews (cyclomatic 26) desktop/src/shared/lib/useResolvedLinkPreviews.ts:646— useResolvedLinkPreviews.useResolvedLinkPreviews has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 695, 756, 771, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RepoBlobViewer.RepoBlobPage (cyclomatic 26) web/src/features/repos/ui/RepoBlobViewer.tsx:222— RepoBlobViewer.RepoBlobPage has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
eventToProjectPullRequest (cyclomatic 26) desktop/src/features/projects/projectPullRequests.mjs:304— eventToProjectPullRequest has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
desktop_release.validate (cyclomatic 25) scripts/desktop_release.py:210— desktop_release.validate 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.
ActivityNotifier._fetch (cyclomatic 25) mobile/lib/features/activity/activity_provider.dart:443— ActivityNotifier._fetch 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.
HostedRelayAuth._issue (cyclomatic 25) mobile/lib/shared/hosted/hosted_relay_auth.dart:97— HostedRelayAuth._issue 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.
NsecImportSheet.build (cyclomatic 25) mobile/lib/shared/identity_transfer/nsec_import_sheet.dart:41— NsecImportSheet.build 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.
RelaySessionNotifier._handleClosed (cyclomatic 25) mobile/lib/shared/relay/relay_session.dart:837— RelaySessionNotifier._handleClosed 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.
AdminConsoleReportsTab.ResolveReportForm (cyclomatic 25) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:367— AdminConsoleReportsTab.ResolveReportForm has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
agentManagement.parseAgentManagementRequest (cyclomatic 25) desktop/src/features/agents/agentManagement.ts:57— agentManagement.parseAgentManagementRequest 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.
EnvVarsEditor.EnvVarsEditor (cyclomatic 25) desktop/src/features/agents/ui/EnvVarsEditor.tsx:211— EnvVarsEditor.EnvVarsEditor has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 288, 545, 258, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
agentConfigControls.AgentDropdownSelect (cyclomatic 25) desktop/src/features/agents/ui/agentConfigControls.tsx:112— agentConfigControls.AgentDropdownSelect has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AddChannelBotDialog.AddChannelBotDialog (cyclomatic 25) desktop/src/features/channels/ui/AddChannelBotDialog.tsx:55— AddChannelBotDialog.AddChannelBotDialog has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 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.
CanvasHistoryPanel.CanvasHistoryPanel (cyclomatic 25) desktop/src/features/channels/ui/CanvasHistoryPanel.tsx:51— CanvasHistoryPanel.CanvasHistoryPanel has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 198, a function literal at line 89, authorLabel, …). 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.
ChannelScreenHeader.ChannelScreenHeader (cyclomatic 25) desktop/src/features/channels/ui/ChannelScreenHeader.tsx:55— ChannelScreenHeader.ChannelScreenHeader 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.
projectChannelRequest.parseProjectChannelRequest (cyclomatic 25) desktop/src/features/projects/projectChannelRequest.ts:26— projectChannelRequest.parseProjectChannelRequest has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProjectPullRequestFilesChangedPanel.DiffPreview (cyclomatic 25) desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:447— ProjectPullRequestFilesChangedPanel.DiffPreview has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 509, 461, 470, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectReadmePanel.ReadmePanel (cyclomatic 25) desktop/src/features/projects/ui/ProjectReadmePanel.tsx:94— ProjectReadmePanel.ReadmePanel 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.
SendFeedbackDialog.SendFeedbackDialog (cyclomatic 25) desktop/src/features/settings/ui/SendFeedbackDialog.tsx:65— SendFeedbackDialog.SendFeedbackDialog has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (submitFeedback, selectCategory, attachImage, …). 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.
SidebarProjectsSection.SidebarProjectsSectionContent (cyclomatic 25) desktop/src/features/sidebar/ui/SidebarProjectsSection.tsx:128— SidebarProjectsSection.SidebarProjectsSectionContent has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 226, a function literal at line 299, handleRemove, …). 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.
useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cyclomatic 25) desktop/src/features/sidebar/ui/useSidebarRelayConnectionCard.ts:63— useSidebarRelayConnectionCard.useSidebarRelayConnectionCard has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
inviteHelpers.parseInviteInput (cyclomatic 25) REDACTED:26— inviteHelpers.parseInviteInput 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.
linkPreviewSnapshot.parseLinkPreviewSnapshots (cyclomatic 25) desktop/src/shared/lib/linkPreviewSnapshot.ts:95— linkPreviewSnapshot.parseLinkPreviewSnapshots has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NativeMessagePresentationCoordinator.handle (cyclomatic 24) mobile/ios/Runner/NativeMessagePresentationCoordinator.swift:23— NativeMessagePresentationCoordinator.handle has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_VideoTransportBar.build (cyclomatic 24) mobile/lib/features/channels/media_viewer_page/video_controls.dart:64— _VideoTransportBar.build has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UserProfileSheet.build (cyclomatic 24) mobile/lib/features/profile/user_profile_sheet.dart:76— UserProfileSheet.build has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HostedAdmission.prepare (cyclomatic 24) mobile/lib/shared/hosted/hosted_admission.dart:38— HostedAdmission.prepare 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.
MeGroups.decode (cyclomatic 24) mobile/lib/shared/me/me_groups.dart:21— MeGroups.decode has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CommunityThemeNotifier.build (cyclomatic 24) mobile/lib/shared/theme/community_theme_provider.dart:25— CommunityThemeNotifier.build 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.
agentSessionToolCatalog.getBuzzToolInfo (cyclomatic 24) desktop/src/features/agents/ui/agentSessionToolCatalog.ts:139— agentSessionToolCatalog.getBuzzToolInfo 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.
ManagedAgentLogPanel.ManagedAgentLogPanel (cyclomatic 24) desktop/src/features/agents/ui/ManagedAgentLogPanel.tsx:9— ManagedAgentLogPanel.ManagedAgentLogPanel 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.
BotActivityBar.BotActivityComposerAction (cyclomatic 24) desktop/src/features/channels/ui/BotActivityBar.tsx:37— BotActivityBar.BotActivityComposerAction has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 64, 186, 102, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddAgentDialog.AddAgentDialog (cyclomatic 24) desktop/src/features/huddle/components/AddAgentDialog.tsx:31— AddAgentDialog.AddAgentDialog has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (handleAdd, a function literal at line 43, a function literal at line 53, …). 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.
plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM (cyclomatic 24) desktop/src/features/messages/lib/plainTextProjection.ts:231— plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
use-feed-desktop-notifications.useFeedDesktopNotifications (cyclomatic 24) desktop/src/features/notifications/use-feed-desktop-notifications.ts:71— use-feed-desktop-notifications.useFeedDesktopNotifications has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 131, 95, 113, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SetupStep.RuntimeProvidersSection (cyclomatic 24) desktop/src/features/onboarding/ui/SetupStep.tsx:662— SetupStep.RuntimeProvidersSection has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserProfilePanelFields.buildOwnerFields (cyclomatic 24) desktop/src/features/profile/ui/UserProfilePanelFields.tsx:228— UserProfilePanelFields.buildOwnerFields 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.
ProjectRepositoryPanel.fileIconVisual (cyclomatic 24) desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:260— ProjectRepositoryPanel.fileIconVisual has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProjectsChannelsList.ProjectsChannelsList (cyclomatic 24) desktop/src/features/projects/ui/ProjectsChannelsList.tsx:27— ProjectsChannelsList.ProjectsChannelsList has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 171, 55, 90, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EncryptedBackupProvider.EncryptedBackupProvider (cyclomatic 24) desktop/src/features/settings/EncryptedBackupProvider.tsx:35— EncryptedBackupProvider.EncryptedBackupProvider has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 158, 115, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkflowMessageTextConditionEditor.WorkflowMessageTextCondition (cyclomatic 24) desktop/src/features/workflows/ui/WorkflowMessageTextConditionEditor.tsx:41— WorkflowMessageTextConditionEditor.WorkflowMessageTextCondition has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
localStorageSweep.sweepChunked::processSlice (cyclomatic 24) desktop/src/shared/lib/localStorageSweep.ts:215— localStorageSweep.sweepChunked::processSlice 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.
ThemeProvider.ThemeProvider (cyclomatic 24) desktop/src/shared/theme/ThemeProvider.tsx:548— ThemeProvider.ThemeProvider has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 746, 605, 623, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MessageLinkPill.MessageLinkPillContents (cyclomatic 24) desktop/src/shared/ui/markdown/MessageLinkPill.tsx:149— MessageLinkPill.MessageLinkPillContents has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RepoDetailPage.RepoDetailPage (cyclomatic 24) web/src/features/repos/ui/RepoDetailPage.tsx:181— RepoDetailPage.RepoDetailPage has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
desktop_release.previous_release (cyclomatic 23) scripts/desktop_release.py:87— desktop_release.previous_release has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IosNavigationBarView.makeItem (cyclomatic 23) mobile/ios/Runner/IosNavigationBar.swift:699— IosNavigationBarView.makeItem has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeAddMembersViewController.tableView (cyclomatic 23) mobile/ios/Runner/NativeAddMembersSheet.swift:217— NativeAddMembersViewController.tableView has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypingMotionPreview.build (cyclomatic 23) mobile/lib/features/channels/typing_motion_preview.dart:18— TypingMotionPreview.build has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeviceVoiceNotePlayerController._toggle (cyclomatic 23) mobile/lib/features/channels/voice_note_recording.dart:808— DeviceVoiceNotePlayerController._toggle has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BuzzPushBootstrap.build (cyclomatic 23) mobile/lib/shared/push/push_bootstrap.dart:161— BuzzPushBootstrap.build has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentCardMintDialog.AgentCardMintDialog (cyclomatic 23) desktop/src/features/agents/ui/AgentCardMintDialog.tsx:106— AgentCardMintDialog.AgentCardMintDialog has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RespondToField.AllowlistPicker (cyclomatic 23) desktop/src/features/agents/ui/RespondToField.tsx:282— RespondToField.AllowlistPicker has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelMembersBar.ChannelMembersBar (cyclomatic 23) desktop/src/features/channels/ui/ChannelMembersBar.tsx:46— ChannelMembersBar.ChannelMembersBar has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CommunityMembersSettingsCard.RelayMemberRow (cyclomatic 23) desktop/src/features/community-members/ui/CommunityMembersSettingsCard.tsx:91— CommunityMembersSettingsCard.RelayMemberRow has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sendToChannelSemantics.getSendToChannelSemantics (cyclomatic 23) desktop/src/features/messages/lib/sendToChannelSemantics.ts:25— sendToChannelSemantics.getSendToChannelSemantics has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useDrafts.isValidDraftState (cyclomatic 23) desktop/src/features/messages/lib/useDrafts.ts:267— useDrafts.isValidDraftState has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
useMentions.useMentions.handleMentionKeyDown (cyclomatic 23) desktop/src/features/messages/lib/useMentions.ts:828— useMentions.useMentions.handleMentionKeyDown has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComposerUploadProgressPill.ComposerUploadProgressPill (cyclomatic 23) desktop/src/features/messages/ui/ComposerUploadProgressPill.tsx:10— ComposerUploadProgressPill.ComposerUploadProgressPill has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TimelineMessageRow.MessageRowItem (cyclomatic 23) desktop/src/features/messages/ui/TimelineMessageRow.tsx:94— TimelineMessageRow.MessageRowItem has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
hooks.useFirstRunOnboardingGate (cyclomatic 23) desktop/src/features/onboarding/hooks.ts:282— hooks.useFirstRunOnboardingGate has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 324, 391, 310, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SetupStep.RuntimeStatus (cyclomatic 23) desktop/src/features/onboarding/ui/SetupStep.tsx:116— SetupStep.RuntimeStatus has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AvatarCustomColorPanel.AvatarCustomColorPanel (cyclomatic 23) desktop/src/features/profile/ui/AvatarCustomColorPanel.tsx:47— AvatarCustomColorPanel.AvatarCustomColorPanel has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 239, 184, 62, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfileAgentActions.UserProfileAgentSettingsMenu (cyclomatic 23) desktop/src/features/profile/ui/UserProfileAgentActions.tsx:24— UserProfileAgentActions.UserProfileAgentSettingsMenu has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectPullRequestFilesChangedPanel.changedFileIconVisual (cyclomatic 23) desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:179— ProjectPullRequestFilesChangedPanel.changedFileIconVisual has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProjectDetailFeedPanels.ContributorsPanel (cyclomatic 23) desktop/src/features/projects/ui/ProjectDetailFeedPanels.tsx:59— ProjectDetailFeedPanels.ContributorsPanel has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 72, 166, 117, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
workflowDefinition.getActionCardClause (cyclomatic 23) desktop/src/features/workflows/ui/workflowDefinition.ts:291— workflowDefinition.getActionCardClause has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BloomMenu.Container (cyclomatic 23) desktop/src/protectedFeatures/bestie/BloomMenu.tsx:130— BloomMenu.Container has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
markdown.ImageBlock (cyclomatic 23) desktop/src/shared/ui/markdown.tsx:986— markdown.ImageBlock has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1089, a function literal at line 1008, a function literal at line 1057, …). 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.
NipFiRelayConfig::from_env (cyclomatic 22) crates/buzz-relay/src/nip_fi_config.rs:296— NipFiRelayConfig::from_env 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.
ClientMessage::parse (cyclomatic 22) crates/buzz-relay/src/protocol.rs:61— ClientMessage::parse 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.
WorkflowEngine::run (cyclomatic 22) crates/buzz-workflow/src/lib.rs:490— WorkflowEngine::run 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.
AppDelegate.handleMediaUploadMethodCall (cyclomatic 22) mobile/ios/Runner/AppDelegate.swift:747— AppDelegate.handleMediaUploadMethodCall 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.
NavigationGlassButtonPlatformView.applyContent (cyclomatic 22) mobile/ios/Runner/JumpToLatestGlassButton.swift:393— NavigationGlassButtonPlatformView.applyContent has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
NativeEmojiCategoryTracker.selectedSectionID (cyclomatic 22) mobile/ios/Runner/NativeEmojiPickerModel.swift:415— NativeEmojiCategoryTracker.selectedSectionID 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.
_MobileHuddleCallPage.build (cyclomatic 22) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:569— _MobileHuddleCallPage.build 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.
ChannelsNotifier.build (cyclomatic 22) mobile/lib/features/channels/channels_provider.dart:144— ChannelsNotifier.build has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsProfileHeader.build (cyclomatic 22) mobile/lib/features/profile/settings_profile_header.dart:30— SettingsProfileHeader.build has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MeSync.update (cyclomatic 22) mobile/lib/shared/me/me_sync.dart:396— MeSync.update 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.
CommunityThemeSyncManager.flush (cyclomatic 22) mobile/lib/shared/theme/community_theme_sync.dart:230— CommunityThemeSyncManager.flush 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.
useCommunities.resolveCommunityUpdateResult (cyclomatic 22) desktop/src/features/communities/useCommunities.tsx:43— useCommunities.resolveCommunityUpdateResult has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ChannelCanvas.ChannelCanvas (cyclomatic 22) desktop/src/features/channels/ui/ChannelCanvas.tsx:28— ChannelCanvas.ChannelCanvas has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DefaultConfigStep.AgentDefaultsSection (cyclomatic 22) desktop/src/features/onboarding/ui/DefaultConfigStep.tsx:51— DefaultConfigStep.AgentDefaultsSection has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemindersPanel.ReminderRow (cyclomatic 22) desktop/src/features/reminders/ui/RemindersPanel.tsx:118— RemindersPanel.ReminderRow has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NotificationSettingsCard.NotificationSettingsCard (cyclomatic 22) desktop/src/features/settings/ui/NotificationSettingsCard.tsx:28— NotificationSettingsCard.NotificationSettingsCard has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowsView.WorkflowsView (cyclomatic 22) desktop/src/features/workflows/ui/WorkflowsView.tsx:104— WorkflowsView.WorkflowsView has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 128, 221, 252, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ReadOnlyRelayClient.handleWsMessage (cyclomatic 22) desktop/src/shared/api/readOnlyRelayClient.ts:216— ReadOnlyRelayClient.handleWsMessage has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
acceptance.explore (cyclomatic 21) docs/formal/nip-pl/acceptance.py:81— acceptance.explore 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.
MediaSanitizer.scrubJpeg (cyclomatic 21) mobile/ios/Runner/MediaSanitizer.swift:93— MediaSanitizer.scrubJpeg 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.
ChannelMessagesNotifier._handleLiveEvent (cyclomatic 21) mobile/lib/features/channels/channel_messages_provider.dart:327— ChannelMessagesNotifier._handleLiveEvent 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.
ProfileTextEditSheet.build (cyclomatic 21) mobile/lib/features/profile/profile_text_edit_sheet.dart:39— ProfileTextEditSheet.build 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.
_SetStatusSheet.build (cyclomatic 21) mobile/lib/features/profile/set_status_sheet.dart:60— _SetStatusSheet.build 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.
IosScrollToTop.build (cyclomatic 21) mobile/lib/shared/widgets/ios_scroll_to_top.dart:17— IosScrollToTop.build 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.
useObserverEvents.useLoadArchivedObserverEvents (cyclomatic 21) desktop/src/features/agents/ui/useObserverEvents.ts:115— useObserverEvents.useLoadArchivedObserverEvents has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 210, 381, 205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ReadStateManager.mergeEvents (cyclomatic 21) desktop/src/features/channels/readState/readStateManager.ts:456— ReadStateManager.mergeEvents 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.
resolveLinkAt.resolveLinkAt (cyclomatic 21) desktop/src/features/messages/lib/resolveLinkAt.ts:22— resolveLinkAt.resolveLinkAt has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SelectionFormattingTray.SelectionFormattingTray (cyclomatic 21) desktop/src/features/messages/ui/SelectionFormattingTray.tsx:112— SelectionFormattingTray.SelectionFormattingTray has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 129, 224, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useChannelTyping.useChannelTyping (cyclomatic 21) desktop/src/features/messages/useChannelTyping.ts:68— useChannelTyping.useChannelTyping has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 81, 140, 179, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
selfProfileStorage.trimSelfProfileCaches (cyclomatic 21) desktop/src/features/profile/lib/selfProfileStorage.ts:185— selfProfileStorage.trimSelfProfileCaches 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.
UserProfilePanelTabs.ProfileLiveActivityEmbed (cyclomatic 21) desktop/src/features/profile/ui/UserProfilePanelTabs.tsx:329— UserProfilePanelTabs.ProfileLiveActivityEmbed 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 7 function literals inside it that branch (lines 382, 364, 430, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfilePrimaryActions.ProfilePrimaryActions (cyclomatic 21) desktop/src/features/profile/ui/UserProfilePrimaryActions.tsx:25— UserProfilePrimaryActions.ProfilePrimaryActions has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
projectActivity.summarizeProjectActivityEvents (cyclomatic 21) desktop/src/features/projects/projectActivity.mjs:48— projectActivity.summarizeProjectActivityEvents 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.
ProjectsActivityFeed.buildActivityItems (cyclomatic 21) desktop/src/features/projects/ui/ProjectsActivityFeed.tsx:107— ProjectsActivityFeed.buildActivityItems has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProjectsActivityFeed.ActivityCard (cyclomatic 21) desktop/src/features/projects/ui/ProjectsActivityFeed.tsx:336— ProjectsActivityFeed.ActivityCard 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.
CronExpressionInput.CronExpressionInput (cyclomatic 21) desktop/src/features/workflows/ui/CronExpressionInput.tsx:14— CronExpressionInput.CronExpressionInput has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 104, 132, 33, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useWebviewScrollBoundaryLock.useWebviewScrollBoundaryLock (cyclomatic 21) desktop/src/shared/hooks/useWebviewScrollBoundaryLock.ts:84— useWebviewScrollBoundaryLock.useWebviewScrollBoundaryLock has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 88, 85). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
compact-link-preview-attachment.CompactLinkPreviewAttachment (cyclomatic 21) desktop/src/shared/ui/compact-link-preview-attachment.tsx:51— compact-link-preview-attachment.CompactLinkPreviewAttachment 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.
PkceOAuthTokenSource::acquire_locked (cyclomatic 20) crates/buzz-agent/src/auth.rs:1090— PkceOAuthTokenSource::acquire_locked has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommandVerifier::authenticate_at (cyclomatic 20) crates/buzz-auth/src/nip_fi/command.rs:325— CommandVerifier::authenticate_at has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz_persona::validate::advisory_check_skill_names (cyclomatic 20) crates/buzz-persona/src/validate.rs:354— buzz_persona::validate::advisory_check_skill_names has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowDef::validate (cyclomatic 20) crates/buzz-workflow/src/schema.rs:173— WorkflowDef::validate has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HuddleAudioEngine.runCapture (cyclomatic 20) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:305— HuddleAudioEngine.runCapture has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeAddMembersSheetCoordinator.handle (cyclomatic 20) mobile/ios/Runner/NativeAddMembersSheet.swift:21— NativeAddMembersSheetCoordinator.handle has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeEmojiPickerDataLoader.parse (cyclomatic 20) mobile/ios/Runner/NativeEmojiPickerModel.swift:117— NativeEmojiPickerDataLoader.parse has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ThemePaginationControl.updateDots (cyclomatic 20) mobile/ios/Runner/ThemePaginationGlassControl.swift:204— ThemePaginationControl.updateDots has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_ThreadStickyDateIndex.resolve (cyclomatic 20) mobile/lib/features/channels/thread_detail_page/sticky_date.dart:46— _ThreadStickyDateIndex.resolve has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_PairingCodeEntry.build (cyclomatic 20) mobile/lib/features/pairing/pairing_page/pairing_code_entry.dart:22— _PairingCodeEntry.build has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PresenceCacheNotifier._refresh (cyclomatic 20) mobile/lib/features/profile/presence_cache_provider.dart:172— PresenceCacheNotifier._refresh has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SelfHostedEntry.prepare (cyclomatic 20) mobile/lib/shared/hosted/self_hosted_entry.dart:61— SelfHostedEntry.prepare has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HuddleSessionNotifier._wireMediaAndTransport (cyclomatic 20) mobile/lib/shared/huddle/huddle_session.dart:407— HuddleSessionNotifier._wireMediaAndTransport has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ToolDetailBlocks.ToolDetailBlocks (cyclomatic 20) desktop/src/features/agents/ui/AgentSessionToolItem/ToolDetailBlocks.tsx:10— ToolDetailBlocks.ToolDetailBlocks has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentSessionTranscriptList.AgentSessionTranscriptList (cyclomatic 20) desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:114— AgentSessionTranscriptList.AgentSessionTranscriptList has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditCommunityDialog.EditCommunityDialog (cyclomatic 20) desktop/src/features/communities/ui/EditCommunityDialog.tsx:34— EditCommunityDialog.EditCommunityDialog has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 70, 55). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useHuddleParticipantRoster.reconstructHuddleParticipantRoster (cyclomatic 20) desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:174— useHuddleParticipantRoster.reconstructHuddleParticipantRoster has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LocalArchiveSettingsCard.LocalArchiveSettingsCard (cyclomatic 20) desktop/src/features/local-archive/ui/LocalArchiveSettingsCard.tsx:391— LocalArchiveSettingsCard.LocalArchiveSettingsCard has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 460, 490, 432, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MeshComputeSettingsCard.StatusLine (cyclomatic 20) desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx:617— MeshComputeSettingsCard.StatusLine has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mentionHighlightExtension.selectionAfterMentionTrailingSpace (cyclomatic 20) REDACTED:602— mentionHighlightExtension.selectionAfterMentionTrailingSpace has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 620, 647). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
NsecMaskedDisplay.NsecMaskedDisplay (cyclomatic 20) desktop/src/features/onboarding/ui/NsecMaskedDisplay.tsx:48— NsecMaskedDisplay.NsecMaskedDisplay has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProfileStep.ProfileStep (cyclomatic 20) desktop/src/features/onboarding/ui/ProfileStep.tsx:194— ProfileStep.ProfileStep has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UserProfilePanelTabs.ProfileInfoTabContent (cyclomatic 20) desktop/src/features/profile/ui/UserProfilePanelTabs.tsx:200— UserProfilePanelTabs.ProfileInfoTabContent has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HarnessCatalogDialog.CatalogDetail (cyclomatic 20) desktop/src/features/settings/ui/HarnessCatalogDialog.tsx:451— HarnessCatalogDialog.CatalogDetail has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
workflowStepDescription.configuredStepDetail (cyclomatic 20) desktop/src/features/workflows/ui/workflowStepDescription.ts:37— workflowStepDescription.configuredStepDetail has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowTemplateTextarea.WorkflowTemplateTextarea (cyclomatic 20) desktop/src/features/workflows/ui/WorkflowTemplateTextarea.tsx:17— WorkflowTemplateTextarea.WorkflowTemplateTextarea has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 104, 140, 41, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RelayClient.sendRawWithReconnectRetry (cyclomatic 20) desktop/src/shared/api/relayClientSession.ts:745— RelayClient.sendRawWithReconnectRetry has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 786, send, isOwned, …). 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.
entityLinks.EntityMetadataTooltip (cyclomatic 20) desktop/src/shared/ui/markdown/entityLinks.tsx:28— entityLinks.EntityMetadataTooltip has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
segmented-control.SegmentedControl (cyclomatic 20) desktop/src/shared/ui/segmented-control.tsx:20— segmented-control.SegmentedControl has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (handlePointerMove, a function literal at line 83, handlePointerDown, …). 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.
installNativeRig.ingest (cyclomatic 20) desktop/src/features/channels/observedUnreadNativeRig.mjs:217— installNativeRig.ingest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeProfileSetupCoordinator.init (cyclomatic 19) mobile/ios/Runner/NativeProfileSetup.swift:26— NativeProfileSetupCoordinator.init 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.
_CommunityGridAction.build (cyclomatic 19) mobile/lib/features/channels/channels_page/community_switcher_action.dart:16— _CommunityGridAction.build 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.
_AttachmentSurfacePanel.build (cyclomatic 19) mobile/lib/features/channels/compose_bar/attachments.dart:152— _AttachmentSurfacePanel.build 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.
_MessageImageCarousel.build (cyclomatic 19) mobile/lib/features/channels/message_content/media_carousel.dart:98— _MessageImageCarousel.build 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.
_ThreadHeadScrollInput.build (cyclomatic 19) mobile/lib/features/channels/thread_detail_page/head_layout.dart:62— _ThreadHeadScrollInput.build 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.
TypingAvatarCluster.build (cyclomatic 19) mobile/lib/features/channels/typing_avatar_cluster.dart:14— TypingAvatarCluster.build 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.
AgentCardViewerDialog.AgentCardViewerContent (cyclomatic 19) desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:90— AgentCardViewerDialog.AgentCardViewerContent has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
agentDefinitionSubmitPayload.buildRuntimeModelProviderPayload (cyclomatic 19) desktop/src/features/agents/ui/agentDefinitionSubmitPayload.ts:13— agentDefinitionSubmitPayload.buildRuntimeModelProviderPayload has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
agentSessionTranscriptGrouping.splitIntoSessionRuns (cyclomatic 19) desktop/src/features/agents/ui/agentSessionTranscriptGrouping.ts:427— agentSessionTranscriptGrouping.splitIntoSessionRuns 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.
ForumView.ForumView (cyclomatic 19) desktop/src/features/forum/ui/ForumView.tsx:45— ForumView.ForumView has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useHuddleParticipantRoster.compareLifecycleEvents (cyclomatic 19) desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:74— useHuddleParticipantRoster.compareLifecycleEvents 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.
useNonMemberInvite.useNonMemberInvite.invite (cyclomatic 19) desktop/src/features/messages/ui/useNonMemberInvite.ts:79— useNonMemberInvite.useNonMemberInvite.invite has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 94, isCurrent, a function literal at line 150, …). 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.
MessageReactions.MessageReactions (cyclomatic 19) desktop/src/features/messages/ui/MessageReactions.tsx:144— MessageReactions.MessageReactions has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 211, 182, 172, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SystemMessageRow.describeSystemEvent (cyclomatic 19) desktop/src/features/messages/ui/SystemMessageRow.tsx:503— SystemMessageRow.describeSystemEvent has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AddProjectRepositoryDialog.AddProjectRepositoryDialog (cyclomatic 19) desktop/src/features/projects/ui/AddProjectRepositoryDialog.tsx:17— AddProjectRepositoryDialog.AddProjectRepositoryDialog has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSubmit, a function literal at line 89, a function literal at line 37, …). 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.
ProjectConversationPanelContext.ProjectConversationPanelController (cyclomatic 19) desktop/src/features/projects/ui/ProjectConversationPanelContext.tsx:37— ProjectConversationPanelContext.ProjectConversationPanelController has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProjectPullRequestFilesChangedPanel.ProjectDiffFilesPanel (cyclomatic 19) desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:757— ProjectPullRequestFilesChangedPanel.ProjectDiffFilesPanel has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CustomHarnessForm.CustomHarnessForm (cyclomatic 19) desktop/src/features/settings/ui/CustomHarnessForm.tsx:206— CustomHarnessForm.CustomHarnessForm has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useChannelMutes.useChannelMutes (cyclomatic 19) desktop/src/features/sidebar/lib/useChannelMutes.ts:19— useChannelMutes.useChannelMutes has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useChannelStars.useChannelStars (cyclomatic 19) desktop/src/features/sidebar/lib/useChannelStars.ts:19— useChannelStars.useChannelStars has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SidebarSection.SidebarSection (cyclomatic 19) desktop/src/features/sidebar/ui/SidebarSection.tsx:376— SidebarSection.SidebarSection has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommunityThemeSyncManager.doPublish (cyclomatic 19) desktop/src/shared/theme/communityThemeSync.ts:199— CommunityThemeSyncManager.doPublish 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.
SpoilerParticles.mountSpoilerParticleCanvas (cyclomatic 19) desktop/src/shared/ui/SpoilerParticles.tsx:74— SpoilerParticles.mountSpoilerParticleCanvas has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (ensureScene, start, draw, …). 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.
AgentSnapshotCard.AgentSnapshotCard (cyclomatic 19) desktop/src/shared/ui/markdown/AgentSnapshotCard.tsx:59— AgentSnapshotCard.AgentSnapshotCard has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
markdown.createMarkdownComponents.a (cyclomatic 19) desktop/src/shared/ui/markdown.tsx:1220— markdown.createMarkdownComponents.a 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.
BuzzBrowserAuthBridge.init (cyclomatic 18) mobile/ios/Runner/AppDelegate.swift:1148— BuzzBrowserAuthBridge.init has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_VideoZoomSurface.build (cyclomatic 18) mobile/lib/features/channels/media_viewer_page/video_zoom_surface.dart:27— _VideoZoomSurface.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MobileHuddleController.end (cyclomatic 18) mobile/lib/features/channels/mobile_huddle_controller.dart:431— MobileHuddleController.end has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InviteJoinSheet.build (cyclomatic 18) mobile/lib/features/invites/invite_join_sheet.dart:70— InviteJoinSheet.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_DynamicIslandQrScannerPortal.build (cyclomatic 18) mobile/lib/features/pairing/pairing_qr_scanner/dynamic_island_portal.dart:11— _DynamicIslandQrScannerPortal.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MethodChannelHuddleMedia._handleNativeCall (cyclomatic 18) mobile/lib/shared/huddle/huddle_media.dart:627— MethodChannelHuddleMedia._handleNativeCall 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.
ReadStateManager._handleIncomingEvent (cyclomatic 18) mobile/lib/shared/read_state/read_state_manager.dart:337— ReadStateManager._handleIncomingEvent has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IosMediaCarousel.build (cyclomatic 18) mobile/lib/shared/widgets/ios_media_carousel.dart:39— IosMediaCarousel.build 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.
AdminConsoleActionsTab.DirectActionsProvider (cyclomatic 18) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:194— AdminConsoleActionsTab.DirectActionsProvider has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 229, a function literal at line 257, locked, …). 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.
AdminConsoleFeedbackTab.AttachmentViewer (cyclomatic 18) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx:171— AdminConsoleFeedbackTab.AttachmentViewer has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 217, 278, 207, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MemorySection.MemoryGraphView (cyclomatic 18) desktop/src/features/agent-memory/ui/MemorySection.tsx:242— MemorySection.MemoryGraphView has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
usePersonaSync.startPersonaSync (cyclomatic 18) desktop/src/features/agents/lib/usePersonaSync.ts:279— usePersonaSync.startPersonaSync has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 8 function items inside it that branch (runBackfill, dispatchLive, onLiveEvent, …). 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.
AgentConfigPanel.AgentConfigSurfaceRows (cyclomatic 18) desktop/src/features/agents/ui/AgentConfigPanel.tsx:374— AgentConfigPanel.AgentConfigSurfaceRows has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useManagedAgentRuntimeReconciliation.useManagedAgentRuntimeReconciliation (cyclomatic 18) desktop/src/features/agents/useManagedAgentRuntimeReconciliation.ts:30— useManagedAgentRuntimeReconciliation.useManagedAgentRuntimeReconciliation has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 75, 54, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useApplyTemplate.useApplyTemplate.applyAgents (cyclomatic 18) desktop/src/features/channel-templates/useApplyTemplate.ts:57— useApplyTemplate.useApplyTemplate.applyAgents 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.
useHuddleParticipantRoster.useHuddleParticipantRoster (cyclomatic 18) desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:277— useHuddleParticipantRoster.useHuddleParticipantRoster has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 295, 310, 307, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ComposerAddressControls.ComposerMentionButton (cyclomatic 18) desktop/src/features/messages/ui/ComposerAddressControls.tsx:129— ComposerAddressControls.ComposerMentionButton has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MessageReactions.ReactionPill (cyclomatic 18) desktop/src/features/messages/ui/MessageReactions.tsx:355— MessageReactions.ReactionPill has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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.
MessageModerationMenuItems.MessageModerationMenuItems (cyclomatic 18) desktop/src/features/moderation/ui/MessageModerationMenuItems.tsx:42— MessageModerationMenuItems.MessageModerationMenuItems has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AvatarStep.AvatarStep (cyclomatic 18) desktop/src/features/onboarding/ui/AvatarStep.tsx:248— AvatarStep.AvatarStep has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
agentReadiness.resolveAgentReadiness (cyclomatic 18) desktop/src/features/onboarding/ui/agentReadiness.ts:21— agentReadiness.resolveAgentReadiness 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.
AnimatedAvatarCameraControls.AnimatedAvatarCameraControls (cyclomatic 18) desktop/src/features/profile/ui/AnimatedAvatarCameraControls.tsx:30— AnimatedAvatarCameraControls.AnimatedAvatarCameraControls 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.
projectDetailAgentContext.projectDetailAgentContextBlock (cyclomatic 18) desktop/src/features/projects/lib/projectDetailAgentContext.ts:223— projectDetailAgentContext.projectDetailAgentContextBlock 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.
ProjectRepositorySource.RepoSourceDropdown (cyclomatic 18) desktop/src/features/projects/ui/ProjectRepositorySource.tsx:218— ProjectRepositorySource.RepoSourceDropdown has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SignOutSection.SignOutSection (cyclomatic 18) desktop/src/features/settings/ui/SignOutSection.tsx:43— SignOutSection.SignOutSection has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
markdownFileCard.resolveSnapshotCard (cyclomatic 18) desktop/src/shared/ui/markdownFileCard.ts:76— markdownFileCard.resolveSnapshotCard has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sidebar-action-card.SidebarCompactActionCard (cyclomatic 18) desktop/src/shared/ui/sidebar-action-card.tsx:188— sidebar-action-card.SidebarCompactActionCard has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buzz-download.normalizeOperatingSystem (cyclomatic 18) web/src/shared/lib/buzz-download.ts:37— buzz-download.normalizeOperatingSystem has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
assignmentStateForIssue (cyclomatic 18) desktop/src/features/projects/projectIssues.mjs:100— assignmentStateForIssue has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
git_sign_nostr::parse_args (cyclomatic 17) crates/git-sign-nostr/src/lib.rs:196— git_sign_nostr::parse_args has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeProfileTextEditorCoordinator.handle (cyclomatic 17) mobile/ios/Runner/NativeProfileTextEditor.swift:27— NativeProfileTextEditorCoordinator.handle has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_MobileHuddleDrawer.build (cyclomatic 17) mobile/lib/features/channels/channel_detail_page/huddle_drawer.dart:130— _MobileHuddleDrawer.build has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_HuddleParticipantCluster.build (cyclomatic 17) mobile/lib/features/channels/channel_detail_page/huddle_participant_cluster.dart:67— _HuddleParticipantCluster.build 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.
_MorphingQuickActionsButton.build (cyclomatic 17) mobile/lib/features/channels/channels_page/quick_actions.dart:35— _MorphingQuickActionsButton.build 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.
_ComposeBarLayout._buildBar (cyclomatic 17) mobile/lib/features/channels/compose_bar/layout.dart:86— _ComposeBarLayout._buildBar has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_DeepLinkDispatcherState._maybeDispatchInvite (cyclomatic 17) mobile/lib/features/channels/deep_link_dispatcher.dart:213— _DeepLinkDispatcherState._maybeDispatchInvite 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.
MessageSwipeReply.build (cyclomatic 17) mobile/lib/features/channels/message_swipe_reply.dart:39— MessageSwipeReply.build has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_PersonInviteSection.build (cyclomatic 17) mobile/lib/features/invites/invite_create_page/person_invite_section.dart:8— _PersonInviteSection.build has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InviteJoinNotifier.confirmJoin (cyclomatic 17) mobile/lib/features/invites/invite_join_provider.dart:161— InviteJoinNotifier.confirmJoin 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.
_SearchBody.build (cyclomatic 17) mobile/lib/features/search/search_page.dart:258— _SearchBody.build has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HuddleSessionNotifier.join (cyclomatic 17) mobile/lib/shared/huddle/huddle_session.dart:221— HuddleSessionNotifier.join 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.
HuddleTransport._handleRoster (cyclomatic 17) mobile/lib/shared/huddle/huddle_transport.dart:641— HuddleTransport._handleRoster 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.
BuzzPushLeaseSubscriptionState.fromJson (cyclomatic 17) mobile/lib/shared/push/push_subscription.dart:377— BuzzPushLeaseSubscriptionState.fromJson has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SkeletonReveal.build (cyclomatic 17) mobile/lib/shared/widgets/skeleton_reveal.dart:36— SkeletonReveal.build has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
channelAgents.provisionChannelManagedAgent (cyclomatic 17) desktop/src/features/agents/channelAgents.ts:319— channelAgents.provisionChannelManagedAgent has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
agentConfigOptions.computeLocalModeGate (cyclomatic 17) REDACTED:659— agentConfigOptions.computeLocalModeGate 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.
EditAgentAdvancedFields.EditAgentAdvancedFields (cyclomatic 17) desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:35— EditAgentAdvancedFields.EditAgentAdvancedFields has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LifecycleActivity.LifecycleActivity (cyclomatic 17) desktop/src/features/agents/ui/activityRenderClasses/LifecycleActivity.tsx:40— LifecycleActivity.LifecycleActivity 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.
agentSessionTranscriptGrouping.buildBlocksForRun (cyclomatic 17) desktop/src/features/agents/ui/agentSessionTranscriptGrouping.ts:599— agentSessionTranscriptGrouping.buildBlocksForRun 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.
useObserverEvents.useLoadArchivedObserverEvents.fetchOlderArchived (cyclomatic 17) desktop/src/features/agents/ui/useObserverEvents.ts:272— useObserverEvents.useLoadArchivedObserverEvents.fetchOlderArchived has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useUnreadChannels.useUnreadChannels.rawUnread (cyclomatic 17) desktop/src/features/channels/useUnreadChannels.ts:798— useUnreadChannels.useUnreadChannels.rawUnread 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.
useChannelUnreadState.useChannelUnreadState (cyclomatic 17) desktop/src/features/channels/ui/useChannelUnreadState.ts:62— useChannelUnreadState.useChannelUnreadState has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 275, 286, 123, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
communityUnreadObserver.fetchCommunityUnread (cyclomatic 17) desktop/src/features/communities/communityUnreadObserver.ts:156— communityUnreadObserver.fetchCommunityUnread 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.
CommunityMembersCard.MemberRow (cyclomatic 17) desktop/src/features/community-members/ui/CommunityMembersCard.tsx:66— CommunityMembersCard.MemberRow 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.
useForumDraftRecovery.useForumDraftRecovery (cyclomatic 17) desktop/src/features/forum/ui/useForumDraftRecovery.ts:26— useForumDraftRecovery.useForumDraftRecovery has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 62, 35, 31). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
channelLink.parseChannelLink (cyclomatic 17) desktop/src/features/messages/lib/channelLink.ts:25— channelLink.parseChannelLink has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
timelineItems.buildTimelineItems (cyclomatic 17) desktop/src/features/messages/lib/timelineItems.ts:174— timelineItems.buildTimelineItems 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.
useLoadMissingAncestors.useLoadMissingAncestors (cyclomatic 17) desktop/src/features/messages/useLoadMissingAncestors.ts:13— useLoadMissingAncestors.useLoadMissingAncestors has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 30, 81, 21). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
hooks.usePresenceSession (cyclomatic 17) desktop/src/features/presence/hooks.ts:224— hooks.usePresenceSession has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 392, 405, 410, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AnimatedAvatarControls.AvatarFilmstripPicker (cyclomatic 17) desktop/src/features/profile/ui/AnimatedAvatarControls.tsx:349— AnimatedAvatarControls.AvatarFilmstripPicker has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 408, 366, 387, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfilePanelUtils.personaManagedAgentUpdate (cyclomatic 17) desktop/src/features/profile/ui/UserProfilePanelUtils.ts:268— UserProfilePanelUtils.personaManagedAgentUpdate has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateProjectWorkItemDialog.CreateProjectWorkItemDialog (cyclomatic 17) desktop/src/features/projects/ui/CreateProjectWorkItemDialog.tsx:25— CreateProjectWorkItemDialog.CreateProjectWorkItemDialog has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (handleSubmit, a function literal at line 99, a function literal at line 59). 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.
CreateProjectFormSettings.CreateProjectFormSettings (cyclomatic 17) desktop/src/features/projects/ui/CreateProjectFormSettings.tsx:26— CreateProjectFormSettings.CreateProjectFormSettings has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, 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.
ProjectsAgentPromptPage.ConversationThread (cyclomatic 17) desktop/src/features/projects/ui/ProjectsAgentPromptPage.tsx:221— ProjectsAgentPromptPage.ConversationThread has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 315, 242, 303, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectHomeContextPanel.ProjectHomeContextPanel (cyclomatic 17) desktop/src/features/projects/ui/ProjectHomeContextPanel.tsx:181— ProjectHomeContextPanel.ProjectHomeContextPanel has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NoteCard.NoteCard (cyclomatic 17) desktop/src/features/pulse/ui/NoteCard.tsx:137— NoteCard.NoteCard has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useSearchResults.useSearchResults.userResults (cyclomatic 17) desktop/src/features/search/useSearchResults.ts:331— useSearchResults.useSearchResults.userResults has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (addCandidate). 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.
PrivateKeyBackupRow.PrivateKeyBackupRow (cyclomatic 17) desktop/src/features/settings/ui/PrivateKeyBackupRow.tsx:60— PrivateKeyBackupRow.PrivateKeyBackupRow has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SidebarDnd.SidebarDndContext (cyclomatic 17) desktop/src/features/sidebar/ui/SidebarDnd.tsx:184— SidebarDnd.SidebarDndContext 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 2 function literals inside it that branch (lines 233, 208). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
workflowConditionExpression.splitTopLevel (cyclomatic 17) REDACTED:202— workflowConditionExpression.splitTopLevel 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.
RelayClient.resetConnection (cyclomatic 17) desktop/src/shared/api/relayClientSession.ts:1124— RelayClient.resetConnection has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RelayReconnectController.start (cyclomatic 17) desktop/src/shared/api/relayReconnectController.ts:130— RelayReconnectController.start has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
emojiOnly.readGrapheme (cyclomatic 17) desktop/src/shared/lib/emojiOnly.ts:36— emojiOnly.readGrapheme 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.
EmojiBurstProvider.EmojiBurstProvider (cyclomatic 17) desktop/src/shared/ui/EmojiBurstProvider.tsx:556— EmojiBurstProvider.EmojiBurstProvider has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 576, 567, 671, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
parseImeta.parseImetaTags (cyclomatic 17) desktop/src/shared/ui/markdown/parseImeta.ts:12— parseImeta.parseImetaTags has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
sidebar.SidebarRail (cyclomatic 17) desktop/src/shared/ui/sidebar.tsx:425— sidebar.SidebarRail has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 515, 484, 455). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buzz_backend_kubernetes::env::build_env (cyclomatic 16) crates/buzz-backend-kubernetes/src/env.rs:166— buzz_backend_kubernetes::env::build_env 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.
BuzzClient::submit_moderation_event (cyclomatic 16) crates/buzz-cli/src/client.rs:980— BuzzClient::submit_moderation_event 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.
DeletionStore::admit_owner_request (cyclomatic 16) REDACTED:914— DeletionStore::admit_owner_request 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.
EntityDeletionStore::transition_stage (cyclomatic 16) REDACTED:214— EntityDeletionStore::transition_stage 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.
buzz_push_gateway::http::deliver (cyclomatic 16) crates/buzz-push-gateway/src/http.rs:634— buzz_push_gateway::http::deliver has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buzz_search::query::search (cyclomatic 16) crates/buzz-search/src/query.rs:230— buzz_search::query::search 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.
AndroidMediaSanitizer.scrubJpeg (cyclomatic 16) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/AndroidMediaSanitizer.kt:44— AndroidMediaSanitizer.scrubJpeg 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.
exhaustive.test_cross_device_compaction_suppression (cyclomatic 16) docs/formal/nip-rs-unread/exhaustive.py:543— exhaustive.test_cross_device_compaction_suppression 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.
IosNavigationBarView.makeControlGroup (cyclomatic 16) mobile/ios/Runner/IosNavigationBar.swift:617— IosNavigationBarView.makeControlGroup 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.
generate-dev-icon.swift.top-level code (cyclomatic 16) scripts/generate-dev-icon.swift:9— generate-dev-icon.swift.top-level code 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.
App.build (cyclomatic 16) mobile/lib/app.dart:305— App.build 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.
ActivityNotifier._resurfaceHiddenDm (cyclomatic 16) mobile/lib/features/activity/activity_provider.dart:301— ActivityNotifier._resurfaceHiddenDm 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.
ChannelMessagesNotifier.cachedThreadReplyIds (cyclomatic 16) mobile/lib/features/channels/channel_messages_provider.dart:579— ChannelMessagesNotifier.cachedThreadReplyIds 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.
_MentionSuggestionInfo.build (cyclomatic 16) mobile/lib/features/channels/compose_bar/suggestions.dart:115— _MentionSuggestionInfo.build 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.
_InlineComponentInputs.== (cyclomatic 16) mobile/lib/features/channels/message_content/inline_components.dart:119— _InlineComponentInputs.== has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_MessageLongPressRegion.build (cyclomatic 16) mobile/lib/features/channels/message_long_press_region.dart:112— _MessageLongPressRegion.build 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.
MessageSkeletonBody.build (cyclomatic 16) mobile/lib/features/channels/message_skeleton_body.dart:24— MessageSkeletonBody.build 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.
PresenceCacheNotifier._subscribe (cyclomatic 16) mobile/lib/features/profile/presence_cache_provider.dart:105— PresenceCacheNotifier._subscribe 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.
_ProfileTextEditSheet.build (cyclomatic 16) mobile/lib/features/profile/profile_edit_page.dart:648— _ProfileTextEditSheet.build 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.
AccountIdentityStore._read (cyclomatic 16) mobile/lib/shared/hosted/account_identity_store.dart:274— AccountIdentityStore._read 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.
BuilderlabAccountClient._request (cyclomatic 16) mobile/lib/shared/hosted/builderlab_account.dart:291— BuilderlabAccountClient._request 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.
HostedFlow._continueCommunities (cyclomatic 16) mobile/lib/shared/hosted/hosted_flow.dart:635— HostedFlow._continueCommunities 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.
MeSync._writeCache (cyclomatic 16) mobile/lib/shared/me/me_sync.dart:277— MeSync._writeCache 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.
BuzzPushLeaseDescriptor.fromRelayInformation (cyclomatic 16) mobile/lib/shared/push/dev_push_lease.dart:43— BuzzPushLeaseDescriptor.fromRelayInformation 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.
_TextEditSheet.build (cyclomatic 16) mobile/lib/shared/widgets/text_editor.dart:93— _TextEditSheet.build has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
backForwardChords.matchBackForwardChord (cyclomatic 16) desktop/src/app/navigation/backForwardChords.ts:18— backForwardChords.matchBackForwardChord 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.
MemorySection.MemoryEntryAccordion (cyclomatic 16) desktop/src/features/agent-memory/ui/MemorySection.tsx:526— MemorySection.MemoryEntryAccordion has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
agentAutocompleteEligibility.getMentionableAgentPubkeys (cyclomatic 16) desktop/src/features/agents/lib/agentAutocompleteEligibility.ts:82— agentAutocompleteEligibility.getMentionableAgentPubkeys 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.
observerRelayStore.appendAgentEvents (cyclomatic 16) desktop/src/features/agents/observerRelayStore.ts:233— observerRelayStore.appendAgentEvents 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.
PersonaAdvancedFields.PersonaAdvancedFields (cyclomatic 16) desktop/src/features/agents/ui/PersonaAdvancedFields.tsx:41— PersonaAdvancedFields.PersonaAdvancedFields has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
usePersonaActions.usePersonaActions.handleSubmit (cyclomatic 16) desktop/src/features/agents/ui/usePersonaActions.ts:175— usePersonaActions.usePersonaActions.handleSubmit 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.
observedUnreadNativeRig.installNativeRig.ingest (cyclomatic 16) desktop/src/features/channels/observedUnreadNativeRig.mjs:217— observedUnreadNativeRig.installNativeRig.ingest 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.
observedUnreadStorage.readObservedUnreadFromStorage (cyclomatic 16) desktop/src/features/channels/observedUnreadStorage.ts:151— observedUnreadStorage.readObservedUnreadFromStorage 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.
CommunityMembersSettingsCard.CommunityMembersSettingsCard (cyclomatic 16) desktop/src/features/community-members/ui/CommunityMembersSettingsCard.tsx:252— CommunityMembersSettingsCard.CommunityMembersSettingsCard has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useEnsureAgentMentionsReady.useEnsureAgentMentionsReady (cyclomatic 16) desktop/src/features/messages/ui/useEnsureAgentMentionsReady.ts:67— useEnsureAgentMentionsReady.useEnsureAgentMentionsReady has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 74). 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.
useAgentAddressLockPicker.useAgentAddressLockPicker.restoreAddressedAgentMentions (cyclomatic 16) desktop/src/features/messages/ui/useAgentAddressLockPicker.ts:346— useAgentAddressLockPicker.useAgentAddressLockPicker.restoreAddressedAgentMentions has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, 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.
MessageComposerToolbar.MessageComposerToolbar (cyclomatic 16) desktop/src/features/messages/ui/MessageComposerToolbar.tsx:35— MessageComposerToolbar.MessageComposerToolbar 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.
TimelineMessageList.TimelineMessageList (cyclomatic 16) desktop/src/features/messages/ui/TimelineMessageList.tsx:127— TimelineMessageList.TimelineMessageList has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 218, 348). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useNewMessageRecipients.useNewMessageRecipients.searchResults::addCandidate (cyclomatic 16) desktop/src/features/messages/ui/useNewMessageRecipients.ts:122— useNewMessageRecipients.useNewMessageRecipients.searchResults::addCandidate has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
desktop.listenForDesktopNotificationActions (cyclomatic 16) desktop/src/features/notifications/lib/desktop.ts:217— desktop.listenForDesktopNotificationActions has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnimatedAvatarBackdropPanel.AnimatedAvatarBackdropPanel (cyclomatic 16) desktop/src/features/profile/ui/AnimatedAvatarBackdropPanel.tsx:20— AnimatedAvatarBackdropPanel.AnimatedAvatarBackdropPanel has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 38, 64). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
projectModels.validateProjectEventEnvelope (cyclomatic 16) desktop/src/features/projects/projectModels.ts:157— projectModels.validateProjectEventEnvelope 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.
ProjectBranchDialogs.CreateProjectBranchDialog (cyclomatic 16) desktop/src/features/projects/ui/ProjectBranchDialogs.tsx:29— ProjectBranchDialogs.CreateProjectBranchDialog 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProjectDetailFeedPanels.ActivityPanel (cyclomatic 16) desktop/src/features/projects/ui/ProjectDetailFeedPanels.tsx:238— ProjectDetailFeedPanels.ActivityPanel has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 326, 345). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectWorkItemContextActions.ProjectWorkItemContextActions (cyclomatic 16) desktop/src/features/projects/ui/ProjectWorkItemContextActions.tsx:13— ProjectWorkItemContextActions.ProjectWorkItemContextActions has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProjectsSectionSearch.ProjectsSectionSearch (cyclomatic 16) desktop/src/features/projects/ui/ProjectsSectionSearch.tsx:14— ProjectsSectionSearch.ProjectsSectionSearch has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useSearchMenuKeyboardNavigation.useSearchMenuKeyboardNavigation (cyclomatic 16) desktop/src/features/search/ui/useSearchMenuKeyboardNavigation.ts:5— useSearchMenuKeyboardNavigation.useSearchMenuKeyboardNavigation has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 43, 29). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HarnessRow.RuntimeOverflowMenu (cyclomatic 16) desktop/src/features/settings/ui/HarnessRow.tsx:77— HarnessRow.RuntimeOverflowMenu has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SettingsView.SettingsView (cyclomatic 16) desktop/src/features/settings/ui/SettingsView.tsx:113— SettingsView.SettingsView has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 134, 181, 188, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
channelSectionsStorage.parseChannelSectionPayload (cyclomatic 16) desktop/src/features/sidebar/lib/channelSectionsStorage.ts:37— channelSectionsStorage.parseChannelSectionPayload has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 43, 74). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ChannelActivityPopover.ChannelActivityPopover (cyclomatic 16) desktop/src/features/sidebar/ui/ChannelActivityPopover.tsx:242— ChannelActivityPopover.ChannelActivityPopover has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 356, 298, 320, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SidebarRelayConnectionCard.SidebarRelayConnectionCompactCard (cyclomatic 16) desktop/src/features/sidebar/ui/SidebarRelayConnectionCard.tsx:50— SidebarRelayConnectionCard.SidebarRelayConnectionCompactCard 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.
rich-link-preview-attachment.RichLinkPreviewAttachment (cyclomatic 16) desktop/src/shared/ui/rich-link-preview-attachment.tsx:235— rich-link-preview-attachment.RichLinkPreviewAttachment 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.
ReposPage.ReposPage (cyclomatic 16) web/src/features/repos/ui/ReposPage.tsx:71— ReposPage.ReposPage has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FixmeComment desktop/tests/e2e/navigation.spec.ts:127— // FIXME: the forum post "Back to posts" header renders under the fixed top — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
HackComment crates/buzz-search/tests/postgres_fts_integration.rs:206— // hack. Postgres FTS over raw JSON content tokenizes through the — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
ProfileAvatarEditor.ProfileAvatarEditor (cognitive 250) desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:67— ProfileAvatarEditor.ProfileAvatarEditor has cognitive complexity 250 (threshold 15). Drivers by points: ternaries 65 (169 pts), if/else 35 (45 pts), boolean chains 36 (nesting depth added 114). Of this number, 148 points are the body's own statements and 102 belong to 26 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ChannelPane.ChannelPane (cognitive 232) desktop/src/features/channels/ui/ChannelPane.tsx:78— ChannelPane.ChannelPane has cognitive complexity 232 (threshold 15). Drivers by points: ternaries 60 (180 pts), boolean chains 38, if/else 6 (10 pts), loops 4 (nesting depth added 124). Of this number, 149 points are the body's own statements and 83 belong to 11 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AgentCreationPreview.AgentCreationPreview (cognitive 231) desktop/src/features/agents/ui/AgentCreationPreview.tsx:47— AgentCreationPreview.AgentCreationPreview has cognitive complexity 231 (threshold 15). Drivers by points: ternaries 66 (164 pts), if/else 29 (34 pts), boolean chains 33 (nesting depth added 103). Of this number, 166 points are the body's own statements and 65 belong to 18 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_MessageList.build (cognitive 229) mobile/lib/features/channels/channel_detail_page/message_list.dart:50— _MessageList.build has cognitive complexity 229 (threshold 15). Drivers by points: boolean chains 100, if/else 76 (94 pts), ternaries 24 (30 pts), loops 4, match/switch 1 (nesting depth added 24). 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.
AgentConfigFields.AgentConfigFields (cognitive 195) desktop/src/features/agents/ui/AgentConfigFields.tsx:212— AgentConfigFields.AgentConfigFields has cognitive complexity 195 (threshold 15). Drivers by points: ternaries 68 (104 pts), boolean chains 53, if/else 30 (36 pts), loops 1 (2 pts) (nesting depth added 43). Of this number, 127 points are the body's own statements and 68 belong to 17 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.
AnimatedAvatarCapture.AnimatedAvatarCapture (cognitive 183) desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:71— AnimatedAvatarCapture.AnimatedAvatarCapture has cognitive complexity 183 (threshold 15). Drivers by points: ternaries 58 (86 pts), boolean chains 56, if/else 30 (36 pts), error handling 4, loops 1 (nesting depth added 34). Of this number, 116 points are the body's own statements and 67 belong to 19 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposeBar.build (cognitive 165) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:33— ComposeBar.build has cognitive complexity 165 (threshold 15). Drivers by points: if/else 63 (108 pts), boolean chains 33, loops 6 (11 pts), error handling 5 (6 pts), ternaries 6, match/switch 1 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadDetailPage.build (cognitive 163) mobile/lib/features/channels/thread_detail_page.dart:110— ThreadDetailPage.build has cognitive complexity 163 (threshold 15). Drivers by points: boolean chains 73, if/else 61 (70 pts), ternaries 15 (16 pts), loops 4 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ImageAvatarCapture.build (cognitive 158) mobile/lib/features/profile/image_avatar_capture.dart:84— ImageAvatarCapture.build has cognitive complexity 158 (threshold 15). Drivers by points: if/else 40 (77 pts), ternaries 39, boolean chains 28, error handling 7 (14 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NostrKeyImportForm.NostrKeyImportForm (cognitive 158) desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:60— NostrKeyImportForm.NostrKeyImportForm has cognitive complexity 158 (threshold 15). Drivers by points: ternaries 45 (105 pts), boolean chains 26, if/else 21 (25 pts), error handling 2 (nesting depth added 64). Of this number, 116 points are the body's own statements and 42 belong to 17 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MachineOnboardingFlow.MachineOnboardingFlow (cognitive 158) desktop/src/features/onboarding/ui/MachineOnboardingFlow.tsx:57— MachineOnboardingFlow.MachineOnboardingFlow has cognitive complexity 158 (threshold 15). Drivers by points: ternaries 35 (131 pts), if/else 10 (16 pts), boolean chains 8, error handling 3 (nesting depth added 102). Of this number, 133 points are the body's own statements and 25 belong to 10 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HostedCommunityOnboarding.HostedCommunityOnboarding (cognitive 156) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:76— HostedCommunityOnboarding.HostedCommunityOnboarding has cognitive complexity 156 (threshold 15). Drivers by points: ternaries 46 (111 pts), if/else 24, boolean chains 20, error handling 1 (nesting depth added 65). Of this number, 107 points are the body's own statements and 49 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.
UserProfilePanel.UserProfilePanel (cognitive 148) desktop/src/features/profile/ui/UserProfilePanel.tsx:105— UserProfilePanel.UserProfilePanel has cognitive complexity 148 (threshold 15). Drivers by points: ternaries 45 (61 pts), boolean chains 43, if/else 34 (36 pts), error handling 5 (6 pts), loops 2 (nesting depth added 19). Of this number, 84 points are the body's own statements and 64 belong to 22 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
agentSessionTranscript.processTranscriptEvent (cognitive 138) desktop/src/features/agents/ui/agentSessionTranscript.ts:700— agentSessionTranscript.processTranscriptEvent has cognitive complexity 138 (threshold 15). Drivers by points: if/else 43 (91 pts), ternaries 9 (35 pts), boolean chains 12 (nesting depth added 74). Of this number, 134 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_ResolvedChannelDetailPage.build (cognitive 136) mobile/lib/features/channels/channel_detail_page.dart:285— _ResolvedChannelDetailPage.build has cognitive complexity 136 (threshold 15). Drivers by points: boolean chains 50, if/else 32 (49 pts), ternaries 24 (27 pts), loops 4 (7 pts), match/switch 2, error handling 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.
WorkflowFormBuilder.WorkflowFormBuilder (cognitive 135) desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx:357— WorkflowFormBuilder.WorkflowFormBuilder has cognitive complexity 135 (threshold 15). Drivers by points: ternaries 37 (84 pts), if/else 23 (31 pts), boolean chains 20 (nesting depth added 55). Of this number, 60 points are the body's own statements and 75 belong to 18 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NostrBindConsentDialog.NostrBindConsentDialog (cognitive 129) desktop/src/features/profile/ui/NostrBindConsentDialog.tsx:213— NostrBindConsentDialog.NostrBindConsentDialog has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 29 (74 pts), if/else 33 (38 pts), boolean chains 15, error handling 1, loops 1 (nesting depth added 50). Of this number, 46 points are the body's own statements and 83 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunityOnboardingFlow.CommunityOnboardingFlow (cognitive 127) desktop/src/features/onboarding/ui/CommunityOnboardingFlow.tsx:157— CommunityOnboardingFlow.CommunityOnboardingFlow has cognitive complexity 127 (threshold 15). Drivers by points: ternaries 32 (68 pts), if/else 24 (28 pts), boolean chains 25, error handling 4 (6 pts) (nesting depth added 42). Of this number, 65 points are the body's own statements and 62 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.
WorkflowTriggerConditions.WorkflowTriggerConditions (cognitive 127) desktop/src/features/workflows/ui/WorkflowTriggerConditions.tsx:130— WorkflowTriggerConditions.WorkflowTriggerConditions has cognitive complexity 127 (threshold 15). Drivers by points: ternaries 24 (105 pts), boolean chains 14, if/else 6 (8 pts) (nesting depth added 83). Most of this is not in the body itself: 8 of the 127 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 275, a function literal at line 177, a function literal at line 154, …). 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.
markdown.ImageZoomOverlay (cognitive 127) desktop/src/shared/ui/markdown.tsx:149— markdown.ImageZoomOverlay has cognitive complexity 127 (threshold 15). Drivers by points: ternaries 41 (58 pts), if/else 40 (43 pts), boolean chains 24, loops 2 (nesting depth added 20). Of this number, 61 points are the body's own statements and 66 belong to 24 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TerminalSubstrate.TerminalSubstrate (cognitive 126) desktop/src/features/terminal/TerminalSubstrate.tsx:80— TerminalSubstrate.TerminalSubstrate has cognitive complexity 126 (threshold 15). Drivers by points: if/else 61 (73 pts), boolean chains 27, ternaries 21 (25 pts), loops 1 (nesting depth added 16). Most of this is not in the body itself: 9 of the 126 points are its own statements and the rest belongs to 39 function items inside it that branch (a function literal at line 190, a function literal at line 398, a function literal at line 685, …). 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.
WorkflowDetailPanel.WorkflowDetailPanel (cognitive 124) desktop/src/features/workflows/ui/WorkflowDetailPanel.tsx:29— WorkflowDetailPanel.WorkflowDetailPanel has cognitive complexity 124 (threshold 15). Drivers by points: ternaries 36 (120 pts), boolean chains 3, error handling 1 (nesting depth added 84). Of this number, 55 points are the body's own statements and 69 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cognitive 122) desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:70— HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard has cognitive complexity 122 (threshold 15). Drivers by points: ternaries 22 (67 pts), if/else 26 (33 pts), boolean chains 20, error handling 2 (nesting depth added 52). Of this number, 72 points are the body's own statements and 50 belong to 19 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AnimatedAvatarCapture.build (cognitive 121) mobile/lib/features/profile/animated_avatar_capture.dart:68— AnimatedAvatarCapture.build has cognitive complexity 121 (threshold 15). Drivers by points: if/else 39 (66 pts), ternaries 17 (24 pts), boolean chains 20, error handling 4 (5 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelDetailsPage.build (cognitive 115) mobile/lib/features/channels/channel_details_page.dart:41— ChannelDetailsPage.build has cognitive complexity 115 (threshold 15). Drivers by points: if/else 28 (51 pts), boolean chains 34, ternaries 20 (24 pts), loops 2 (5 pts), error handling 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.
HuddleContext.HuddleProvider (cognitive 114) desktop/src/features/huddle/HuddleContext.tsx:65— HuddleContext.HuddleProvider has cognitive complexity 114 (threshold 15). Drivers by points: if/else 54 (63 pts), error handling 16 (25 pts), ternaries 12 (14 pts), boolean chains 11, loops 1 (nesting depth added 20). Most of this is not in the body itself: 9 of the 114 points are its own statements and the rest belongs to 35 function literals inside it that branch (lines 492, 832, 626, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentsView.AgentsView (cognitive 113) desktop/src/features/agents/ui/AgentsView.tsx:40— AgentsView.AgentsView has cognitive complexity 113 (threshold 15). Drivers by points: ternaries 36 (56 pts), if/else 28 (50 pts), boolean chains 7 (nesting depth added 42). Of this number, 55 points are the body's own statements and 58 belong to 26 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.
ProjectRepositoryActionsPanel.ProjectRepositoryActionsPanel (cognitive 113) desktop/src/features/projects/ui/ProjectRepositoryActionsPanel.tsx:139— ProjectRepositoryActionsPanel.ProjectRepositoryActionsPanel has cognitive complexity 113 (threshold 15). Drivers by points: ternaries 42 (100 pts), boolean chains 13 (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ChannelManagementSheet.ChannelManagementPanelContent (cognitive 112) desktop/src/features/channels/ui/ChannelManagementSheet.tsx:673— ChannelManagementSheet.ChannelManagementPanelContent has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 39 (109 pts), boolean chains 3 (nesting depth added 70). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MessageTimeline.MessageTimelineBase (cognitive 112) desktop/src/features/messages/ui/MessageTimeline.tsx:162— MessageTimeline.MessageTimelineBase has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 32 (52 pts), boolean chains 35, if/else 23 (25 pts) (nesting depth added 22). Of this number, 77 points are the body's own statements and 35 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeView.HomeView (cognitive 110) desktop/src/features/home/ui/HomeView.tsx:101— HomeView.HomeView has cognitive complexity 110 (threshold 15). Drivers by points: ternaries 32 (53 pts), if/else 21 (30 pts), boolean chains 26, loops 1 (nesting depth added 30). Of this number, 58 points are the body's own statements and 52 belong to 22 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ForumComposer.ForumComposerVisit (cognitive 107) desktop/src/features/forum/ui/ForumComposer.tsx:52— ForumComposer.ForumComposerVisit has cognitive complexity 107 (threshold 15). Drivers by points: if/else 38 (44 pts), boolean chains 35, ternaries 13 (26 pts), error handling 2 (nesting depth added 19). Of this number, 40 points are the body's own statements and 67 belong to 21 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowDialog.WorkflowDialog (cognitive 106) desktop/src/features/workflows/ui/WorkflowDialog.tsx:216— WorkflowDialog.WorkflowDialog has cognitive complexity 106 (threshold 15). Drivers by points: if/else 36 (41 pts), ternaries 22 (32 pts), boolean chains 30, error handling 2 (3 pts) (nesting depth added 16). Of this number, 45 points are the body's own statements and 61 belong to 20 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.
VideoPlayer.VideoReviewDialog (cognitive 106) desktop/src/shared/ui/VideoPlayer.tsx:1198— VideoPlayer.VideoReviewDialog has cognitive complexity 106 (threshold 15). Drivers by points: ternaries 29 (50 pts), if/else 26 (27 pts), boolean chains 24, loops 3 (4 pts), error handling 1 (nesting depth added 23). Of this number, 55 points are the body's own statements and 51 belong to 20 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuddleBar.HuddleBar (cognitive 105) desktop/src/features/huddle/components/HuddleBar.tsx:150— HuddleBar.HuddleBar has cognitive complexity 105 (threshold 15). Drivers by points: if/else 41 (48 pts), boolean chains 28, ternaries 14 (19 pts), error handling 9 (10 pts) (nesting depth added 13). Of this number, 24 points are the body's own statements and 81 belong to 28 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.
InviteRedeemForm.InviteRedeemForm (cognitive 105) desktop/src/features/onboarding/ui/InviteRedeemForm.tsx:63— InviteRedeemForm.InviteRedeemForm has cognitive complexity 105 (threshold 15). Drivers by points: ternaries 34 (57 pts), boolean chains 28, if/else 13 (17 pts), error handling 2 (3 pts) (nesting depth added 28). Of this number, 62 points are the body's own statements and 43 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunityCatalogDialog.CommunityCatalogDialog (cognitive 102) desktop/src/features/agents/ui/CommunityCatalogDialog.tsx:101— CommunityCatalogDialog.CommunityCatalogDialog has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 30 (54 pts), if/else 27 (29 pts), boolean chains 19 (nesting depth added 26). Of this number, 53 points are the body's own statements and 49 belong to 20 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.
MessageRow.MessageRow (cognitive 102) desktop/src/features/messages/ui/MessageRow.tsx:72— MessageRow.MessageRow has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 51 (69 pts), boolean chains 20, if/else 6 (9 pts), error handling 1 (2 pts), loops 1, match/switch 1 (nesting depth added 22). Of this number, 74 points are the body's own statements and 28 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentDefinitionDialog.AgentDefinitionDialog (cognitive 100) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128— AgentDefinitionDialog.AgentDefinitionDialog has cognitive complexity 100 (threshold 15). Drivers by points: boolean chains 52, ternaries 31 (35 pts), if/else 13 (nesting depth added 4). Of this number, 57 points are the body's own statements and 43 belong to 14 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.
MembersSidebar.MembersSidebar (cognitive 99) desktop/src/features/channels/ui/MembersSidebar.tsx:138— MembersSidebar.MembersSidebar has cognitive complexity 99 (threshold 15). Drivers by points: ternaries 31 (47 pts), boolean chains 34, if/else 13, loops 3, error handling 1 (2 pts) (nesting depth added 17). Of this number, 43 points are the body's own statements and 56 belong to 19 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageThreadPanel.MessageThreadPanel (cognitive 99) desktop/src/features/messages/ui/MessageThreadPanel.tsx:145— MessageThreadPanel.MessageThreadPanel has cognitive complexity 99 (threshold 15). Drivers by points: ternaries 34 (54 pts), boolean chains 32, if/else 11, loops 2 (nesting depth added 20). Of this number, 44 points are the body's own statements and 55 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserProfilePanelSections.ProfileSummaryView (cognitive 97) desktop/src/features/profile/ui/UserProfilePanelSections.tsx:136— UserProfilePanelSections.ProfileSummaryView has cognitive complexity 97 (threshold 15). Drivers by points: ternaries 28 (60 pts), boolean chains 25, if/else 10 (11 pts), loops 1 (nesting depth added 33). Of this number, 83 points are the body's own statements and 14 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_PairingWelcomeView.build (cognitive 96) mobile/lib/features/pairing/pairing_page/pairing_welcome_view.dart:56— _PairingWelcomeView.build has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 32 (56 pts), if/else 15 (21 pts), boolean chains 18, loops 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.
HuddleControlAcceptor::serve_control_loop (cognitive 95) crates/buzz-relay/src/audio/join.rs:1302— HuddleControlAcceptor::serve_control_loop has cognitive complexity 95 (threshold 15). Drivers by points: if/else 19 (57 pts), match/switch 13 (33 pts), loops 3 (5 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelBrowserDialog.ChannelBrowserDialog (cognitive 95) desktop/src/features/channels/ui/ChannelBrowserDialog.tsx:102— ChannelBrowserDialog.ChannelBrowserDialog has cognitive complexity 95 (threshold 15). Drivers by points: ternaries 29 (49 pts), if/else 17 (26 pts), boolean chains 17, loops 2, error handling 1 (nesting depth added 29). Of this number, 42 points are the body's own statements and 53 belong to 18 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.
workflowFormTypes.yamlToFormState (cognitive 95) desktop/src/features/workflows/ui/workflowFormTypes.ts:408— workflowFormTypes.yamlToFormState has cognitive complexity 95 (threshold 15). Drivers by points: if/else 34 (65 pts), boolean chains 13, ternaries 4 (10 pts), loops 4 (6 pts), error handling 1 (nesting depth added 39). Of this number, 94 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileSettingsCard.ProfileSettingsCard (cognitive 94) desktop/src/features/settings/ui/ProfileSettingsCard.tsx:135— ProfileSettingsCard.ProfileSettingsCard has cognitive complexity 94 (threshold 15). Drivers by points: ternaries 30 (44 pts), if/else 27 (30 pts), boolean chains 20 (nesting depth added 17). Of this number, 60 points are the body's own statements and 34 belong to 18 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProfileEditPage.build (cognitive 91) mobile/lib/features/profile/profile_edit_page.dart:51— ProfileEditPage.build has cognitive complexity 91 (threshold 15). Drivers by points: if/else 24 (33 pts), ternaries 24 (29 pts), boolean chains 21, error handling 5 (8 pts) (nesting depth added 17). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MessageComposer.MessageComposerImpl (cognitive 91) desktop/src/features/messages/ui/MessageComposer.tsx:70— MessageComposer.MessageComposerImpl has cognitive complexity 91 (threshold 15). Drivers by points: if/else 32 (38 pts), boolean chains 35, ternaries 17 (18 pts) (nesting depth added 7). Of this number, 28 points are the body's own statements and 63 belong to 17 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ProjectPullRequestsPanel.ProjectPullRequestDetail (cognitive 87) desktop/src/features/projects/ui/ProjectPullRequestsPanel.tsx:400— ProjectPullRequestsPanel.ProjectPullRequestDetail has cognitive complexity 87 (threshold 15). Drivers by points: ternaries 37 (71 pts), boolean chains 8, if/else 5 (7 pts), error handling 1 (nesting depth added 36). Of this number, 29 points are the body's own statements and 58 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AudioMessageAttachment.AudioMessageAttachment (cognitive 84) desktop/src/features/messages/ui/AudioMessageAttachment.tsx:111— AudioMessageAttachment.AudioMessageAttachment has cognitive complexity 84 (threshold 15). Drivers by points: ternaries 26 (37 pts), if/else 29 (32 pts), boolean chains 15 (nesting depth added 14). Of this number, 31 points are the body's own statements and 53 belong to 27 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MentionAutocomplete.MentionAutocomplete (cognitive 84) desktop/src/features/messages/ui/MentionAutocomplete.tsx:71— MentionAutocomplete.MentionAutocomplete has cognitive complexity 84 (threshold 15). Drivers by points: ternaries 28 (58 pts), boolean chains 16, if/else 9, loops 1 (nesting depth added 30). Most of this is not in the body itself: 6 of the 84 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 246, 109, 137, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useMentionSendFlow.useMentionSendFlow.completeSend (cognitive 84) desktop/src/features/messages/ui/useMentionSendFlow.ts:284— useMentionSendFlow.useMentionSendFlow.completeSend has cognitive complexity 84 (threshold 15). Drivers by points: if/else 40 (50 pts), boolean chains 19, ternaries 5 (8 pts), error handling 3 (5 pts), loops 2 (nesting depth added 15). Of this number, 49 points are the body's own statements and 35 belong to 9 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.
useMediaUpload.useMediaUpload (cognitive 83) desktop/src/features/messages/lib/useMediaUpload.ts:161— useMediaUpload.useMediaUpload has cognitive complexity 83 (threshold 15). Drivers by points: if/else 40 (48 pts), ternaries 11 (12 pts), boolean chains 10, loops 7, error handling 5 (6 pts) (nesting depth added 10). Most of this is not in the body itself: 2 of the 83 points are its own statements and the rest belongs to 41 function literals inside it that branch (lines 626, 283, 195, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectDetailScreen.ProjectDetailScreen (cognitive 83) desktop/src/features/projects/ui/ProjectDetailScreen.tsx:87— ProjectDetailScreen.ProjectDetailScreen has cognitive complexity 83 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 25, ternaries 20 (25 pts), error handling 4 (nesting depth added 7). Of this number, 41 points are the body's own statements and 42 belong to 16 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
MobilePairingCard.MobilePairingCard (cognitive 82) desktop/src/features/settings/ui/MobilePairingCard.tsx:264— MobilePairingCard.MobilePairingCard has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 15 (47 pts), if/else 21 (22 pts), boolean chains 11, error handling 1, loops 1 (nesting depth added 33). Of this number, 50 points are the body's own statements and 32 belong to 16 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.
PullRequestReviewersRow.PullRequestReviewersRow (cognitive 81) desktop/src/features/projects/ui/PullRequestReviewersRow.tsx:60— PullRequestReviewersRow.PullRequestReviewersRow has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 26 (64 pts), boolean chains 13, if/else 3, error handling 1 (nesting depth added 38). Of this number, 47 points are the body's own statements and 34 belong to 7 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ChannelsPage.build (cognitive 80) mobile/lib/features/channels/channels_page.dart:145— ChannelsPage.build has cognitive complexity 80 (threshold 15). Drivers by points: if/else 32 (40 pts), boolean chains 18, ternaries 12 (17 pts), loops 4 (5 pts) (nesting depth added 14). 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.
HostedIdentityService._resolve (cognitive 80) mobile/lib/shared/hosted/hosted_identity_service.dart:49— HostedIdentityService._resolve has cognitive complexity 80 (threshold 15). Drivers by points: if/else 27 (41 pts), boolean chains 21, ternaries 6 (12 pts), loops 3 (5 pts), error handling 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.
InboxDetailPane.InboxMessageDetailPane (cognitive 80) desktop/src/features/home/ui/InboxDetailPane.tsx:166— InboxDetailPane.InboxMessageDetailPane has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 40 (54 pts), boolean chains 15, if/else 10 (11 pts) (nesting depth added 15). Of this number, 59 points are the body's own statements and 21 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProjectWorkspaceTabs.WorkspaceTabs (cognitive 80) desktop/src/features/projects/ui/ProjectWorkspaceTabs.tsx:86— ProjectWorkspaceTabs.WorkspaceTabs has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 30 (56 pts), boolean chains 14, if/else 10 (nesting depth added 26). Of this number, 69 points are the body's own statements and 11 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelsNotifier._fetchChannels (cognitive 79) mobile/lib/features/channels/channels_provider.dart:258— ChannelsNotifier._fetchChannels has cognitive complexity 79 (threshold 15). Drivers by points: if/else 22 (44 pts), loops 12 (19 pts), boolean chains 14, ternaries 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NewMessageScreen.NewMessageScreen (cognitive 79) desktop/src/features/messages/ui/NewMessageScreen.tsx:29— NewMessageScreen.NewMessageScreen has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 20 (29 pts), if/else 23 (28 pts), boolean chains 20, error handling 2 (nesting depth added 14). Of this number, 21 points are the body's own statements and 58 belong to 14 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EncryptedBackupCreator.EncryptedBackupCreator (cognitive 79) desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:361— EncryptedBackupCreator.EncryptedBackupCreator has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 32 (38 pts), boolean chains 20, if/else 19 (20 pts), error handling 1 (nesting depth added 7). Of this number, 34 points are the body's own statements and 45 belong to 15 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
useObservedUnreadPersistence.useObservedUnreadPersistence (cognitive 78) desktop/src/features/channels/useObservedUnreadPersistence.ts:78— useObservedUnreadPersistence.useObservedUnreadPersistence has cognitive complexity 78 (threshold 15). Drivers by points: if/else 44 (51 pts), boolean chains 14, loops 7, error handling 2 (3 pts), ternaries 3 (nesting depth added 8). None of this is in the body itself: all 78 points belong to 27 function literals inside it that branch (lines 147, 379, 285, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfilePopover.UserProfilePopoverBody (cognitive 78) desktop/src/features/profile/ui/UserProfilePopover.tsx:257— UserProfilePopover.UserProfilePopoverBody has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 27 (53 pts), boolean chains 24, loops 1 (nesting depth added 26). Of this number, 77 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowMessagePicker.WorkflowMessagePicker (cognitive 78) desktop/src/features/workflows/ui/WorkflowMessagePicker.tsx:46— WorkflowMessagePicker.WorkflowMessagePicker has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 22 (33 pts), if/else 20 (25 pts), boolean chains 18, loops 1 (2 pts) (nesting depth added 17). Of this number, 31 points are the body's own statements and 47 belong to 17 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectsView.ProjectsView (cognitive 77) desktop/src/features/projects/ui/ProjectsView.tsx:111— ProjectsView.ProjectsView has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 22 (39 pts), if/else 24, boolean chains 14 (nesting depth added 17). Of this number, 47 points are the body's own statements and 30 belong to 15 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BackupStep.BackupStep (cognitive 76) desktop/src/features/onboarding/ui/BackupStep.tsx:72— BackupStep.BackupStep has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 32 (59 pts), if/else 10 (11 pts), boolean chains 5, error handling 1 (nesting depth added 28). Of this number, 61 points are the body's own statements and 15 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActivityPage.build (cognitive 75) mobile/lib/features/activity/activity_page.dart:75— ActivityPage.build has cognitive complexity 75 (threshold 15). Drivers by points: if/else 32 (50 pts), boolean chains 9, loops 7, ternaries 5 (7 pts), error handling 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedCommunityCreateFlow.HostedCommunityCreateFlow (cognitive 75) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:39— HostedCommunityCreateFlow.HostedCommunityCreateFlow has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 18 (36 pts), if/else 24, boolean chains 14, error handling 1 (nesting depth added 18). Of this number, 41 points are the body's own statements and 34 belong to 16 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.
useAnchoredScroll.useAnchoredScroll (cognitive 75) desktop/src/features/messages/ui/useAnchoredScroll.ts:150— useAnchoredScroll.useAnchoredScroll has cognitive complexity 75 (threshold 15). Drivers by points: if/else 47 (60 pts), boolean chains 13, ternaries 2 (nesting depth added 13). Most of this is not in the body itself: 1 of the 75 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 607, 880, 217, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MessageContent.build (cognitive 74) mobile/lib/features/channels/message_content.dart:198— MessageContent.build has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 25 (45 pts), if/else 9 (11 pts), boolean chains 10, loops 6 (8 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.
ChannelScreen.ChannelScreen (cognitive 74) desktop/src/features/channels/ui/ChannelScreen.tsx:90— ChannelScreen.ChannelScreen has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 19 (35 pts), boolean chains 22, if/else 11 (14 pts), loops 3 (nesting depth added 19). Of this number, 45 points are the body's own statements and 29 belong to 13 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuddlePresenceTracker.apply (cognitive 73) desktop/src/features/huddle/lib/huddlePresence.ts:260— HuddlePresenceTracker.apply has cognitive complexity 73 (threshold 15). Drivers by points: if/else 33 (54 pts), boolean chains 16, loops 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BeeRefreshIndicator.build (cognitive 72) mobile/lib/shared/widgets/bee_refresh_indicator.dart:57— BeeRefreshIndicator.build has cognitive complexity 72 (threshold 15). Drivers by points: if/else 32 (47 pts), boolean chains 14, ternaries 8 (10 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.
IosNavigationBar.build (cognitive 71) mobile/lib/shared/widgets/ios_navigation_bar.dart:162— IosNavigationBar.build has cognitive complexity 71 (threshold 15). Drivers by points: if/else 31 (45 pts), boolean chains 12, loops 7, ternaries 3 (4 pts), error handling 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.test_cross_device_compaction_suppression (cognitive 70) docs/formal/nip-rs-unread/exhaustive.py:543— exhaustive.test_cross_device_compaction_suppression has cognitive complexity 70 (threshold 15). Drivers by points: if/else 7 (47 pts), loops 6 (21 pts), boolean chains 2 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddChannelMembersSheet.build (cognitive 70) mobile/lib/features/channels/add_members_sheet.dart:77— AddChannelMembersSheet.build has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 12 (17 pts), ternaries 11 (13 pts), boolean chains 4, error handling 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManageChannelSheet.build (cognitive 70) mobile/lib/features/channels/manage_channel_sheet.dart:218— ManageChannelSheet.build has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 23, ternaries 9 (17 pts), error handling 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppSidebar.AppSidebar (cognitive 70) desktop/src/features/sidebar/ui/AppSidebar.tsx:80— AppSidebar.AppSidebar has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (31 pts), ternaries 16 (21 pts), boolean chains 11, loops 4 (7 pts) (nesting depth added 13). Of this number, 24 points are the body's own statements and 46 belong to 21 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OnboardingFlow.OnboardingFlow (cognitive 69) desktop/src/features/onboarding/ui/OnboardingFlow.tsx:154— OnboardingFlow.OnboardingFlow has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 21 (41 pts), if/else 12 (14 pts), error handling 4 (9 pts), boolean chains 5 (nesting depth added 27). Of this number, 38 points are the body's own statements and 31 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedAppGate.build (cognitive 68) mobile/lib/hosted_app_gate.dart:31— HostedAppGate.build has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 30, ternaries 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useCommunityInit.useCommunityInit (cognitive 68) desktop/src/features/communities/useCommunityInit.ts:131— useCommunityInit.useCommunityInit has cognitive complexity 68 (threshold 15). Drivers by points: if/else 18 (40 pts), ternaries 3 (12 pts), error handling 5 (9 pts), boolean chains 6, loops 1 (nesting depth added 35). None of this is in the body itself: all 68 points belong to one function literal inside it that branches (line 186). 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.
formatTimelineMessages.formatTimelineMessages (cognitive 67) desktop/src/features/messages/lib/formatTimelineMessages.ts:217— formatTimelineMessages.formatTimelineMessages has cognitive complexity 67 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 18, ternaries 10 (14 pts), loops 5 (6 pts) (nesting depth added 16). Of this number, 46 points are the body's own statements and 21 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedFlow._continue (cognitive 66) mobile/lib/shared/hosted/hosted_flow.dart:450— HostedFlow._continue has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (40 pts), boolean chains 17, loops 2 (6 pts), match/switch 1 (2 pts), ternaries 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.
HuddleIndicator.HuddleIndicator (cognitive 65) desktop/src/features/huddle/components/HuddleIndicator.tsx:47— HuddleIndicator.HuddleIndicator has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (45 pts), boolean chains 12, error handling 2 (3 pts), match/switch 1 (2 pts), ternaries 2, loops 1 (nesting depth added 22). Most of this is not in the body itself: 13 of the 65 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 79, a function literal at line 220, doJoin, …). 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.
CommunitySwitcherPage.build (cognitive 63) mobile/lib/features/channels/channels_page/community_switcher.dart:90— CommunitySwitcherPage.build has cognitive complexity 63 (threshold 15). Drivers by points: if/else 29 (42 pts), ternaries 9 (11 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileAvatarEditor.build (cognitive 63) mobile/lib/features/profile/profile_avatar_editor.dart:133— ProfileAvatarEditor.build has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 17, ternaries 13 (16 pts), match/switch 3, error handling 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TopbarSearch.TopbarSearch (cognitive 63) desktop/src/features/search/ui/TopbarSearch.tsx:376— TopbarSearch.TopbarSearch has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 51 (102 pts), if/else 15 (16 pts), boolean chains 11 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch::renderSearchResultRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
VideoPlayer.VideoPlayer (cognitive 63) desktop/src/shared/ui/VideoPlayer.tsx:674— VideoPlayer.VideoPlayer has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (23 pts), ternaries 18 (23 pts), boolean chains 17 (nesting depth added 10). Of this number, 20 points are the body's own statements and 43 belong to 18 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UsageTracker::record (cognitive 62) crates/buzz-acp/src/usage.rs:560— UsageTracker::record has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 12 (25 pts), boolean chains 9 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelManagementSheet.ChannelManagementSheet (cognitive 61) desktop/src/features/channels/ui/ChannelManagementSheet.tsx:99— ChannelManagementSheet.ChannelManagementSheet has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 20 (33 pts), boolean chains 15, if/else 11, error handling 2 (nesting depth added 13). Of this number, 39 points are the body's own statements and 22 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeviceVoiceNotePlayerController._loadPendingRemote (cognitive 60) mobile/lib/features/channels/voice_note_recording.dart:592— DeviceVoiceNotePlayerController._loadPendingRemote has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (47 pts), boolean chains 12, error handling 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SasVerificationView.build (cognitive 60) mobile/lib/features/pairing/pairing_page/sas_verification_view.dart:28— _SasVerificationView.build has cognitive complexity 60 (threshold 15). Drivers by points: if/else 23 (35 pts), ternaries 8 (13 pts), boolean chains 10, error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modelCapabilities.labelFromModelBody (cognitive 60) desktop/src/features/agents/ui/modelCapabilities.ts:541— modelCapabilities.labelFromModelBody has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 8 (20 pts), boolean chains 14, loops 2 (3 pts) (nesting depth added 21). Of this number, 59 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useUnreadChannels.useUnreadChannels (cognitive 59) desktop/src/features/channels/useUnreadChannels.ts:126— useUnreadChannels.useUnreadChannels has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (39 pts), loops 11 (15 pts), boolean chains 3, ternaries 2 (nesting depth added 19). Most of this is not in the body itself: 2 of the 59 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 677, 267, 288, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentSessionThreadPanel.AgentSessionThreadPanel (cognitive 58) desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx:90— AgentSessionThreadPanel.AgentSessionThreadPanel has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 24 (46 pts), boolean chains 7, if/else 4, error handling 1 (nesting depth added 22). Of this number, 50 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WelcomeSetup.WelcomeSetup (cognitive 58) desktop/src/features/communities/ui/WelcomeSetup.tsx:33— WelcomeSetup.WelcomeSetup has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 21 (55 pts), boolean chains 3 (nesting depth added 34). Of this number, 52 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IdentityRecoveryPairing.IdentityRecoveryPairing (cognitive 58) desktop/src/features/onboarding/ui/IdentityRecoveryPairing.tsx:39— IdentityRecoveryPairing.IdentityRecoveryPairing has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 17 (35 pts), if/else 9 (10 pts), boolean chains 9, error handling 3, loops 1 (nesting depth added 19). Of this number, 32 points are the body's own statements and 26 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.test_compaction_register_exhaustive (cognitive 57) docs/formal/nip-rs-unread/exhaustive.py:341— exhaustive.test_compaction_register_exhaustive has cognitive complexity 57 (threshold 15). Drivers by points: if/else 4 (26 pts), loops 6 (22 pts), ternaries 1 (6 pts), boolean chains 3 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SystemMessageRow.build (cognitive 56) mobile/lib/features/channels/channel_detail_page/system_rows.dart:26— _SystemMessageRow.build has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 18 (28 pts), boolean chains 13, if/else 12 (13 pts), loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunitySwitcher.CommunitySwitcher (cognitive 56) desktop/src/features/communities/ui/CommunitySwitcher.tsx:113— CommunitySwitcher.CommunitySwitcher has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 23 (41 pts), if/else 11, boolean chains 2, error handling 2 (nesting depth added 18). Of this number, 37 points are the body's own statements and 19 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IssueAssigneesRow.IssueAssigneesRow (cognitive 56) desktop/src/features/projects/ui/IssueAssigneesRow.tsx:99— IssueAssigneesRow.IssueAssigneesRow has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 19 (34 pts), boolean chains 16, if/else 4, error handling 2 (nesting depth added 15). Of this number, 29 points are the body's own statements and 27 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useAddProjectRepository.addProjectRepository (cognitive 55) desktop/src/features/projects/useAddProjectRepository.ts:55— useAddProjectRepository.addProjectRepository has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 5 (13 pts), error handling 5 (11 pts), boolean chains 4 (nesting depth added 24). Of this number, 54 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.
OnboardingAppEntry.build (cognitive 54) mobile/lib/onboarding_app_entry.dart:20— OnboardingAppEntry.build has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 29, ternaries 16, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ChannelsNotifier._catchUpUnreadEvents (cognitive 54) mobile/lib/features/channels/channels_provider.dart:713— ChannelsNotifier._catchUpUnreadEvents has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 7 (15 pts), boolean chains 4, error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelActionsSheet.build (cognitive 53) mobile/lib/features/channels/channel_actions_sheet.dart:81— ChannelActionsSheet.build has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 13, ternaries 6 (7 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.
_MessageBubble.build (cognitive 53) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40— _MessageBubble.build has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 19 (24 pts), if/else 10 (14 pts), boolean chains 11, loops 4 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_ThreadMessage.build (cognitive 53) mobile/lib/features/channels/thread_detail_page/thread_message.dart:41— _ThreadMessage.build has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 20 (27 pts), if/else 12 (16 pts), boolean chains 8, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentRuntimeAvatarControl.AgentRuntimeAvatarControl (cognitive 53) desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx:136— AgentRuntimeAvatarControl.AgentRuntimeAvatarControl has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 26 (43 pts), boolean chains 8, if/else 1 (2 pts) (nesting depth added 18). Of this number, 51 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
welcomeKickoff.useWelcomeKickoff (cognitive 53) desktop/src/features/onboarding/welcomeKickoff.ts:494— welcomeKickoff.useWelcomeKickoff has cognitive complexity 53 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 11, ternaries 3, error handling 1, loops 1 (nesting depth added 10). Most of this is not in the body itself: 3 of the 53 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 576, 725, 612, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useLiveChannelUpdates.useLiveChannelUpdates (cognitive 52) desktop/src/features/channels/useLiveChannelUpdates.ts:151— useLiveChannelUpdates.useLiveChannelUpdates has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 12, loops 2, ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 52 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 245, 209, 390, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkflowAuthorPicker.WorkflowAuthorPicker (cognitive 52) desktop/src/features/workflows/ui/WorkflowAuthorPicker.tsx:27— WorkflowAuthorPicker.WorkflowAuthorPicker has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 18 (30 pts), if/else 12 (13 pts), boolean chains 9 (nesting depth added 13). Of this number, 17 points are the body's own statements and 35 belong to 10 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrostedScaffold.build (cognitive 51) mobile/lib/shared/widgets/frosted_scaffold.dart:62— FrostedScaffold.build has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 18, ternaries 6 (9 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ChannelMemberProfileActions.build (cognitive 50) mobile/lib/features/channels/channel_member_profile_actions.dart:26— ChannelMemberProfileActions.build has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 5 (13 pts), boolean chains 12, error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaVideoViewerPage.build (cognitive 50) mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19— MediaVideoViewerPage.build has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (40 pts), boolean chains 5, error handling 3 (4 pts), ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeCommunityEntry.show (cognitive 50) mobile/lib/shared/identity_transfer/native_community_entry.dart:14— NativeCommunityEntry.show has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 3 (9 pts), boolean chains 4, match/switch 2 (4 pts), error handling 3, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposerUploadProgressPill.ComposerUploadProgressPill (cognitive 50) desktop/src/features/messages/ui/ComposerUploadProgressPill.tsx:10— ComposerUploadProgressPill.ComposerUploadProgressPill has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 22 (50 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.test_deep_history_compaction (cognitive 49) docs/formal/nip-rs-unread/exhaustive.py:410— exhaustive.test_deep_history_compaction has cognitive complexity 49 (threshold 15). Drivers by points: loops 7 (28 pts), if/else 3 (21 pts) (nesting depth added 39). 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.
MediaImageViewerPage.build (cognitive 49) mobile/lib/features/channels/media_viewer_page.dart:201— MediaImageViewerPage.build has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (30 pts), boolean chains 11, ternaries 5, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
_CommunityLinkForm.build (cognitive 49) mobile/lib/features/pairing/pairing_page/community_link_form.dart:29— _CommunityLinkForm.build has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 15, if/else 13 (15 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_SliverChannelsList.build (cognitive 48) mobile/lib/features/channels/channels_page/body.dart:107— _SliverChannelsList.build has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 10 (11 pts), boolean chains 8, ternaries 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.
ProfileSetupPage.build (cognitive 48) mobile/lib/features/profile/profile_setup_page.dart:28— ProfileSetupPage.build has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 4 (7 pts), match/switch 3 (6 pts), boolean chains 5, error handling 3 (4 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MeSync.update (cognitive 48) mobile/lib/shared/me/me_sync.dart:396— MeSync.update has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (35 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FrostedAppBar._build (cognitive 48) mobile/lib/shared/widgets/frosted_app_bar.dart:246— FrostedAppBar._build has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 22 (29 pts), boolean chains 15, if/else 3 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AdminConsoleSettingsCard.AdminConsoleSettingsSession (cognitive 48) desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:239— AdminConsoleSettingsCard.AdminConsoleSettingsSession has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (27 pts), ternaries 5 (8 pts), boolean chains 7, error handling 5 (6 pts) (nesting depth added 12). Most of this is not in the body itself: 9 of the 48 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 326, handleSave, a function literal at line 410, …). 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.
AgentDefaultsEditor.AgentDefaultsEditor (cognitive 48) desktop/src/features/agents/ui/AgentDefaultsEditor.tsx:69— AgentDefaultsEditor.AgentDefaultsEditor has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 15 (31 pts), boolean chains 10, if/else 6, error handling 1 (nesting depth added 16). Of this number, 37 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PersonaShareDialog.SnapshotShareDialog (cognitive 48) desktop/src/features/agents/ui/PersonaShareDialog.tsx:228— PersonaShareDialog.SnapshotShareDialog has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 21 (26 pts), if/else 15, boolean chains 6, error handling 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 23 belong to 10 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
useRichTextEditor.useRichTextEditor (cognitive 48) desktop/src/features/messages/lib/useRichTextEditor.ts:145— useRichTextEditor.useRichTextEditor has cognitive complexity 48 (threshold 15). Drivers by points: if/else 32 (36 pts), boolean chains 8, ternaries 2 (3 pts), loops 1 (nesting depth added 5). None of this is in the body itself: all 48 points belong to 10 function items inside it that branch (a function literal at line 424, exitListIfEmptyLast, a function literal at line 281, …). 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.
ProjectRepositoryManagement.ProjectRepositoryManagement (cognitive 48) desktop/src/features/projects/ui/ProjectRepositoryManagement.tsx:24— ProjectRepositoryManagement.ProjectRepositoryManagement has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 17 (32 pts), if/else 3 (7 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 20). Of this number, 31 points are the body's own statements and 17 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectsActivityFeed.buildActivityItems (cognitive 48) desktop/src/features/projects/ui/ProjectsActivityFeed.tsx:107— ProjectsActivityFeed.buildActivityItems has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 10 (34 pts), loops 7 (10 pts), boolean chains 2, if/else 1 (2 pts) (nesting depth added 28). Of this number, 44 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IosNavigationBarView.configure (cognitive 47) mobile/ios/Runner/IosNavigationBar.swift:377— IosNavigationBarView.configure has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 10, ternaries 6 (10 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PairingPage.build (cognitive 47) mobile/lib/features/pairing/pairing_page.dart:86— PairingPage.build has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 15 (17 pts), boolean chains 11 (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.
modelCapabilities.resolveModelCapabilities (cognitive 47) desktop/src/features/agents/ui/modelCapabilities.ts:335— modelCapabilities.resolveModelCapabilities has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (22 pts), ternaries 5 (11 pts), boolean chains 7, loops 3 (7 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MeshComputeSettingsCard.MeshComputeSettingsCard (cognitive 47) desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx:87— MeshComputeSettingsCard.MeshComputeSettingsCard has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 12, if/else 7, error handling 3 (nesting depth added 10). Of this number, 25 points are the body's own statements and 22 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposerAttachments.MediaAttachmentItem (cognitive 47) desktop/src/features/messages/ui/ComposerAttachments.tsx:253— ComposerAttachments.MediaAttachmentItem has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 20 (32 pts), boolean chains 10, if/else 4 (5 pts) (nesting depth added 13). Of this number, 42 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
acceptance.explore (cognitive 46) docs/formal/nip-pl/acceptance.py:81— acceptance.explore has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (36 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeProfileTextEditorViewController.tableView (cognitive 46) mobile/ios/Runner/NativeProfileTextEditor.swift:561— NativeProfileTextEditorViewController.tableView has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 13 (30 pts), if/else 9 (11 pts), boolean chains 5 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelfHostedEntrySheet.build (cognitive 46) mobile/lib/features/onboarding/self_hosted_entry_sheet.dart:95— SelfHostedEntrySheet.build has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 10 (14 pts), boolean chains 9, error handling 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuddleTransport._handleJoined (cognitive 46) mobile/lib/shared/huddle/huddle_transport.dart:450— HuddleTransport._handleJoined has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 20, ternaries 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
App.CommunityApp (cognitive 46) desktop/src/app/App.tsx:362— App.CommunityApp has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 11, ternaries 4 (7 pts) (nesting depth added 7). Of this number, 20 points are the body's own statements and 26 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ManagedAgentLogPanel.ManagedAgentLogPanel (cognitive 46) desktop/src/features/agents/ui/ManagedAgentLogPanel.tsx:9— ManagedAgentLogPanel.ManagedAgentLogPanel has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 17 (40 pts), boolean chains 5, if/else 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.
TimelineMessageList.VirtualizedTimelineRows (cognitive 46) desktop/src/features/messages/ui/TimelineMessageList.tsx:430— TimelineMessageList.VirtualizedTimelineRows has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (25 pts), ternaries 10, boolean chains 8, loops 3 (nesting depth added 2). Most of this is not in the body itself: 2 of the 46 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 504, 637, 720, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TerminalBootstrap.TerminalBootstrap (cognitive 46) desktop/src/features/terminal/TerminalBootstrap.tsx:50— TerminalBootstrap.TerminalBootstrap has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29 (30 pts), boolean chains 9, ternaries 6, loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 46 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 103, 147, 283, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
_NewDirectMessageSheet.build (cognitive 45) mobile/lib/features/channels/channels_page/sheets.dart:441— _NewDirectMessageSheet.build has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 9 (10 pts), boolean chains 8, loops 5 (6 pts), error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AppShell.AppShell (cognitive 45) desktop/src/app/AppShell.tsx:110— AppShell.AppShell has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 20 (24 pts), boolean chains 11, if/else 9, error handling 1 (nesting depth added 4). Of this number, 28 points are the body's own statements and 17 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PulseView.PulseView (cognitive 45) desktop/src/features/pulse/ui/PulseView.tsx:75— PulseView.PulseView has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 16 (28 pts), if/else 7 (8 pts), boolean chains 5, loops 4 (nesting depth added 13). Of this number, 23 points are the body's own statements and 22 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mentionBoundaries.maskMarkdownCode (cognitive 45) REDACTED:35— mentionBoundaries.maskMarkdownCode has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 8 (13 pts), boolean chains 11 (nesting depth added 17). Of this number, 42 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nostr-client.queryEvents (cognitive 45) web/src/shared/lib/nostr-client.ts:33— nostr-client.queryEvents has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 3 (10 pts), boolean chains 5, error handling 3 (4 pts) (nesting depth added 15). None of this is in the body itself: all 45 points belong to 6 function literals inside it that branch (lines 80, 55, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BuzzClient::submit_moderation_event (cognitive 44) crates/buzz-cli/src/client.rs:980— BuzzClient::submit_moderation_event has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (38 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedBackupService._backup (cognitive 44) mobile/lib/shared/hosted/hosted_backup_service.dart:47— HostedBackupService._backup has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (29 pts), error handling 7 (10 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunityEditForm.CommunityEditForm (cognitive 44) desktop/src/features/communities/ui/CommunityEditForm.tsx:29— CommunityEditForm.CommunityEditForm has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 13, ternaries 8 (12 pts), error handling 1 (2 pts) (nesting depth added 9). Of this number, 18 points are the body's own statements and 26 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DownloadKeyStep.DownloadKeyStep (cognitive 44) desktop/src/features/onboarding/ui/DownloadKeyStep.tsx:34— DownloadKeyStep.DownloadKeyStep has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 30 (44 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.
ProjectReadmePanel.ReadmePanel (cognitive 44) desktop/src/features/projects/ui/ProjectReadmePanel.tsx:94— ProjectReadmePanel.ReadmePanel has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 18 (37 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useResolvedLinkPreviews.useResolvedLinkPreviews (cognitive 44) desktop/src/shared/lib/useResolvedLinkPreviews.ts:646— useResolvedLinkPreviews.useResolvedLinkPreviews has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 6 (14 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 21). None of this is in the body itself: all 44 points belong to 9 function literals inside it that branch (lines 695, 756, 771, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentCardMintDialog.AgentCardMintDialog (cognitive 43) desktop/src/features/agents/ui/AgentCardMintDialog.tsx:106— AgentCardMintDialog.AgentCardMintDialog has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 17 (38 pts), boolean chains 5 (nesting depth added 21). Of this number, 40 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RespondToField.AllowlistPicker (cognitive 43) desktop/src/features/agents/ui/RespondToField.tsx:282— RespondToField.AllowlistPicker has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 18 (39 pts), boolean chains 4 (nesting depth added 21). Of this number, 39 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
useTtsSubscription.useTtsSubscription (cognitive 43) desktop/src/features/huddle/lib/useTtsSubscription.ts:36— useTtsSubscription.useTtsSubscription has cognitive complexity 43 (threshold 15). Drivers by points: if/else 30 (34 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). None of this is in the body itself: all 43 points belong to 16 function literals inside it that branch (lines 130, 193, 291, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PullRequestReviewCard.PullRequestReviewCard (cognitive 43) desktop/src/features/projects/ui/PullRequestReviewCard.tsx:47— PullRequestReviewCard.PullRequestReviewCard has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 13 (20 pts), boolean chains 16, if/else 5, error handling 2 (nesting depth added 7). Of this number, 25 points are the body's own statements and 18 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MePage.build (cognitive 42) mobile/lib/features/channels/me/me_page.dart:48— MePage.build has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 11, loops 4 (7 pts), ternaries 3, error handling 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PairingNotifier._handlePairingEvent (cognitive 42) mobile/lib/features/pairing/pairing_provider.dart:499— PairingNotifier._handlePairingEvent has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 8, error handling 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useInboxSelectionAnchor.useInboxSelectionAnchor (cognitive 42) desktop/src/features/home/useInboxSelectionAnchor.ts:66— useInboxSelectionAnchor.useInboxSelectionAnchor has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 14, ternaries 4 (6 pts) (nesting depth added 5). Of this number, 16 points are the body's own statements and 26 belong to 9 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
useHuddleParticipantRoster.reconstructHuddleParticipantRoster (cognitive 42) desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:174— useHuddleParticipantRoster.reconstructHuddleParticipantRoster has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (35 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaskedAvatarBadgeFrame.MaskedAvatarBadgeFrame (cognitive 42) desktop/src/features/profile/ui/MaskedAvatarBadgeFrame.tsx:751— MaskedAvatarBadgeFrame.MaskedAvatarBadgeFrame has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 21 (27 pts), boolean chains 14, if/else 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
relayReconnectReplay.replayLiveSubscriptions (cognitive 42) desktop/src/shared/api/relayReconnectReplay.ts:181— relayReconnectReplay.replayLiveSubscriptions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 9, ternaries 4 (5 pts), error handling 1 (2 pts), loops 2 (nesting depth added 14). Most of this is not in the body itself: 9 of the 42 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 352, a function literal at line 231, a function literal at line 308, …). 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.
HuddleAudioEngine.runCapture (cognitive 41) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:305— HuddleAudioEngine.runCapture has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 3 (6 pts), boolean chains 3, error handling 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.
exhaustive.test_tombstone_stale_merge_direct (cognitive 41) docs/formal/nip-rs-unread/exhaustive.py:475— exhaustive.test_tombstone_stale_merge_direct has cognitive complexity 41 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 3 (19 pts), boolean chains 1 (nesting depth added 31). 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.
NativeProfileSetupCoordinator.openAvatar (cognitive 41) mobile/ios/Runner/NativeProfileSetup.swift:74— NativeProfileSetupCoordinator.openAvatar has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 17, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 4). Of this number, 34 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit (cognitive 41) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:649— AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 18 (29 pts), boolean chains 6, if/else 4, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TopbarSearch.TopbarSearch::renderSearchResultRow (cognitive 41) desktop/src/features/search/ui/TopbarSearch.tsx:655— TopbarSearch.TopbarSearch::renderSearchResultRow has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 25 (40 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TopbarSearch.TopbarSearch) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChannelCombobox.ChannelCombobox (cognitive 41) desktop/src/features/workflows/ui/ChannelCombobox.tsx:52— ChannelCombobox.ChannelCombobox has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 13 (20 pts), boolean chains 13, if/else 6 (7 pts), match/switch 1 (nesting depth added 8). Of this number, 23 points are the body's own statements and 18 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeviceVoiceNotePlayerController._toggle (cognitive 40) mobile/lib/features/channels/voice_note_recording.dart:808— DeviceVoiceNotePlayerController._toggle has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 11 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
agentSessionTranscriptHelpers.parseSystemPromptSections (cognitive 40) REDACTED:138— agentSessionTranscriptHelpers.parseSystemPromptSections has cognitive complexity 40 (threshold 15). Drivers by points: if/else 31 (57 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (agentSessionTranscriptHelpers.parseSystemPromptSections::appendBaseAndWorkspace) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
CustomEmojiSettingsCard.CustomEmojiSettingsCard (cognitive 40) desktop/src/features/custom-emoji/ui/CustomEmojiSettingsCard.tsx:31— CustomEmojiSettingsCard.CustomEmojiSettingsCard has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 15 (23 pts), boolean chains 9, if/else 5, error handling 3 (nesting depth added 8). Of this number, 23 points are the body's own statements and 17 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileAvatar.ProfileAvatar (cognitive 40) desktop/src/features/profile/ui/ProfileAvatar.tsx:57— ProfileAvatar.ProfileAvatar has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 18 (28 pts), boolean chains 8, if/else 2 (4 pts) (nesting depth added 12). Of this number, 35 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HarnessCatalogDialog.HarnessCatalogDialog (cognitive 40) desktop/src/features/settings/ui/HarnessCatalogDialog.tsx:57— HarnessCatalogDialog.HarnessCatalogDialog has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 14 (30 pts), boolean chains 6, if/else 4 (nesting depth added 16). Of this number, 35 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workflowTriggerDescription.workflowTriggerDescription (cognitive 40) desktop/src/features/workflows/ui/workflowTriggerDescription.ts:121— workflowTriggerDescription.workflowTriggerDescription has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 7 (14 pts), boolean chains 9 (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.
_InboxRow.build (cognitive 39) mobile/lib/features/activity/activity_page/inbox_row.dart:68— _InboxRow.build has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 10 (12 pts), boolean chains 8, loops 4 (5 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
VoiceNoteComposerRecorder.build (cognitive 39) mobile/lib/features/channels/voice_note_composer_recorder.dart:35— VoiceNoteComposerRecorder.build has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 6 (9 pts), boolean chains 6, error handling 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PresenceCacheNotifier._refresh (cognitive 39) mobile/lib/features/profile/presence_cache_provider.dart:172— PresenceCacheNotifier._refresh has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserAuth.receive (cognitive 39) mobile/lib/shared/hosted/browser_auth.dart:169— BrowserAuth.receive has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 11, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedFlow._initialize (cognitive 39) mobile/lib/shared/hosted/hosted_flow.dart:208— HostedFlow._initialize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 8 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedRelayAuth._issue (cognitive 39) mobile/lib/shared/hosted/hosted_relay_auth.dart:97— HostedRelayAuth._issue has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 9, error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentInstanceEditDialog.AgentInstanceEditDialog (cognitive 39) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:102— AgentInstanceEditDialog.AgentInstanceEditDialog has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 48 (62 pts), boolean chains 31, if/else 21, error handling 2 (nesting depth added 14). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (AgentInstanceEditDialog.AgentInstanceEditDialog::handleSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ReadStateManager.mergeEvents (cognitive 39) desktop/src/features/channels/readState/readStateManager.ts:456— ReadStateManager.mergeEvents has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 6 (12 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddMemberDialog.DirectAddMemberForm (cognitive 39) desktop/src/features/community-members/ui/AddMemberDialog.tsx:51— AddMemberDialog.DirectAddMemberForm has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 18 (24 pts), boolean chains 8, if/else 4 (5 pts), error handling 1, loops 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 17 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.
SystemMessageRow.SystemMessageRow (cognitive 39) desktop/src/features/messages/ui/SystemMessageRow.tsx:649— SystemMessageRow.SystemMessageRow has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 18 (24 pts), boolean chains 9, if/else 5 (6 pts) (nesting depth added 7). Of this number, 29 points are the body's own statements and 10 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CreatePullRequestDialog.CreatePullRequestDialog (cognitive 39) desktop/src/features/projects/ui/CreatePullRequestDialog.tsx:21— CreatePullRequestDialog.CreatePullRequestDialog has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 10 (26 pts), boolean chains 8, if/else 5 (nesting depth added 16). Of this number, 28 points are the body's own statements and 11 belong to 7 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
entityLink.parseEntityLink (cognitive 39) desktop/src/shared/lib/entityLink.ts:187— entityLink.parseEntityLink has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 11, ternaries 5 (9 pts), loops 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NewMeChat.build (cognitive 38) mobile/lib/features/channels/me/new_me_chat.dart:5— _NewMeChat.build has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 10, ternaries 9, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CommunityThemeNotifier.build (cognitive 38) mobile/lib/shared/theme/community_theme_provider.dart:25— CommunityThemeNotifier.build has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 8, ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM (cognitive 38) desktop/src/features/messages/lib/plainTextProjection.ts:231— plainTextProjection.buildPlainTextProjection.mapTextOffsetToPM has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 3 (7 pts), boolean chains 2, loops 1 (nesting depth added 16). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposerImageEditor.ComposerImageEditor (cognitive 38) desktop/src/features/messages/ui/ComposerImageEditor.tsx:134— ComposerImageEditor.ComposerImageEditor has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19, boolean chains 14, ternaries 3, error handling 1, loops 1. Most of this is not in the body itself: 4 of the 38 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 220, 252, 274, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SetupStep.RuntimeCard (cognitive 38) desktop/src/features/onboarding/ui/SetupStep.tsx:420— SetupStep.RuntimeCard has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 16 (27 pts), boolean chains 10, if/else 1 (nesting depth added 11). Of this number, 36 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VoiceSettingsCard.VoiceSettingsCard (cognitive 38) desktop/src/features/settings/ui/VoiceSettingsCard.tsx:49— VoiceSettingsCard.VoiceSettingsCard has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 8, if/else 8, error handling 5 (6 pts) (nesting depth added 7). Most of this is not in the body itself: 11 of the 38 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 84, 135, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
InvitePage.InvitePage (cognitive 38) web/src/features/invite/ui/InvitePage.tsx:42— InvitePage.InvitePage has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 12, boolean chains 10, error handling 1 (nesting depth added 4). Of this number, 22 points are the body's own statements and 16 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.
_RecentPhotoGalleryPicker.build (cognitive 37) mobile/lib/features/channels/compose_bar/photo_gallery_picker.dart:48— _RecentPhotoGalleryPicker.build has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 13 (20 pts), if/else 12 (15 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.
ProfileSetupAvatarEditor.build (cognitive 37) mobile/lib/features/profile/profile_setup_avatar_editor.dart:28— ProfileSetupAvatarEditor.build has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 9 (11 pts), boolean chains 5, error handling 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.
AdminConsoleStaffingTab.RestrictionsSection (cognitive 37) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:160— AdminConsoleStaffingTab.RestrictionsSection has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 15, if/else 8 (10 pts), ternaries 9 (10 pts), error handling 2 (nesting depth added 3). Of this number, 24 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ChannelMemberInviteCard.ChannelMemberInviteCard (cognitive 37) desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx:26— ChannelMemberInviteCard.ChannelMemberInviteCard has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (28 pts), boolean chains 6, if/else 3 (nesting depth added 13). Of this number, 21 points are the body's own statements and 16 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useCommunityJoinAlerts.useCommunityJoinAlerts (cognitive 37) desktop/src/features/community-members/useCommunityJoinAlerts.ts:149— useCommunityJoinAlerts.useCommunityJoinAlerts has cognitive complexity 37 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 7, loops 2, error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 13 function literals inside it that branch (lines 303, 231, 523, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useVoiceNoteRecorder.useVoiceNoteRecorder.start (cognitive 37) desktop/src/features/messages/lib/useVoiceNoteRecorder.ts:68— useVoiceNoteRecorder.useVoiceNoteRecorder.start has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 12, error handling 2 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 15 of the 37 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 125, 184, 175, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow (cognitive 37) desktop/src/features/messages/ui/useMentionSendFlow.ts:723— useMentionSendFlow.useMentionSendFlow.sendMessageWithMentionFlow has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 6, ternaries 3 (4 pts), error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 8). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
ProjectConversationPanel.ProjectConversationPanel (cognitive 37) desktop/src/features/projects/ui/ProjectConversationPanel.tsx:37— ProjectConversationPanel.ProjectConversationPanel has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 15, ternaries 12 (14 pts), if/else 8 (nesting depth added 2). Of this number, 30 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ProjectRepositoryPanel.RepositoryFilesPanel (cognitive 37) desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:614— ProjectRepositoryPanel.RepositoryFilesPanel has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (23 pts), boolean chains 7, if/else 5 (7 pts) (nesting depth added 10). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelTemplatesSettingsCard.TemplateFormDialog (cognitive 37) desktop/src/features/settings/ui/ChannelTemplatesSettingsCard.tsx:291— ChannelTemplatesSettingsCard.TemplateFormDialog has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 7 (11 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 10). Most of this is not in the body itself: 9 of the 37 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 326, handleSubmit, a function literal at line 361, …). 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.
MessageLinkPill.MessageLinkPillContents (cognitive 37) desktop/src/shared/ui/markdown/MessageLinkPill.tsx:149— MessageLinkPill.MessageLinkPillContents has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 12 (24 pts), if/else 5 (8 pts), boolean chains 5 (nesting depth added 15). Of this number, 28 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitStore::run_conformance_probe (cognitive 36) crates/buzz-relay/src/api/git/store.rs:576— GitStore::run_conformance_probe has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 8 (12 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
managedAgentControlActions.deleteManagedAgentWithRules (cognitive 36) desktop/src/features/agents/lib/managedAgentControlActions.ts:151— managedAgentControlActions.deleteManagedAgentWithRules has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 2, ternaries 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UserMessageBubble.UserMessageBubble (cognitive 36) desktop/src/features/agents/ui/activityRenderClasses/UserMessageBubble.tsx:17— UserMessageBubble.UserMessageBubble has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 13 (20 pts), boolean chains 11, if/else 3 (5 pts) (nesting depth added 9). Of this number, 28 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TeamDialog.TeamDialog (cognitive 36) desktop/src/features/agents/ui/TeamDialog.tsx:44— TeamDialog.TeamDialog has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 12, if/else 10 (12 pts), ternaries 9 (12 pts) (nesting depth added 5). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 12 function items inside it that branch (buildSubmitInput, handleSubmit, a function literal at line 275, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ChannelScreenHeader.ChannelScreenHeader (cognitive 36) desktop/src/features/channels/ui/ChannelScreenHeader.tsx:55— ChannelScreenHeader.ChannelScreenHeader has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15 (30 pts), boolean chains 5, if/else 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MembersSidebarMemberCard.MemberActionsMenu (cognitive 36) desktop/src/features/channels/ui/MembersSidebarMemberCard.tsx:306— MembersSidebarMemberCard.MemberActionsMenu has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 17 (28 pts), boolean chains 6, if/else 1 (2 pts) (nesting depth added 12). Of this number, 31 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MicControls.MicControls (cognitive 36) desktop/src/features/huddle/components/MicControls.tsx:94— MicControls.MicControls has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 19 (22 pts), boolean chains 13, if/else 1 (nesting depth added 3). Of this number, 33 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SetupStep.RuntimeProvidersSection (cognitive 36) desktop/src/features/onboarding/ui/SetupStep.tsx:662— SetupStep.RuntimeProvidersSection has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 18 (31 pts), boolean chains 3, if/else 2 (nesting depth added 13). Of this number, 29 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergePullRequestButton.MergePullRequestButton (cognitive 36) desktop/src/features/projects/ui/MergePullRequestButton.tsx:38— MergePullRequestButton.MergePullRequestButton has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 13 (19 pts), if/else 8 (9 pts), boolean chains 5, error handling 3 (nesting depth added 7). Of this number, 16 points are the body's own statements and 20 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelContextMenu.ChannelContextMenuItems (cognitive 36) desktop/src/features/sidebar/ui/ChannelContextMenu.tsx:142— ChannelContextMenu.ChannelContextMenuItems has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 17 (21 pts), boolean chains 13, loops 1 (2 pts) (nesting depth added 5). Of this number, 32 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SidebarProjectsSection.SidebarProjectsSectionContent (cognitive 36) desktop/src/features/sidebar/ui/SidebarProjectsSection.tsx:128— SidebarProjectsSection.SidebarProjectsSectionContent has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 7, if/else 6, error handling 1 (nesting depth added 11). Most of this is not in the body itself: 13 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 226, a function literal at line 299, handleRemove, …). 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.
buzz_pubsub::subscriber::connect_and_subscribe (cognitive 35) crates/buzz-pubsub/src/subscriber.rs:75— buzz_pubsub::subscriber::connect_and_subscribe has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (19 pts), match/switch 5 (14 pts), loops 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NipFiRelayConfig::from_env (cognitive 35) crates/buzz-relay/src/nip_fi_config.rs:296— NipFiRelayConfig::from_env has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (4 pts), boolean chains 3, match/switch 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_HuddleCallAvatar.build (cognitive 35) mobile/lib/features/channels/channel_detail_page/huddle_call_avatar.dart:32— _HuddleCallAvatar.build has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 18, boolean chains 9, if/else 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_IOSInlinePhotoPicker.build (cognitive 35) mobile/lib/features/channels/compose_bar/ios_photo_picker.dart:23— _IOSInlinePhotoPicker.build has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 7, ternaries 6, loops 1 (2 pts), error handling 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedConnectSheet.build (cognitive 35) mobile/lib/features/onboarding/hosted_connect_sheet.dart:19— HostedConnectSheet.build has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 13, ternaries 6 (12 pts), if/else 8, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useComposerLinkPreviews.useComposerLinkPreviews (cognitive 35) desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:273— useComposerLinkPreviews.useComposerLinkPreviews has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, ternaries 4 (5 pts), loops 4 (nesting depth added 10). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 443, 385, 411, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
terminalBanner.buildTerminalBanner (cognitive 35) desktop/src/features/terminal/terminalBanner.ts:121— terminalBanner.buildTerminalBanner has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 10 (13 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SetStatusDialog.SetStatusDialog (cognitive 35) desktop/src/features/user-status/ui/SetStatusDialog.tsx:184— SetStatusDialog.SetStatusDialog has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (10 pts), ternaries 8 (9 pts), match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 213, handleSave, expirationUnixSeconds, …). 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.
ActivityNotifier._resurfaceHiddenDm (cognitive 34) mobile/lib/features/activity/activity_provider.dart:301— ActivityNotifier._resurfaceHiddenDm has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_InlineCameraPreview.build (cognitive 34) mobile/lib/features/channels/compose_bar/camera_preview.dart:14— _InlineCameraPreview.build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 5, ternaries 4, error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileAvatarCropPage.build (cognitive 34) mobile/lib/features/profile/profile_avatar_crop_page.dart:23— ProfileAvatarCropPage.build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 8, boolean chains 6 (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.
agentConfigControls.AgentModelField (cognitive 34) desktop/src/features/agents/ui/agentConfigControls.tsx:337— agentConfigControls.AgentModelField has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 18, ternaries 12 (14 pts), if/else 2 (nesting depth added 2). Of this number, 29 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
InboxMessageRow.InboxMessageRow (cognitive 34) desktop/src/features/home/ui/InboxMessageRow.tsx:55— InboxMessageRow.InboxMessageRow has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 21 (30 pts), boolean chains 4 (nesting depth added 9). Of this number, 31 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageActionBar.MoreActionsMenu (cognitive 34) desktop/src/features/messages/ui/MessageActionBar.tsx:86— MessageActionBar.MoreActionsMenu has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 18 (22 pts), if/else 5 (7 pts), boolean chains 5 (nesting depth added 6). Of this number, 27 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
hooks.useAppOnboardingState (cognitive 34) desktop/src/features/onboarding/hooks.ts:466— hooks.useAppOnboardingState has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 10, ternaries 4 (10 pts) (nesting depth added 9). Of this number, 17 points are the body's own statements and 17 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectChannelHome.ProjectChannelHome (cognitive 34) desktop/src/features/projects/ui/ProjectChannelHome.tsx:87— ProjectChannelHome.ProjectChannelHome has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 13 (22 pts), boolean chains 7, if/else 5 (nesting depth added 9). Of this number, 27 points are the body's own statements and 7 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HarnessRow.HarnessRow (cognitive 34) desktop/src/features/settings/ui/HarnessRow.tsx:297— HarnessRow.HarnessRow has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 17 (23 pts), boolean chains 6, if/else 5 (nesting depth added 6). Of this number, 26 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AppDelegate.didInitializeImplicitFlutterEngine (cognitive 33) mobile/ios/Runner/AppDelegate.swift:68— AppDelegate.didInitializeImplicitFlutterEngine has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (26 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
VoiceNoteAttachment.build (cognitive 33) mobile/lib/features/channels/voice_note_attachment.dart:45— VoiceNoteAttachment.build has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 20, if/else 6 (7 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PairingNotifier._continueAfterSas (cognitive 33) mobile/lib/features/pairing/pairing_provider.dart:188— PairingNotifier._continueAfterSas has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 16, if/else 11 (16 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedAdmission.prepare (cognitive 33) mobile/lib/shared/hosted/hosted_admission.dart:38— HostedAdmission.prepare has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 10, error handling 2 (5 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MembersSidebarMemberCard.MembersSidebarMemberCard (cognitive 33) desktop/src/features/channels/ui/MembersSidebarMemberCard.tsx:121— MembersSidebarMemberCard.MembersSidebarMemberCard has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 14 (24 pts), boolean chains 9 (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.
hooks.useChannelSubscription (cognitive 33) desktop/src/features/messages/hooks.ts:319— hooks.useChannelSubscription has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (nesting depth added 6). None of this is in the body itself: all 33 points belong to 10 function literals inside it that branch (lines 328, 399, 407, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
plainTextProjection.buildPlainTextProjection.mapPMToTextOffset (cognitive 33) desktop/src/features/messages/lib/plainTextProjection.ts:204— plainTextProjection.buildPlainTextProjection.mapPMToTextOffset has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SetupStep.RuntimeStatus (cognitive 33) desktop/src/features/onboarding/ui/SetupStep.tsx:116— SetupStep.RuntimeStatus has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 7 (14 pts), boolean chains 4 (nesting depth added 11). Of this number, 26 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserProfilePanelTabs.ProfileRuntimeTabContent (cognitive 33) desktop/src/features/profile/ui/UserProfilePanelTabs.tsx:713— UserProfilePanelTabs.ProfileRuntimeTabContent has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (21 pts), boolean chains 7, if/else 3 (5 pts) (nesting depth added 12). Of this number, 28 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projectActivity.summarizeProjectActivityEvents (cognitive 33) desktop/src/features/projects/projectActivity.mjs:48— projectActivity.summarizeProjectActivityEvents has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 6 (9 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workflowFormTypes.actionFieldsForStep (cognitive 33) desktop/src/features/workflows/ui/workflowFormTypes.ts:183— workflowFormTypes.actionFieldsForStep has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 1, match/switch 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.
localStorageSweep.sweepChunked::processSlice (cognitive 33) desktop/src/shared/lib/localStorageSweep.ts:215— localStorageSweep.sweepChunked::processSlice has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 3 (5 pts), boolean chains 3, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeBlock.SyntaxHighlightedCode (cognitive 33) desktop/src/shared/ui/markdown/CodeBlock.tsx:134— CodeBlock.SyntaxHighlightedCode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 5 (7 pts), boolean chains 6, error handling 4 (6 pts) (nesting depth added 6). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 152, 190, 235, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ClientMessage::parse (cognitive 32) crates/buzz-relay/src/protocol.rs:61— ClientMessage::parse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (31 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.check_compaction_safety (cognitive 32) docs/formal/nip-rs-unread/exhaustive.py:195— exhaustive.check_compaction_safety has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (7 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeAddMembersViewController.tableView (cognitive 32) mobile/ios/Runner/NativeAddMembersSheet.swift:217— NativeAddMembersViewController.tableView has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10, ternaries 5 (10 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelMessagesNotifier._handleLiveEvent (cognitive 32) mobile/lib/features/channels/channel_messages_provider.dart:327— ChannelMessagesNotifier._handleLiveEvent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_VideoTransportBar.build (cognitive 32) mobile/lib/features/channels/media_viewer_page/video_controls.dart:64— _VideoTransportBar.build has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 10, boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_OnboardingConnectionView.build (cognitive 32) mobile/lib/features/pairing/pairing_page/onboarding_connection_view.dart:24— _OnboardingConnectionView.build has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 12, ternaries 7 (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.
NsecImportSheet.build (cognitive 32) mobile/lib/shared/identity_transfer/nsec_import_sheet.dart:41— NsecImportSheet.build has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 4, boolean chains 3, error handling 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentSessionTranscriptGrouping.buildBlocksForRun (cognitive 32) desktop/src/features/agents/ui/agentSessionTranscriptGrouping.ts:599— agentSessionTranscriptGrouping.buildBlocksForRun has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
observedUnreadStorage.pruneEventsByChannel (cognitive 32) desktop/src/features/channels/observedUnreadStorage.ts:87— observedUnreadStorage.pruneEventsByChannel has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 7 (14 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.
InviteLinkSection.InviteLinkSection (cognitive 32) desktop/src/features/community-members/ui/InviteLinkSection.tsx:47— InviteLinkSection.InviteLinkSection has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 8 (10 pts), boolean chains 6, error handling 2 (nesting depth added 5). Of this number, 17 points are the body's own statements and 15 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.
ParticipantList.HuddleParticipantsControl (cognitive 32) desktop/src/features/huddle/components/ParticipantList.tsx:141— ParticipantList.HuddleParticipantsControl has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13 (22 pts), if/else 6, boolean chains 4 (nesting depth added 9). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 310, 257, 154, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ComposerAttachments.ComposerAttachments (cognitive 32) desktop/src/features/messages/ui/ComposerAttachments.tsx:591— ComposerAttachments.ComposerAttachments has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 13, if/else 5 (nesting depth added 5). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 750, 635, 875). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectsAgentPromptPage.ProjectsAgentPromptPage (cognitive 32) desktop/src/features/projects/ui/ProjectsAgentPromptPage.tsx:393— ProjectsAgentPromptPage.ProjectsAgentPromptPage has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 14 (20 pts), if/else 6, boolean chains 5, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 16 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MessageContent._buildLink (cognitive 31) mobile/lib/features/channels/message_content.dart:580— MessageContent._buildLink has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, match/switch 3 (5 pts), ternaries 4 (5 pts), error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_PairingCodeEntry.build (cognitive 31) mobile/lib/features/pairing/pairing_page/pairing_code_entry.dart:22— _PairingCodeEntry.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 12 (23 pts), if/else 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunityThemeSyncManager.flush (cognitive 31) mobile/lib/shared/theme/community_theme_sync.dart:230— CommunityThemeSyncManager.flush has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 9, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LifecycleActivity.LifecycleActivity (cognitive 31) desktop/src/features/agents/ui/activityRenderClasses/LifecycleActivity.tsx:40— LifecycleActivity.LifecycleActivity has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (24 pts), if/else 4, boolean chains 3 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CanvasHistoryPanel.CanvasHistoryPanel (cognitive 31) desktop/src/features/channels/ui/CanvasHistoryPanel.tsx:51— CanvasHistoryPanel.CanvasHistoryPanel has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 14 (21 pts), if/else 6, boolean chains 4 (nesting depth added 7). Most of this is not in the body itself: 14 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 198, a function literal at line 89, authorLabel, …). 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.
InboxListPane.InboxListPane::renderItem (cognitive 31) desktop/src/features/home/ui/InboxListPane.tsx:309— InboxListPane.InboxListPane::renderItem has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 22 (28 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (InboxListPane.InboxListPane) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
useInboxThreadContext.useInboxThreadContext (cognitive 31) desktop/src/features/home/useInboxThreadContext.ts:49— useInboxThreadContext.useInboxThreadContext has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 11, ternaries 5, error handling 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 93, 110, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buildMentionCandidates.buildMentionCandidates (cognitive 31) desktop/src/features/messages/lib/buildMentionCandidates.ts:56— buildMentionCandidates.buildMentionCandidates has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, ternaries 4 (7 pts), loops 4 (5 pts), if/else 4 (nesting depth added 4). Of this number, 18 points are the body's own statements and 13 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UserProfilePanelFields.buildOwnerFields (cognitive 31) desktop/src/features/profile/ui/UserProfilePanelFields.tsx:228— UserProfilePanelFields.buildOwnerFields has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 13, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectAgentChatPanel.ProjectAgentChatPanel (cognitive 31) desktop/src/features/projects/ui/ProjectAgentChatPanel.tsx:50— ProjectAgentChatPanel.ProjectAgentChatPanel has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 7, if/else 6 (7 pts), error handling 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 13 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PrivateKeyBackupRow.PrivateKeyBackupRow (cognitive 31) desktop/src/features/settings/ui/PrivateKeyBackupRow.tsx:60— PrivateKeyBackupRow.PrivateKeyBackupRow has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (19 pts), if/else 6 (10 pts), error handling 1 (2 pts) (nesting depth added 15). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 3 function items inside it that branch (handleReveal, handleCreateBackup, handleTestOpenChange). 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.
WorkflowMessageTextConditionEditor.WorkflowMessageTextCondition (cognitive 31) desktop/src/features/workflows/ui/WorkflowMessageTextConditionEditor.tsx:41— WorkflowMessageTextConditionEditor.WorkflowMessageTextCondition has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 7, if/else 7 (nesting depth added 7). Of this number, 18 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AndroidVoiceNotePackager.writeBlackVideoTrack (cognitive 30) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/AndroidVoiceNotePackager.kt:81— AndroidVoiceNotePackager.writeBlackVideoTrack has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, error handling 2, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppDelegate.handleMediaUploadMethodCall (cognitive 30) mobile/ios/Runner/AppDelegate.swift:747— AppDelegate.handleMediaUploadMethodCall has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IosNavigationBarView.makeControlGroup (cognitive 30) mobile/ios/Runner/IosNavigationBar.swift:617— IosNavigationBarView.makeControlGroup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, ternaries 1 (2 pts), 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.
MediaSanitizer.scrubJpeg (cognitive 30) mobile/ios/Runner/MediaSanitizer.swift:93— MediaSanitizer.scrubJpeg has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 8, loops 2 (3 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.
NativeEmojiPickerDataLoader.parse (cognitive 30) mobile/ios/Runner/NativeEmojiPickerModel.swift:117— NativeEmojiPickerDataLoader.parse has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActivityNotifier._fetch (cognitive 30) mobile/lib/features/activity/activity_provider.dart:443— ActivityNotifier._fetch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 10, loops 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuzzPushBootstrap.build (cognitive 30) mobile/lib/shared/push/push_bootstrap.dart:161— BuzzPushBootstrap.build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, error handling 3 (5 pts), loops 2 (3 pts), ternaries 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.
MediaUploadService.uploadVideo (cognitive 30) mobile/lib/shared/relay/media_upload.dart:366— MediaUploadService.uploadVideo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 3 (8 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelRouteScreen.ChannelRouteScreen (cognitive 30) desktop/src/app/routes/ChannelRouteScreen.tsx:114— ChannelRouteScreen.ChannelRouteScreen has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, ternaries 4 (6 pts), loops 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 177, 230, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
providerApiKeyFieldState.getProviderApiKeyFieldState (cognitive 30) desktop/src/features/agents/ui/providerApiKeyFieldState.ts:24— providerApiKeyFieldState.getProviderApiKeyFieldState has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 10 (26 pts), boolean chains 3, if/else 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CompactMessageSummary.CompactMessageSummary (cognitive 30) desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx:18— CompactMessageSummary.CompactMessageSummary has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 9, if/else 2 (nesting depth added 6). Of this number, 25 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuddleAttachment.HuddleAttachment (cognitive 30) desktop/src/features/huddle/components/HuddleAttachment.tsx:116— HuddleAttachment.HuddleAttachment has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (10 pts), ternaries 6 (8 pts), error handling 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 14 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
DefaultConfigStep.AgentDefaultsSection (cognitive 30) desktop/src/features/onboarding/ui/DefaultConfigStep.tsx:51— DefaultConfigStep.AgentDefaultsSection has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (17 pts), boolean chains 7, if/else 6 (nesting depth added 10). Of this number, 20 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
selfProfileStorage.trimSelfProfileCaches (cognitive 30) desktop/src/features/profile/lib/selfProfileStorage.ts:185— selfProfileStorage.trimSelfProfileCaches has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 5 (6 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projectDetailAgentContext.projectDetailAgentContextBlock (cognitive 30) desktop/src/features/projects/lib/projectDetailAgentContext.ts:223— projectDetailAgentContext.projectDetailAgentContextBlock has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsPanels.ThemeSettingsCard (cognitive 30) desktop/src/features/settings/ui/SettingsPanels.tsx:421— SettingsPanels.ThemeSettingsCard has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 19 (29 pts), if/else 9 (16 pts), boolean chains 10 (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. This shape REPEATS in the file: one other method here (SettingsPanels.ThemeSettingsCard::handleModeSelect) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
inviteHelpers.parseInviteInput (cognitive 30) REDACTED:26— inviteHelpers.parseInviteInput has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HarnessRelay::discover_channels (cognitive 29) crates/buzz-acp/src/relay.rs:830— HarnessRelay::discover_channels has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (25 pts), loops 2 (4 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
exhaustive.test_merge_algebra_a (cognitive 29) docs/formal/nip-rs-unread/exhaustive.py:75— exhaustive.test_merge_algebra_a has cognitive complexity 29 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 3 (12 pts) (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
exhaustive.test_tombstone_merge_monotonic (cognitive 29) docs/formal/nip-rs-unread/exhaustive.py:509— exhaustive.test_tombstone_merge_monotonic has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 1 (7 pts), boolean chains 1 (nesting depth added 21). 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.
NativeAddMembersSheetCoordinator.handle (cognitive 29) mobile/ios/Runner/NativeAddMembersSheet.swift:21— NativeAddMembersSheetCoordinator.handle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ThreadMessageList.build (cognitive 29) mobile/lib/features/channels/thread_detail_page/message_list.dart:146— _ThreadMessageList.build has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (9 pts), ternaries 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UserProfileSheet.build (cognitive 29) mobile/lib/features/profile/user_profile_sheet.dart:76— UserProfileSheet.build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 8 (12 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RelaySessionNotifier._handleClosed (cognitive 29) mobile/lib/shared/relay/relay_session.dart:837— RelaySessionNotifier._handleClosed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7, ternaries 4 (6 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.
PersonaModelCombobox.PersonaModelCombobox (cognitive 29) desktop/src/features/agents/ui/PersonaModelCombobox.tsx:22— PersonaModelCombobox.PersonaModelCombobox has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, ternaries 3 (5 pts), loops 2, match/switch 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (handleKeyDown, a function literal at line 104, a function literal at line 182, …). 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.
agentSessionTranscriptGrouping.splitIntoSessionRuns (cognitive 29) desktop/src/features/agents/ui/agentSessionTranscriptGrouping.ts:427— agentSessionTranscriptGrouping.splitIntoSessionRuns has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, 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.
usePersonaActions.usePersonaActions.handleSubmit (cognitive 29) desktop/src/features/agents/ui/usePersonaActions.ts:175— usePersonaActions.usePersonaActions.handleSubmit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 3 (7 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MeshComputeSettingsCard.StatusLine (cognitive 29) desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx:617— MeshComputeSettingsCard.StatusLine has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 11 (13 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormattingToolbar.FormattingToolbar (cognitive 29) desktop/src/features/messages/ui/FormattingToolbar.tsx:127— FormattingToolbar.FormattingToolbar has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 4, ternaries 3 (nesting depth added 2). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 231, 165, 155, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
desktop.listenForDesktopNotificationActions (cognitive 29) desktop/src/features/notifications/lib/desktop.ts:217— desktop.listenForDesktopNotificationActions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 3 (8 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 15). Of this number, 18 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
machineOnboarding.useMachineOnboardingState (cognitive 29) desktop/src/features/onboarding/machineOnboarding.ts:99— machineOnboarding.useMachineOnboardingState has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, if/else 13, ternaries 1. Of this number, 20 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SetupStep.SetupStepContent (cognitive 29) desktop/src/features/onboarding/ui/SetupStep.tsx:963— SetupStep.SetupStepContent has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 8 (9 pts), boolean chains 7 (nesting depth added 5). Of this number, 16 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
projectIssues.assignmentStateForIssue (cognitive 29) desktop/src/features/projects/projectIssues.mjs:100— projectIssues.assignmentStateForIssue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 11). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectEntityListRow.ProjectEntityListRow (cognitive 29) desktop/src/features/projects/ui/ProjectEntityListRow.tsx:137— ProjectEntityListRow.ProjectEntityListRow has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 14 (17 pts), boolean chains 10, if/else 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.
HarnessCatalogDialog.CatalogDetail (cognitive 29) desktop/src/features/settings/ui/HarnessCatalogDialog.tsx:451— HarnessCatalogDialog.CatalogDetail has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 2, if/else 2 (nesting depth added 10). Of this number, 26 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BestieGlobalOverlay.BestieGlobalOverlay (cognitive 29) desktop/src/protectedFeatures/bestie/BestieGlobalOverlay.tsx:41— BestieGlobalOverlay.BestieGlobalOverlay has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14, boolean chains 8, ternaries 7. Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 94, a function literal at line 140, a function literal at line 85, …). 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.
RelayClient.sendRawWithReconnectRetry (cognitive 29) desktop/src/shared/api/relayClientSession.ts:745— RelayClient.sendRawWithReconnectRetry has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 6, ternaries 3 (6 pts), error handling 2 (3 pts) (nesting depth added 12). Of this number, 16 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
installNativeRig.openScope (cognitive 29) desktop/src/features/channels/observedUnreadNativeRig.mjs:186— installNativeRig.openScope has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (12 pts), boolean chains 3, other 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.explore_b (cognitive 28) docs/formal/nip-rs-unread/exhaustive.py:235— exhaustive.explore_b has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 5 (12 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.
NativeMessagePresentationCoordinator.handle (cognitive 28) mobile/ios/Runner/NativeMessagePresentationCoordinator.swift:23— NativeMessagePresentationCoordinator.handle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 9, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TypingMotionPreview.build (cognitive 28) mobile/lib/features/channels/typing_motion_preview.dart:18— TypingMotionPreview.build has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 4 (6 pts), ternaries 6 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HuddleSessionNotifier._wireMediaAndTransport (cognitive 28) mobile/lib/shared/huddle/huddle_session.dart:407— HuddleSessionNotifier._wireMediaAndTransport has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useHuddlePresentation.useHuddlePresentation (cognitive 28) desktop/src/app/useHuddlePresentation.ts:31— useHuddlePresentation.useHuddlePresentation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 6. Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 395, 384, 82, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AdminConsoleActionsTab.ActionsSection (cognitive 28) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:375— AdminConsoleActionsTab.ActionsSection has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, ternaries 11 (12 pts), if/else 2 (nesting depth added 1). Of this number, 21 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AdminConsoleCommunities.CommunitiesTab (cognitive 28) desktop/src/features/admin-console/AdminConsoleCommunities.tsx:37— AdminConsoleCommunities.CommunitiesTab has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, ternaries 9 (10 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
observedUnreadNativeRig.installNativeRig.openScope (cognitive 28) desktop/src/features/channels/observedUnreadNativeRig.mjs:186— observedUnreadNativeRig.installNativeRig.openScope has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (12 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useUnreadChannels.useUnreadChannels.rawUnread (cognitive 28) desktop/src/features/channels/useUnreadChannels.ts:798— useUnreadChannels.useUnreadChannels.rawUnread has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 3 (7 pts), boolean chains 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelCanvas.ChannelCanvas (cognitive 28) desktop/src/features/channels/ui/ChannelCanvas.tsx:28— ChannelCanvas.ChannelCanvas has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 12 (19 pts), boolean chains 5, if/else 4 (nesting depth added 7). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ForumView.ForumView (cognitive 28) desktop/src/features/forum/ui/ForumView.tsx:45— ForumView.ForumView has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 5 (7 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 10). Of this number, 14 points are the body's own statements and 14 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
use-feed-desktop-notifications.useFeedDesktopNotifications (cognitive 28) desktop/src/features/notifications/use-feed-desktop-notifications.ts:71— use-feed-desktop-notifications.useFeedDesktopNotifications has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, ternaries 3 (5 pts), loops 3 (4 pts) (nesting depth added 6). None of this is in the body itself: all 28 points belong to 4 function literals inside it that branch (lines 131, 95, 113, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useProjectSidebarMembership.useProjectSidebarMembership (cognitive 28) desktop/src/features/projects/lib/useProjectSidebarMembership.ts:20— useProjectSidebarMembership.useProjectSidebarMembership has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, boolean chains 8. None of this is in the body itself: all 28 points belong to 13 function literals inside it that branch (lines 90, 157, 33, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectsActivityFeed.ActivityCard (cognitive 28) desktop/src/features/projects/ui/ProjectsActivityFeed.tsx:336— ProjectsActivityFeed.ActivityCard has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 19 (27 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.
NotificationSettingsCard.NotificationSettingsCard (cognitive 28) desktop/src/features/settings/ui/NotificationSettingsCard.tsx:28— NotificationSettingsCard.NotificationSettingsCard has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 10 (nesting depth added 8). Of this number, 18 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
relayClosedRecovery.handleRelayClosed (cognitive 28) desktop/src/shared/api/relayClosedRecovery.ts:27— relayClosedRecovery.handleRelayClosed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (26 pts), boolean chains 2 (nesting depth added 18). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (retryWhenAdmitted, a function literal at line 86, a function literal at line 78). 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.
WorkflowDef::validate (cognitive 27) crates/buzz-workflow/src/schema.rs:173— WorkflowDef::validate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IosNavigationBarView.makeItem (cognitive 27) mobile/ios/Runner/IosNavigationBar.swift:699— IosNavigationBarView.makeItem has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 4 (7 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActivityNotifier._subscribeChannelBatches (cognitive 27) mobile/lib/features/activity/activity_provider.dart:176— ActivityNotifier._subscribeChannelBatches has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 4 (9 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 16). 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.
_MorphingQuickActionsButton.build (cognitive 27) mobile/lib/features/channels/channels_page/quick_actions.dart:35— _MorphingQuickActionsButton.build has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 5 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelQuickActionsLauncher.build (cognitive 27) mobile/lib/features/channels/channels_page/quick_actions_launcher.dart:51— ChannelQuickActionsLauncher.build has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 8, boolean chains 7, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_DeepLinkDispatcherState._maybeDispatchInvite (cognitive 27) mobile/lib/features/channels/deep_link_dispatcher.dart:213— _DeepLinkDispatcherState._maybeDispatchInvite has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 6, error handling 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
InviteJoinNotifier.confirmJoin (cognitive 27) mobile/lib/features/invites/invite_join_provider.dart:161— InviteJoinNotifier.confirmJoin has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, ternaries 2 (5 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsProfileHeader.build (cognitive 27) mobile/lib/features/profile/settings_profile_header.dart:30— SettingsProfileHeader.build has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 10, boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MethodChannelHuddleMedia._handleNativeCall (cognitive 27) mobile/lib/shared/huddle/huddle_media.dart:627— MethodChannelHuddleMedia._handleNativeCall has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (6 pts), error handling 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddTeamToChannelDialog.AddTeamToChannelDialog (cognitive 27) desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:47— AddTeamToChannelDialog.AddTeamToChannelDialog has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 7, if/else 4, error handling 1 (nesting depth added 3). Of this number, 18 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PersonaShareRecipients.PersonaShareRecipients (cognitive 27) desktop/src/features/agents/ui/PersonaShareRecipients.tsx:32— PersonaShareRecipients.PersonaShareRecipients has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 7 (9 pts), boolean chains 8 (nesting depth added 3). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 187, a function literal at line 236, a function literal at line 68, …). 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.
agentConfigControls.AgentDropdownSelect (cognitive 27) desktop/src/features/agents/ui/agentConfigControls.tsx:112— agentConfigControls.AgentDropdownSelect has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, ternaries 7 (10 pts), if/else 3 (nesting depth added 3). Of this number, 16 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ToolDetailBlocks.ToolDetailBlocks (cognitive 27) desktop/src/features/agents/ui/AgentSessionToolItem/ToolDetailBlocks.tsx:10— ToolDetailBlocks.ToolDetailBlocks has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 7 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeedSection.FeedSection (cognitive 27) desktop/src/features/home/ui/FeedSection.tsx:129— FeedSection.FeedSection has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (21 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 13). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 165, 250). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
hooks.useSendMessageMutation (cognitive 27) desktop/src/features/messages/hooks.ts:476— hooks.useSendMessageMutation has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 9 (10 pts), boolean chains 3 (nesting depth added 7). None of this is in the body itself: all 27 points belong to 5 function literals inside it that branch (lines 499, 657, 584, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useMentions.useMentions.handleMentionKeyDown (cognitive 27) desktop/src/features/messages/lib/useMentions.ts:828— useMentions.useMentions.handleMentionKeyDown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 9). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workflowActivationWarning.matchesEveryHour (cognitive 27) desktop/src/features/workflows/ui/workflowActivationWarning.ts:62— workflowActivationWarning.matchesEveryHour has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BestiePopover.BestiePopover (cognitive 27) desktop/src/protectedFeatures/bestie/BestiePopover.tsx:195— BestiePopover.BestiePopover has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13, boolean chains 10, ternaries 4. Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 357, a function literal at line 262, a function literal at line 305, …). 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.
RelayClient.handleWsMessage (cognitive 27) desktop/src/shared/api/relayClientSession.ts:867— RelayClient.handleWsMessage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, ternaries 2 (4 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
linkPreviewSnapshot.parseLinkPreviewSnapshots (cognitive 27) desktop/src/shared/lib/linkPreviewSnapshot.ts:95— linkPreviewSnapshot.parseLinkPreviewSnapshots has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (11 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
use-repo-refs.parseRefs (cognitive 27) web/src/features/repos/use-repo-refs.ts:12— use-repo-refs.parseRefs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 pts), boolean chains 3 (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.
installNativeRig.ingest (cognitive 27) desktop/src/features/channels/observedUnreadNativeRig.mjs:217— installNativeRig.ingest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 6 (7 pts), other 4, 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.
desktop_release.validate (cognitive 26) scripts/desktop_release.py:210— desktop_release.validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 6, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NativeEmojiCategoryTracker.selectedSectionID (cognitive 26) mobile/ios/Runner/NativeEmojiPickerModel.swift:415— NativeEmojiCategoryTracker.selectedSectionID has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 11, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuilderlabAccountClient._request (cognitive 26) mobile/lib/shared/hosted/builderlab_account.dart:291— BuilderlabAccountClient._request has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IosScrollToTop.build (cognitive 26) mobile/lib/shared/widgets/ios_scroll_to_top.dart:17— IosScrollToTop.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AdminConsoleStaffingTab.StaffingTab (cognitive 26) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:442— AdminConsoleStaffingTab.StaffingTab has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 8, error handling 3, ternaries 3. Of this number, 15 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
agentSessionToolCatalog.getBuzzToolInfo (cognitive 26) desktop/src/features/agents/ui/agentSessionToolCatalog.ts:139— agentSessionToolCatalog.getBuzzToolInfo has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 6, if/else 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usePersonaSync.startPersonaSync (cognitive 26) desktop/src/features/agents/lib/usePersonaSync.ts:279— usePersonaSync.startPersonaSync has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). None of this is in the body itself: all 26 points belong to 8 function items inside it that branch (runBackfill, onLiveEvent, openBoundaryAndDrain, …). 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.
AddAgentToChannelDialog.AddAgentToChannelDialog (cognitive 26) desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:27— AddAgentToChannelDialog.AddAgentToChannelDialog has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 10, ternaries 9 (10 pts), if/else 5, error handling 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModelPicker.ModelPicker (cognitive 26) desktop/src/features/agents/ui/ModelPicker.tsx:34— ModelPicker.ModelPicker has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (28 pts), if/else 9 (14 pts), boolean chains 5, error handling 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. This shape REPEATS in the file: one other method here (ModelPicker.ModelPicker::handleModelChange) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
observedUnreadStorage.pruneObservedUnreadByMarkers (cognitive 26) desktop/src/features/channels/observedUnreadStorage.ts:365— observedUnreadStorage.pruneObservedUnreadByMarkers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (9 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.
BotActivityBar.BotActivityComposerAction (cognitive 26) desktop/src/features/channels/ui/BotActivityBar.tsx:37— BotActivityBar.BotActivityComposerAction has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 14, if/else 7 (10 pts), boolean chains 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 64, 186, 102, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
InboxListPane.InboxListPane (cognitive 26) desktop/src/features/home/ui/InboxListPane.tsx:243— InboxListPane.InboxListPane has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 34 (61 pts), boolean chains 9, if/else 5 (9 pts), loops 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (InboxListPane.InboxListPane::renderItem) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
sendToChannelSemantics.getSendToChannelSemantics (cognitive 26) desktop/src/features/messages/lib/sendToChannelSemantics.ts:25— sendToChannelSemantics.getSendToChannelSemantics has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 9, ternaries 2 (3 pts), loops 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnimatedAvatarControls.AvatarFramingSlider (cognitive 26) desktop/src/features/profile/ui/AnimatedAvatarControls.tsx:85— AnimatedAvatarControls.AvatarFramingSlider has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12, ternaries 8 (9 pts), boolean chains 5 (nesting depth added 1). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 186, 125, 145, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectPullRequestFilesChangedPanel.DiffPreview (cognitive 26) desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:447— ProjectPullRequestFilesChangedPanel.DiffPreview has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, ternaries 9 (11 pts), if/else 4 (nesting depth added 2). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 509, 461, 470, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectsChannelsList.ProjectsChannelsList (cognitive 26) desktop/src/features/projects/ui/ProjectsChannelsList.tsx:27— ProjectsChannelsList.ProjectsChannelsList has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (18 pts), if/else 3 (4 pts), boolean chains 2, loops 2 (nesting depth added 6). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 171, 90, 112, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LaneReconciler.runAttempt (cognitive 26) desktop/src/features/sidebar/lib/sidebarLaneReconciler.ts:194— LaneReconciler.runAttempt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 7, error handling 2 (nesting depth added 2). Of this number, 23 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SidebarSection.SidebarSection (cognitive 26) desktop/src/features/sidebar/ui/SidebarSection.tsx:376— SidebarSection.SidebarSection has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (18 pts), boolean chains 7, if/else 1 (nesting depth added 10). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 471). 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.
mediaUrl.fetchProxyPort (cognitive 26) desktop/src/shared/lib/mediaUrl.ts:176— mediaUrl.fetchProxyPort has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 2 (6 pts), boolean chains 3, 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.
ThemeProvider.ThemeProvider (cognitive 26) desktop/src/shared/theme/ThemeProvider.tsx:548— ThemeProvider.ThemeProvider has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 6, boolean chains 4, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 746, 605, 623, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CommunityThemeController.CommunityThemeController (cognitive 26) desktop/src/shared/theme/CommunityThemeController.tsx:30— CommunityThemeController.CommunityThemeController has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 4. None of this is in the body itself: all 26 points belong to 8 function literals inside it that branch (lines 189, 96, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
compact-link-preview-attachment.CompactLinkPreviewAttachment (cognitive 26) desktop/src/shared/ui/compact-link-preview-attachment.tsx:51— compact-link-preview-attachment.CompactLinkPreviewAttachment has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 15 (22 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
entityLinks.EntityMetadataTooltip (cognitive 26) desktop/src/shared/ui/markdown/entityLinks.tsx:28— entityLinks.EntityMetadataTooltip has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 7, if/else 1 (nesting depth added 7). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.enabled_transitions (cognitive 25) docs/formal/nip-rs-unread/exhaustive.py:113— exhaustive.enabled_transitions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 4 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelfHostedEntry.prepare (cognitive 25) mobile/lib/shared/hosted/self_hosted_entry.dart:61— SelfHostedEntry.prepare has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuddleSessionNotifier.join (cognitive 25) mobile/lib/shared/huddle/huddle_session.dart:221— HuddleSessionNotifier.join has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuddleSessionNotifier._drainPlayback (cognitive 25) mobile/lib/shared/huddle/huddle_session.dart:522— HuddleSessionNotifier._drainPlayback has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 2 (6 pts), loops 2 (5 pts), boolean chains 1, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadStateManager._mergeEvents (cognitive 25) mobile/lib/shared/read_state/read_state_manager.dart:245— ReadStateManager._mergeEvents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usePersonaModelDiscovery.usePersonaModelDiscovery (cognitive 25) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:200— usePersonaModelDiscovery.usePersonaModelDiscovery has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8, ternaries 5 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 277, 333, 325, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddChannelBotDialog.AddChannelBotDialog (cognitive 25) desktop/src/features/channels/ui/AddChannelBotDialog.tsx:55— AddChannelBotDialog.AddChannelBotDialog has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 6 (7 pts), boolean chains 5, error handling 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 10 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.
communityUnreadObserver.fetchCommunityUnread (cognitive 25) desktop/src/features/communities/communityUnreadObserver.ts:156— communityUnreadObserver.fetchCommunityUnread has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunityMembersSettingsCard.RelayMemberRow (cognitive 25) desktop/src/features/community-members/ui/CommunityMembersSettingsCard.tsx:91— CommunityMembersSettingsCard.RelayMemberRow has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 8, error handling 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalArchiveSettingsCard.LocalArchiveSettingsCard (cognitive 25) desktop/src/features/local-archive/ui/LocalArchiveSettingsCard.tsx:391— LocalArchiveSettingsCard.LocalArchiveSettingsCard has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 6, error handling 4, boolean chains 2, loops 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 460, 490, 432, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useEnsureAgentMentionsReady.useEnsureAgentMentionsReady (cognitive 25) desktop/src/features/messages/ui/useEnsureAgentMentionsReady.ts:67— useEnsureAgentMentionsReady.useEnsureAgentMentionsReady has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, error handling 1 (2 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 9). None of this is in the body itself: all 25 points belong to one function literal inside it that branches (line 74). 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.
TimelineMessageRow.MessageRowItem (cognitive 25) desktop/src/features/messages/ui/TimelineMessageRow.tsx:94— TimelineMessageRow.MessageRowItem has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 11, if/else 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.
UserProfileAgentActions.UserProfileAgentSettingsMenu (cognitive 25) desktop/src/features/profile/ui/UserProfileAgentActions.tsx:24— UserProfileAgentActions.UserProfileAgentSettingsMenu has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 8, if/else 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectRepositoryPanel.repositoryEntries (cognitive 25) desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:441— ProjectRepositoryPanel.repositoryEntries has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 12). Of this number, 22 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectHomeWorkspaceSheet.ProjectHomeWorkspaceSheet (cognitive 25) desktop/src/features/projects/ui/ProjectHomeWorkspaceSheet.tsx:47— ProjectHomeWorkspaceSheet.ProjectHomeWorkspaceSheet has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 9, ternaries 4 (5 pts), match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 215, 272, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EncryptedBackupProvider.EncryptedBackupProvider (cognitive 25) desktop/src/features/settings/EncryptedBackupProvider.tsx:35— EncryptedBackupProvider.EncryptedBackupProvider has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 4 (6 pts), boolean chains 3, error handling 1 (nesting depth added 3). None of this is in the body itself: all 25 points belong to 11 function literals inside it that branch (lines 158, 115, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SendFeedbackDialog.SendFeedbackDialog (cognitive 25) desktop/src/features/settings/ui/SendFeedbackDialog.tsx:65— SendFeedbackDialog.SendFeedbackDialog has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 4, if/else 4, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (submitFeedback, attachImage, selectCategory, …). 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.
workflowConditionExpression.parseConditionExpression (cognitive 25) REDACTED:147— workflowConditionExpression.parseConditionExpression has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 4 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AndroidMediaSanitizer.scrubJpeg (cognitive 24) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/AndroidMediaSanitizer.kt:44— AndroidMediaSanitizer.scrubJpeg has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposeDraft.fromJson (cognitive 24) mobile/lib/features/activity/compose_drafts_provider.dart:49— ComposeDraft.fromJson has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileTextEditSheet.build (cognitive 24) mobile/lib/features/profile/profile_text_edit_sheet.dart:39— ProfileTextEditSheet.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 9, boolean chains 2, error handling 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.
UserStatusCacheNotifier._fetchStatuses (cognitive 24) mobile/lib/features/profile/user_status_cache_provider.dart:146— UserStatusCacheNotifier._fetchStatuses has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useApplyTemplate.useApplyTemplate.applyAgents (cognitive 24) desktop/src/features/channel-templates/useApplyTemplate.ts:57— useApplyTemplate.useApplyTemplate.applyAgents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1, 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.
ComposerAddressControls.ComposerMentionButton (cognitive 24) desktop/src/features/messages/ui/ComposerAddressControls.tsx:129— ComposerAddressControls.ComposerMentionButton has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 14 (21 pts), if/else 3 (nesting depth added 7). Of this number, 12 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NsecMaskedDisplay.NsecMaskedDisplay (cognitive 24) desktop/src/features/onboarding/ui/NsecMaskedDisplay.tsx:48— NsecMaskedDisplay.NsecMaskedDisplay has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 16 (21 pts), if/else 3 (nesting depth added 5). Of this number, 21 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProfileStep.ProfileStep (cognitive 24) desktop/src/features/onboarding/ui/ProfileStep.tsx:194— ProfileStep.ProfileStep has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 5, if/else 2 (4 pts) (nesting depth added 6). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepositoryCards.RepositoryHostIcon (cognitive 24) desktop/src/features/projects/ui/RepositoryCards.tsx:60— RepositoryCards.RepositoryHostIcon has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (23 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cognitive 24) desktop/src/features/sidebar/ui/useSidebarRelayConnectionCard.ts:63— useSidebarRelayConnectionCard.useSidebarRelayConnectionCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 11, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 115, 157, 185). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentSnapshotCard.AgentSnapshotCard (cognitive 24) desktop/src/shared/ui/markdown/AgentSnapshotCard.tsx:59— AgentSnapshotCard.AgentSnapshotCard has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 15 (21 pts), boolean chains 1, error handling 1, if/else 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
desktop_release.previous_release (cognitive 23) scripts/desktop_release.py:87— desktop_release.previous_release has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 10, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeAttachmentPopoverViewController.configureAndStartCamera (cognitive 23) mobile/ios/Runner/NativeAttachmentPopover.swift:660— NativeAttachmentPopoverViewController.configureAndStartCamera has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, error handling 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.
ThemePaginationControl.updateDots (cognitive 23) mobile/ios/Runner/ThemePaginationGlassControl.swift:204— ThemePaginationControl.updateDots has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (8 pts), if/else 5 (6 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_MobileHuddleCallPage.build (cognitive 23) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:569— _MobileHuddleCallPage.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 3, ternaries 3, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelMessagesNotifier.cachedThreadReplyIds (cognitive 23) mobile/lib/features/channels/channel_messages_provider.dart:579— ChannelMessagesNotifier.cachedThreadReplyIds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelsNotifier.build (cognitive 23) mobile/lib/features/channels/channels_provider.dart:144— ChannelsNotifier.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 5, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_IOSAttachmentPopoverCoordinator.present (cognitive 23) mobile/lib/features/channels/compose_bar/ios_attachment_popover.dart:42— _IOSAttachmentPopoverCoordinator.present has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SetStatusSheet.build (cognitive 23) mobile/lib/features/profile/set_status_sheet.dart:60— _SetStatusSheet.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 3 (4 pts), loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AccountIdentityStore._read (cognitive 23) mobile/lib/shared/hosted/account_identity_store.dart:274— AccountIdentityStore._read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedFlow._continueCommunities (cognitive 23) mobile/lib/shared/hosted/hosted_flow.dart:635— HostedFlow._continueCommunities has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MeGroups.decode (cognitive 23) mobile/lib/shared/me/me_groups.dart:21— MeGroups.decode has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 19, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AdminConsoleReportsTab.ResolveReportForm (cognitive 23) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:367— AdminConsoleReportsTab.ResolveReportForm has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 15, if/else 4 (6 pts), error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (handleSubmit, a function literal at line 452, a function literal at line 394, …). 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.
agentSessionToolClassifier.findBuzzCommand (cognitive 23) desktop/src/features/agents/ui/agentSessionToolClassifier.ts:487— agentSessionToolClassifier.findBuzzCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
observerRelayStore.processLiveObserverEvents (cognitive 23) desktop/src/features/agents/observerRelayStore.ts:470— observerRelayStore.processLiveObserverEvents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EnvVarsEditor.EnvVarsEditor (cognitive 23) desktop/src/features/agents/ui/EnvVarsEditor.tsx:211— EnvVarsEditor.EnvVarsEditor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, ternaries 9, boolean chains 4. Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 288, 545, 258, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditAgentAdvancedFields.EditAgentAdvancedFields (cognitive 23) desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx:35— EditAgentAdvancedFields.EditAgentAdvancedFields has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 6 (8 pts), boolean chains 2 (nesting depth added 5). Of this number, 12 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
observedUnreadNativeRig.installNativeRig.ingest (cognitive 23) desktop/src/features/channels/observedUnreadNativeRig.mjs:217— observedUnreadNativeRig.installNativeRig.ingest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageActionBar.MessageActionBar (cognitive 23) desktop/src/features/messages/ui/MessageActionBar.tsx:396— MessageActionBar.MessageActionBar has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 8, if/else 4 (nesting depth added 2). Of this number, 17 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MessageComposerToolbar.MessageComposerToolbar (cognitive 23) desktop/src/features/messages/ui/MessageComposerToolbar.tsx:35— MessageComposerToolbar.MessageComposerToolbar has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentReadiness.resolveAgentReadiness (cognitive 23) desktop/src/features/onboarding/ui/agentReadiness.ts:21— agentReadiness.resolveAgentReadiness has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, loops 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hooks.usePresenceSession (cognitive 23) desktop/src/features/presence/hooks.ts:224— hooks.usePresenceSession has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 7, boolean chains 2 (nesting depth added 7). Of this number, 14 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnimatedAvatarCameraControls.AnimatedAvatarCameraControls (cognitive 23) desktop/src/features/profile/ui/AnimatedAvatarCameraControls.tsx:30— AnimatedAvatarCameraControls.AnimatedAvatarCameraControls has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserProfilePanelPersonaSubmit.submitProfilePersonaDialog (cognitive 23) desktop/src/features/profile/ui/UserProfilePanelPersonaSubmit.ts:66— UserProfilePanelPersonaSubmit.submitProfilePersonaDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (9 pts), error handling 2 (3 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.
terminalBannerColor.bannerStops (cognitive 23) desktop/src/features/terminal/terminalBannerColor.ts:249— terminalBannerColor.bannerStops has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (7 pts), ternaries 1 (2 pts) (nesting depth added 10). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (pick, a function literal at line 303). 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.
workflowConditionExpression.splitTopLevel (cognitive 23) REDACTED:202— workflowConditionExpression.splitTopLevel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowsView.WorkflowsView (cognitive 23) desktop/src/features/workflows/ui/WorkflowsView.tsx:104— WorkflowsView.WorkflowsView has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 6, if/else 5, error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 128, 221, 252, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
markdown.createMarkdownComponents.a (cognitive 23) desktop/src/shared/ui/markdown.tsx:1220— markdown.createMarkdownComponents.a has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 5, boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RepoBlobViewer.RepoBlobPage (cognitive 23) web/src/features/repos/ui/RepoBlobViewer.tsx:222— RepoBlobViewer.RepoBlobPage has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 8, if/else 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.
eventToProjectPullRequest (cognitive 23) desktop/src/features/projects/projectPullRequests.mjs:304— eventToProjectPullRequest has cognitive complexity 23 (threshold 15). Drivers by points: other 12, boolean chains 6, ternaries 5. Of this number, 14 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RefPattern::parse (cognitive 22) crates/buzz-core/src/git_perms.rs:107— RefPattern::parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AprilPocketTts::synth_chunk_streaming (cognitive 22) crates/buzz-voice/src/pocket_april.rs:476— AprilPocketTts::synth_chunk_streaming has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelMessagesNotifier._pruneOffWindowReplies (cognitive 22) mobile/lib/features/channels/channel_messages_provider.dart:653— ChannelMessagesNotifier._pruneOffWindowReplies has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (8 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_DynamicIslandQrScannerPortal.build (cognitive 22) mobile/lib/features/pairing/pairing_qr_scanner/dynamic_island_portal.dart:11— _DynamicIslandQrScannerPortal.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PresenceCacheNotifier._subscribe (cognitive 22) mobile/lib/features/profile/presence_cache_provider.dart:105— PresenceCacheNotifier._subscribe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, 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.
UserCacheNotifier._flushPending (cognitive 22) mobile/lib/shared/profile/user_cache_provider.dart:149— UserCacheNotifier._flushPending has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (2 pts), error handling 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.
agentSessionToolClassifier.tokenizeShellCommand (cognitive 22) desktop/src/features/agents/ui/agentSessionToolClassifier.ts:513— agentSessionToolClassifier.tokenizeShellCommand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 1 (nesting depth added 8). Of this number, 21 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.
AgentConfigPanel.AgentConfigSurfaceRows (cognitive 22) desktop/src/features/agents/ui/AgentConfigPanel.tsx:374— AgentConfigPanel.AgentConfigSurfaceRows has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 4, if/else 3 (nesting depth added 6). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelMembersBar.ChannelMembersBar (cognitive 22) desktop/src/features/channels/ui/ChannelMembersBar.tsx:46— ChannelMembersBar.ChannelMembersBar has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 4 (5 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
useChannelIntro.useChannelIntro (cognitive 22) desktop/src/features/channels/ui/useChannelIntro.tsx:31— useChannelIntro.useChannelIntro has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 8). None of this is in the body itself: all 22 points belong to one function literal inside it that branches (line 50). 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.
CommunityMembersCard.MemberRow (cognitive 22) desktop/src/features/community-members/ui/CommunityMembersCard.tsx:66— CommunityMembersCard.MemberRow has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 8 (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.
KlipyGifPicker.KlipyGifPicker (cognitive 22) desktop/src/features/gifs/ui/KlipyGifPicker.tsx:30— KlipyGifPicker.KlipyGifPicker has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (22 pts) (nesting depth added 14). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 111, 85). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useHuddleParticipantRoster.compareLifecycleEvents (cognitive 22) desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:74— useHuddleParticipantRoster.compareLifecycleEvents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
timelineItems.buildTimelineItems (cognitive 22) desktop/src/features/messages/lib/timelineItems.ts:174— timelineItems.buildTimelineItems has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useAnchoredScroll.useAnchoredScroll.scrollToMessage (cognitive 22) desktop/src/features/messages/ui/useAnchoredScroll.ts:432— useAnchoredScroll.useAnchoredScroll.scrollToMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hooks.useUsersBatchQuery (cognitive 22) desktop/src/features/profile/hooks.ts:328— hooks.useUsersBatchQuery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 354, 415). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AvatarCustomColorPanel.AvatarCustomColorPanel (cognitive 22) desktop/src/features/profile/ui/AvatarCustomColorPanel.tsx:47— AvatarCustomColorPanel.AvatarCustomColorPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10, if/else 8, boolean chains 4. Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 239, 184, 62, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectPullRequestFilesChangedPanel.ProjectDiffFilesPanel (cognitive 22) desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:757— ProjectPullRequestFilesChangedPanel.ProjectDiffFilesPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 7, boolean chains 4 (nesting depth added 4). Of this number, 17 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
useAddProjectChannel.addProjectChannel (cognitive 22) desktop/src/features/projects/useAddProjectChannel.ts:31— useAddProjectChannel.addProjectChannel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (8 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 9). Of this number, 20 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignOutSection.SignOutSection (cognitive 22) desktop/src/features/settings/ui/SignOutSection.tsx:43— SignOutSection.SignOutSection has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 4 (5 pts), boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 11 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsPanels.ThemeSettingsCard::handleModeSelect (cognitive 22) desktop/src/features/settings/ui/SettingsPanels.tsx:480— SettingsPanels.ThemeSettingsCard::handleModeSelect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (SettingsPanels.ThemeSettingsCard) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
workflowDefinition.getActionCardClause (cognitive 22) desktop/src/features/workflows/ui/workflowDefinition.ts:291— workflowDefinition.getActionCardClause has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 2 (3 pts), boolean chains 1, 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.
WorkflowTemplateTextarea.WorkflowTemplateTextarea (cognitive 22) desktop/src/features/workflows/ui/WorkflowTemplateTextarea.tsx:17— WorkflowTemplateTextarea.WorkflowTemplateTextarea has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 8, boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 104, 140, 41, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BloomMenu.Container (cognitive 22) desktop/src/protectedFeatures/bestie/BloomMenu.tsx:130— BloomMenu.Container has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 15 (16 pts), boolean chains 3, if/else 3 (nesting depth added 1). Of this number, 18 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BloomMenu.Content (cognitive 22) desktop/src/protectedFeatures/bestie/BloomMenu.tsx:290— BloomMenu.Content has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (22 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
relayReconnectReplay.replayReconnectHistoryPages (cognitive 22) desktop/src/shared/api/relayReconnectReplay.ts:123— relayReconnectReplay.replayReconnectHistoryPages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useWebviewScrollBoundaryLock.useWebviewScrollBoundaryLock (cognitive 22) desktop/src/shared/hooks/useWebviewScrollBoundaryLock.ts:84— useWebviewScrollBoundaryLock.useWebviewScrollBoundaryLock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, loops 1 (nesting depth added 3). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 88, 85). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AuxiliaryPanelHeader.AuxiliaryPanelHeader (cognitive 22) desktop/src/shared/layout/AuxiliaryPanelHeader.tsx:108— AuxiliaryPanelHeader.AuxiliaryPanelHeader has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 6, if/else 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunityThemeSyncManager.doPublish (cognitive 22) desktop/src/shared/theme/communityThemeSync.ts:199— CommunityThemeSyncManager.doPublish has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 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.
markdown.ImageBlock (cognitive 22) desktop/src/shared/ui/markdown.tsx:986— markdown.ImageBlock has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9, if/else 7, boolean chains 6. Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1089, a function literal at line 1008, a function literal at line 1057, …). 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.
delivery.explore (cognitive 21) docs/formal/nip-pl/delivery.py:57— delivery.explore has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (15 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prepare-inter.main (cognitive 21) mobile/scripts/prepare-inter.py:50— prepare-inter.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IosNavigationBarView.applyScroll (cognitive 21) mobile/ios/Runner/IosNavigationBar.swift:540— IosNavigationBarView.applyScroll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VoiceNotePackager.makeVoiceNoteVideoTrack (cognitive 21) mobile/ios/Runner/VoiceNotePackager.swift:57— VoiceNotePackager.makeVoiceNoteVideoTrack has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, error handling 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_HuddleParticipantCluster.build (cognitive 21) mobile/lib/features/channels/channel_detail_page/huddle_participant_cluster.dart:67— _HuddleParticipantCluster.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 8, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_HuddleJoinSurface.build (cognitive 21) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:294— _HuddleJoinSurface.build has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, ternaries 5, if/else 1, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MessageSwipeReply.build (cognitive 21) mobile/lib/features/channels/message_swipe_reply.dart:39— MessageSwipeReply.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SendMessage._resolveMentions (cognitive 21) mobile/lib/features/channels/send_message_provider.dart:189— SendMessage._resolveMentions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ThreadStickyDateIndex.resolve (cognitive 21) mobile/lib/features/channels/thread_detail_page/sticky_date.dart:46— _ThreadStickyDateIndex.resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, ternaries 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
_PersonInviteSection.build (cognitive 21) mobile/lib/features/invites/invite_create_page/person_invite_section.dart:8— _PersonInviteSection.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PairingNotifier._pairNipAb (cognitive 21) mobile/lib/features/pairing/pairing_provider.dart:360— PairingNotifier._pairNipAb has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IosGlassNavigationButton.build (cognitive 21) mobile/lib/shared/widgets/ios_glass_navigation_button.dart:109— IosGlassNavigationButton.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 7 (8 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-file-sizes-core.runFileSizeCheck (cognitive 21) scripts/check-file-sizes-core.mjs:116— check-file-sizes-core.runFileSizeCheck has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (7 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdminConsoleFeedbackTab.AttachmentViewer (cognitive 21) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx:171— AdminConsoleFeedbackTab.AttachmentViewer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (8 pts), error handling 2, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 217, 278, 207, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
agentAutocompleteEligibility.getMentionableAgentPubkeys (cognitive 21) desktop/src/features/agents/lib/agentAutocompleteEligibility.ts:82— agentAutocompleteEligibility.getMentionableAgentPubkeys has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (14 pts), boolean chains 4, if/else 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
observerRelayStore.ingestArchivedObserverEvents (cognitive 21) desktop/src/features/agents/observerRelayStore.ts:849— observerRelayStore.ingestArchivedObserverEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentCardViewerDialog.AgentCardViewerContent (cognitive 21) desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:90— AgentCardViewerDialog.AgentCardViewerContent has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 4, if/else 4 (nesting depth added 4). Of this number, 16 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
agentSessionTranscriptPresentation.getActivityHeadline (cognitive 21) desktop/src/features/agents/ui/agentSessionTranscriptPresentation.ts:30— agentSessionTranscriptPresentation.getActivityHeadline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TeamSnapshotImportDialog.ResultBody (cognitive 21) desktop/src/features/agents/ui/TeamSnapshotImportDialog.tsx:237— TeamSnapshotImportDialog.ResultBody has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useCommunityUnread.useCommunityUnread (cognitive 21) desktop/src/features/communities/useCommunityUnread.ts:50— useCommunityUnread.useCommunityUnread has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (3 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 8). None of this is in the body itself: all 21 points belong to 5 function literals inside it that branch (lines 113, 73, 89, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddAgentDialog.AddAgentDialog::handleAdd (cognitive 21) desktop/src/features/huddle/components/AddAgentDialog.tsx:77— AddAgentDialog.AddAgentDialog::handleAdd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 3 (6 pts), ternaries 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
imetaMediaMarkdown.findSpoileredImetaMediaUrls (cognitive 21) desktop/src/features/messages/lib/imetaMediaMarkdown.ts:227— imetaMediaMarkdown.findSpoileredImetaMediaUrls has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mentionHighlightExtension.selectionAfterMentionTrailingSpace (cognitive 21) REDACTED:602— mentionHighlightExtension.selectionAfterMentionTrailingSpace has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, loops 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 620, 647). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
selectionBlockFormatting.isolateCaretLineForBlockFormatting (cognitive 21) desktop/src/features/messages/lib/selectionBlockFormatting.ts:41— selectionBlockFormatting.isolateCaretLineForBlockFormatting has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2 (nesting depth added 7). Of this number, 18 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DraftsPanel.DraftRow (cognitive 21) desktop/src/features/messages/ui/DraftsPanel.tsx:335— DraftsPanel.DraftRow has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemMessageAvatars.SystemMessageAvatar (cognitive 21) desktop/src/features/messages/ui/SystemMessageAvatars.tsx:35— SystemMessageAvatars.SystemMessageAvatar has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useLoadMissingAncestors.useLoadMissingAncestors (cognitive 21) desktop/src/features/messages/useLoadMissingAncestors.ts:13— useLoadMissingAncestors.useLoadMissingAncestors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 pts), boolean chains 3, error handling 1 (nesting depth added 6). None of this is in the body itself: all 21 points belong to 3 function literals inside it that branch (lines 30, 81, 21). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MembershipDenied.MembershipDenied (cognitive 21) desktop/src/features/onboarding/ui/MembershipDenied.tsx:25— MembershipDenied.MembershipDenied has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (16 pts), error handling 2, if/else 2, boolean chains 1 (nesting depth added 8). Of this number, 14 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PresenceSubscriptionReconciler.reconcile (cognitive 21) desktop/src/features/presence/lib/presenceSubscriptionReconciler.ts:97— PresenceSubscriptionReconciler.reconcile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projectModels.validateProjectEventEnvelope (cognitive 21) desktop/src/features/projects/projectModels.ts:157— projectModels.validateProjectEventEnvelope has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectRepositorySource.RepoSourceDropdown (cognitive 21) desktop/src/features/projects/ui/ProjectRepositorySource.tsx:218— ProjectRepositorySource.RepoSourceDropdown has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (17 pts), boolean chains 4 (nesting depth added 4). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
useSearchResults.useSearchResults (cognitive 21) desktop/src/features/search/useSearchResults.ts:102— useSearchResults.useSearchResults has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 3, ternaries 3. Of this number, 18 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
use-updater.useUpdater.runUpdateCheck (cognitive 21) desktop/src/features/settings/hooks/use-updater.ts:125— use-updater.useUpdater.runUpdateCheck has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, 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.
EncryptedBackupCreator.EncryptedBackupCreator (cognitive 21) desktop/src/features/settings/ui/EncryptedBackupCreator.tsx:254— EncryptedBackupCreator.EncryptedBackupCreator has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 3, if/else 2 (nesting depth added 7). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidebarSection.ChannelMenuButton (cognitive 21) desktop/src/features/sidebar/ui/SidebarSection.tsx:246— SidebarSection.ChannelMenuButton has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 9 (10 pts), if/else 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rehypeSearchHighlight.rehypeSearchHighlight (cognitive 21) desktop/src/shared/lib/rehypeSearchHighlight.ts:40— rehypeSearchHighlight.rehypeSearchHighlight has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 42). 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.
VideoPlayer.VideoScrubber (cognitive 21) desktop/src/shared/ui/VideoPlayer.tsx:353— VideoPlayer.VideoScrubber has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, ternaries 7, boolean chains 3, match/switch 1. Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 442, 398, 418, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RepoDetailPage.RepoDetailPage (cognitive 21) web/src/features/repos/ui/RepoDetailPage.tsx:181— RepoDetailPage.RepoDetailPage has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8, boolean chains 6, if/else 6, error handling 1. Of this number, 16 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EntityDeletionStore::transition_stage (cognitive 20) REDACTED:214— EntityDeletionStore::transition_stage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Progress::rebuild (cognitive 20) crates/buzz-deletion/src/user/workflow.rs:101— Progress::rebuild has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.test_concurrent_stability (cognitive 20) docs/formal/nip-rs-unread/exhaustive.py:297— exhaustive.test_concurrent_stability has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 1 (5 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
generate-dev-icon.swift.top-level code (cognitive 20) scripts/generate-dev-icon.swift:9— generate-dev-icon.swift.top-level code has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CommunityGridAction.build (cognitive 20) mobile/lib/features/channels/channels_page/community_switcher_action.dart:16— _CommunityGridAction.build has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 3, if/else 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChannelsNotifier._fetchChannelHistoryBatch (cognitive 20) mobile/lib/features/channels/channels_provider.dart:557— ChannelsNotifier._fetchChannelHistoryBatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), ternaries 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ComposeBarLayout._buildBar (cognitive 20) mobile/lib/features/channels/compose_bar/layout.dart:86— _ComposeBarLayout._buildBar has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 7, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
_VideoZoomSurface.build (cognitive 20) mobile/lib/features/channels/media_viewer_page/video_zoom_surface.dart:27— _VideoZoomSurface.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MobileHuddleController._start (cognitive 20) mobile/lib/features/channels/mobile_huddle_controller.dart:143— MobileHuddleController._start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MobileHuddleController.end (cognitive 20) mobile/lib/features/channels/mobile_huddle_controller.dart:431— MobileHuddleController.end has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ReactionRow.build (cognitive 20) mobile/lib/features/channels/reaction_row.dart:132— ReactionRow.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeviceVoiceNotePlayerController._load (cognitive 20) mobile/lib/features/channels/voice_note_recording.dart:709— DeviceVoiceNotePlayerController._load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, 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.
PairingNotifier._processPayload (cognitive 20) mobile/lib/features/pairing/pairing_provider.dart:723— PairingNotifier._processPayload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ConnectionSection.build (cognitive 20) mobile/lib/features/settings/settings_page/connection_section.dart:8— _ConnectionSection.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeviceIdentitySource._read (cognitive 20) mobile/lib/shared/hosted/device_identity_source.dart:51— DeviceIdentitySource._read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), ternaries 1 (4 pts), boolean chains 1, error handling 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.
ReadStateManager._handleIncomingEvent (cognitive 20) mobile/lib/shared/read_state/read_state_manager.dart:337— ReadStateManager._handleIncomingEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RelaySessionNotifier.searchProfiles (cognitive 20) mobile/lib/shared/relay/relay_session.dart:182— RelaySessionNotifier.searchProfiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 7, loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RelaySessionNotifier._sendReplayBatches (cognitive 20) mobile/lib/shared/relay/relay_session.dart:719— RelaySessionNotifier._sendReplayBatches has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IosMediaCarousel.build (cognitive 20) mobile/lib/shared/widgets/ios_media_carousel.dart:39— IosMediaCarousel.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentManagement.parseAgentManagementRequest (cognitive 20) desktop/src/features/agents/agentManagement.ts:57— agentManagement.parseAgentManagementRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 6, boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
agentWorkingSignal.getWorkingChannels (cognitive 20) desktop/src/features/agents/agentWorkingSignal.ts:209— agentWorkingSignal.getWorkingChannels has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentConfigOptions.computeLocalModeGate (cognitive 20) REDACTED:659— agentConfigOptions.computeLocalModeGate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentSessionTranscriptList.AgentSessionTranscriptList (cognitive 20) desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:114— AgentSessionTranscriptList.AgentSessionTranscriptList has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 7, if/else 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HuddleAttachment.reconstructHuddleLifecycle (cognitive 20) desktop/src/features/huddle/components/HuddleAttachment.tsx:65— HuddleAttachment.reconstructHuddleLifecycle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageReactions.ReactionPill (cognitive 20) desktop/src/features/messages/ui/MessageReactions.tsx:355— MessageReactions.ReactionPill has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 7, boolean chains 3 (nesting depth added 3). Of this number, 13 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
useNewMessageRecipients.useNewMessageRecipients.searchResults (cognitive 20) desktop/src/features/messages/ui/useNewMessageRecipients.ts:101— useNewMessageRecipients.useNewMessageRecipients.searchResults has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (4 pts), ternaries 3 (4 pts), loops 3 (nesting depth added 2). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (addCandidate). 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.
ProjectRepositoryPanel.fileIconVisual (cognitive 20) desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:260— ProjectRepositoryPanel.fileIconVisual has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RemindersPanel.ReminderRow (cognitive 20) desktop/src/features/reminders/ui/RemindersPanel.tsx:118— RemindersPanel.ReminderRow has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 7, if/else 2 (nesting depth added 2). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
CreateChannelFormFields.CreateChannelFormFields (cognitive 20) desktop/src/features/sidebar/ui/CreateChannelFormFields.tsx:39— CreateChannelFormFields.CreateChannelFormFields has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidebarDnd.SidebarDndContext (cognitive 20) desktop/src/features/sidebar/ui/SidebarDnd.tsx:184— SidebarDnd.SidebarDndContext has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 233, 208). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
workflowStepDescription.configuredStepDetail (cognitive 20) desktop/src/features/workflows/ui/workflowStepDescription.ts:37— workflowStepDescription.configuredStepDetail has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 2 (4 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
detectPrefixQuery.detectPrefixQuery (cognitive 20) desktop/src/shared/lib/detectPrefixQuery.ts:16— detectPrefixQuery.detectPrefixQuery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.test_merge_algebra_b (cognitive 19) docs/formal/nip-rs-unread/exhaustive.py:56— exhaustive.test_merge_algebra_b has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (9 pts) (nesting depth added 10). 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.
exhaustive._dead_register_points (cognitive 19) docs/formal/nip-rs-unread/exhaustive.py:645— exhaustive._dead_register_points has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (8 pts), boolean chains 1 (nesting depth added 12). 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.
exhaustive.test_escaped_context_slot_grouping (cognitive 19) docs/formal/nip-rs-unread/exhaustive.py:1188— exhaustive.test_escaped_context_slot_grouping has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prepare-inter.verify (cognitive 19) mobile/scripts/prepare-inter.py:21— prepare-inter.verify has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 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.
MP4Canonicalizer.neutralizeSampleDependencyBoxes (cognitive 19) mobile/ios/Runner/MP4Canonicalizer.swift:10— MP4Canonicalizer.neutralizeSampleDependencyBoxes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeProfileSetupCoordinator.init (cognitive 19) mobile/ios/Runner/NativeProfileSetup.swift:26— NativeProfileSetupCoordinator.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BuzzPushSnapshotBridge.syncCommunities (cognitive 19) mobile/ios/Runner/PushSnapshotBridge.swift:136— BuzzPushSnapshotBridge.syncCommunities has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 5, 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.
_MembershipSystemMessageContent.build (cognitive 19) mobile/lib/features/channels/channel_detail_page/system_rows.dart:439— _MembershipSystemMessageContent.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 5, 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.
ChannelMessagesNotifier._init (cognitive 19) mobile/lib/features/channels/channel_messages_provider.dart:193— ChannelMessagesNotifier._init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (3 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.
ChannelSectionsManager._publish (cognitive 19) mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:465— ChannelSectionsManager._publish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 7, error handling 1 (nesting depth added 6). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_MentionSuggestionInfo.build (cognitive 19) mobile/lib/features/channels/compose_bar/suggestions.dart:115— _MentionSuggestionInfo.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
_DeepLinkDispatcherState._dispatchOnboarding (cognitive 19) mobile/lib/features/channels/deep_link_dispatcher.dart:98— _DeepLinkDispatcherState._dispatchOnboarding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_IosAddMembersSheetState._drainAvatars (cognitive 19) mobile/lib/features/channels/ios_add_members_sheet.dart:68— _IosAddMembersSheetState._drainAvatars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (7 pts), boolean chains 6, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_MessageImageCarousel.build (cognitive 19) mobile/lib/features/channels/message_content/media_carousel.dart:98— _MessageImageCarousel.build has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (7 pts), loops 6, boolean chains 3, if/else 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_MessageLongPressRegion.build (cognitive 19) mobile/lib/features/channels/message_long_press_region.dart:112— _MessageLongPressRegion.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 2 (3 pts), ternaries 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MessageSkeletonBody.build (cognitive 19) mobile/lib/features/channels/message_skeleton_body.dart:24— MessageSkeletonBody.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (4 pts), boolean chains 2, ternaries 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.
SendMessage.call (cognitive 19) mobile/lib/features/channels/send_message_provider.dart:49— SendMessage.call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, ternaries 3, boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ThreadHeadScrollInput.build (cognitive 19) mobile/lib/features/channels/thread_detail_page/head_layout.dart:62— _ThreadHeadScrollInput.build has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 7, if/else 3 (4 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BrowserAuth.start (cognitive 19) mobile/lib/shared/hosted/browser_auth.dart:110— BrowserAuth.start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 3, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedRelayAuth.headers (cognitive 19) mobile/lib/shared/hosted/hosted_relay_auth.dart:62— HostedRelayAuth.headers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HuddleTransport._handleRoster (cognitive 19) mobile/lib/shared/huddle/huddle_transport.dart:641— HuddleTransport._handleRoster has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NsecExportSheet.build (cognitive 19) mobile/lib/shared/identity_transfer/nsec_export_sheet.dart:37— NsecExportSheet.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MeSync._writeCache (cognitive 19) mobile/lib/shared/me/me_sync.dart:277— MeSync._writeCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuzzPushLeaseDescriptor.fromRelayInformation (cognitive 19) mobile/lib/shared/push/dev_push_lease.dart:43— BuzzPushLeaseDescriptor.fromRelayInformation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RelaySessionNotifier._postForEvents (cognitive 19) mobile/lib/shared/relay/relay_session.dart:237— RelaySessionNotifier._postForEvents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterChipBar.build (cognitive 19) mobile/lib/shared/widgets/filter_chip_bar.dart:66— FilterChipBar.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CarouselImages._drain (cognitive 19) mobile/lib/shared/widgets/ios_media_carousel.dart:168— _CarouselImages._drain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_TextEditSheet.build (cognitive 19) mobile/lib/shared/widgets/text_editor.dart:93— _TextEditSheet.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 6, boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useAppShellKeyboardShortcuts.useAppShellKeyboardShortcuts (cognitive 19) desktop/src/app/useAppShellKeyboardShortcuts.ts:21— useAppShellKeyboardShortcuts.useAppShellKeyboardShortcuts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 9. None of this is in the body itself: all 19 points belong to 3 function literals inside it that branch (lines 56, 39, 32). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AdminConsoleActionsTab.DirectActionsProvider (cognitive 19) desktop/src/features/admin-console/AdminConsoleActionsTab.tsx:194— AdminConsoleActionsTab.DirectActionsProvider has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 4, error handling 2 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 4 function items inside it that branch (a function literal at line 257, a function literal at line 229, locked, …). 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.
agentSessionTranscriptHelpers.parseSystemPromptSections::appendBaseAndWorkspace (cognitive 19) REDACTED:231— agentSessionTranscriptHelpers.parseSystemPromptSections::appendBaseAndWorkspace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (19 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. This shape REPEATS in the file: one other method here (agentSessionTranscriptHelpers.parseSystemPromptSections) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PersonaAdvancedFields.PersonaAdvancedFields (cognitive 19) desktop/src/features/agents/ui/PersonaAdvancedFields.tsx:41— PersonaAdvancedFields.PersonaAdvancedFields has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9, if/else 6 (8 pts), boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 126, 294, 312, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useManagedAgentRuntimeReconciliation.useManagedAgentRuntimeReconciliation (cognitive 19) desktop/src/features/agents/useManagedAgentRuntimeReconciliation.ts:30— useManagedAgentRuntimeReconciliation.useManagedAgentRuntimeReconciliation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 6, boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 19 points belong to 5 function literals inside it that branch (lines 75, 54, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditCommunityDialog.EditCommunityDialog (cognitive 19) desktop/src/features/communities/ui/EditCommunityDialog.tsx:34— EditCommunityDialog.EditCommunityDialog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 1 (2 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 70, 55). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useHuddleParticipantRoster.useHuddleParticipantRoster (cognitive 19) desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:277— useHuddleParticipantRoster.useHuddleParticipantRoster has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 6 (7 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 295, 310, 307, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
resolveLinkAt.resolveLinkAt (cognitive 19) desktop/src/features/messages/lib/resolveLinkAt.ts:22— resolveLinkAt.resolveLinkAt has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 3, loops 2. Of this number, 14 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useDrafts.readStore (cognitive 19) desktop/src/features/messages/lib/useDrafts.ts:214— useDrafts.readStore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useNonMemberInvite.useNonMemberInvite.invite (cognitive 19) desktop/src/features/messages/ui/useNonMemberInvite.ts:79— useNonMemberInvite.useNonMemberInvite.invite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 94, a function literal at line 150, isCurrent, …). 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.
MessageThreadSummaryRow.MessageThreadSummaryRow (cognitive 19) desktop/src/features/messages/ui/MessageThreadSummaryRow.tsx:81— MessageThreadSummaryRow.MessageThreadSummaryRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 4, if/else 1 (2 pts) (nesting depth added 5). Of this number, 11 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useComposerHeightPadding.useComposerHeightPadding (cognitive 19) desktop/src/features/messages/ui/useComposerHeightPadding.ts:24— useComposerHeightPadding.useComposerHeightPadding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 19 points belong to 5 function literals inside it that branch (lines 77, 121, 34, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useChannelTyping.useChannelTyping (cognitive 19) desktop/src/features/messages/useChannelTyping.ts:68— useChannelTyping.useChannelTyping has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 4. None of this is in the body itself: all 19 points belong to 8 function literals inside it that branch (lines 81, 140, 179, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
notificationFormat.formatMessageNotification (cognitive 19) desktop/src/features/notifications/lib/notificationFormat.ts:77— notificationFormat.formatMessageNotification has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (16 pts), boolean chains 2, if/else 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UserProfilePanelTabs.ProfileLiveActivityEmbed (cognitive 19) desktop/src/features/profile/ui/UserProfilePanelTabs.tsx:329— UserProfilePanelTabs.ProfileLiveActivityEmbed has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9, if/else 6, boolean chains 4. Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 382, 364, 430, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfilePanelUtils.personaManagedAgentUpdate (cognitive 19) desktop/src/features/profile/ui/UserProfilePanelUtils.ts:268— UserProfilePanelUtils.personaManagedAgentUpdate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
UserProfilePrimaryActions.ProfilePrimaryActions (cognitive 19) desktop/src/features/profile/ui/UserProfilePrimaryActions.tsx:25— UserProfilePrimaryActions.ProfilePrimaryActions has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 4, if/else 1 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProjectHomeContextPanel.ProjectHomeContextPanel (cognitive 19) desktop/src/features/projects/ui/ProjectHomeContextPanel.tsx:181— ProjectHomeContextPanel.ProjectHomeContextPanel has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 6, if/else 2 (nesting depth added 3). Of this number, 11 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, 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.
ProjectPullRequestFilesChangedPanel.changedFileIconVisual (cognitive 19) desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:179— ProjectPullRequestFilesChangedPanel.changedFileIconVisual has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProjectDetailFeedPanels.ContributorsPanel (cognitive 19) desktop/src/features/projects/ui/ProjectDetailFeedPanels.tsx:59— ProjectDetailFeedPanels.ContributorsPanel has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 6, if/else 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 72, 166, 117, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectDetailFeedPanels.ActivityPanel (cognitive 19) desktop/src/features/projects/ui/ProjectDetailFeedPanels.tsx:238— ProjectDetailFeedPanels.ActivityPanel has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 4, if/else 2 (nesting depth added 5). Of this number, 10 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectsSectionSearch.ProjectsSectionSearch (cognitive 19) desktop/src/features/projects/ui/ProjectsSectionSearch.tsx:14— ProjectsSectionSearch.ProjectsSectionSearch has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 3 (4 pts), boolean chains 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: 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.
useChannelMutes.useChannelMutes (cognitive 19) desktop/src/features/sidebar/lib/useChannelMutes.ts:19— useChannelMutes.useChannelMutes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useChannelStars.useChannelStars (cognitive 19) desktop/src/features/sidebar/lib/useChannelStars.ts:19— useChannelStars.useChannelStars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 142, 41, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkflowScheduleFields.WorkflowScheduleFields (cognitive 19) desktop/src/features/workflows/ui/WorkflowScheduleFields.tsx:52— WorkflowScheduleFields.WorkflowScheduleFields has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 3 (6 pts), boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 150, 84, 100, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buzz_admin::reconcile_channels (cognitive 18) crates/buzz-admin/src/main.rs:722— buzz_admin::reconcile_channels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandVerifier::authenticate_at (cognitive 18) crates/buzz-auth/src/nip_fi/command.rs:325— CommandVerifier::authenticate_at has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeletionStore::admit_owner_request (cognitive 18) REDACTED:914— DeletionStore::admit_owner_request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DesktopMeshRuntime::start (cognitive 18) desktop/src-tauri/src/mesh_llm/mod.rs:340— DesktopMeshRuntime::start 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.
MobileInviteJoinRecovery.ensureStarterChannels (cognitive 18) mobile/lib/app.dart:123— MobileInviteJoinRecovery.ensureStarterChannels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 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.
ObserverRelayNotifier._subscribe (cognitive 18) mobile/lib/features/channels/agent_activity/observer_subscription.dart:110— ObserverRelayNotifier._subscribe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ToolItemWidget.build (cognitive 18) mobile/lib/features/channels/agent_activity/transcript_item_widget.dart:276— _ToolItemWidget.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ReplyHandoffs.update (cognitive 18) mobile/lib/features/channels/agent_reply_handoff.dart:27— _ReplyHandoffs.update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AttachmentSurfacePanel.build (cognitive 18) mobile/lib/features/channels/compose_bar/attachments.dart:152— _AttachmentSurfacePanel.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 4, if/else 4, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_MarkdownEditingController._buildMarkdownSpans (cognitive 18) mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart:105— _MarkdownEditingController._buildMarkdownSpans has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_InviteLinkSection.build (cognitive 18) mobile/lib/features/invites/invite_create_page/invite_link_section.dart:6— _InviteLinkSection.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, ternaries 3, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PairingNotifier._pairLegacy (cognitive 18) mobile/lib/features/pairing/pairing_provider.dart:868— PairingNotifier._pairLegacy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ProfileTextEditSheet.build (cognitive 18) mobile/lib/features/profile/profile_edit_page.dart:648— _ProfileTextEditSheet.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 6, boolean chains 2, error handling 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.
HpkeBackup.associatedData (cognitive 18) mobile/lib/shared/hosted/hpke_backup.dart:76— HpkeBackup.associatedData has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (7 pts), error handling 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeMessagePresentation.present (cognitive 18) mobile/lib/shared/widgets/native_message_presentation.dart:30— NativeMessagePresentation.present has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, error handling 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.
MemorySection.MemoryGraphView (cognitive 18) desktop/src/features/agent-memory/ui/MemorySection.tsx:242— MemorySection.MemoryGraphView has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 6, if/else 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
observerRelayStore.appendAgentEvents (cognitive 18) desktop/src/features/agents/observerRelayStore.ts:233— observerRelayStore.appendAgentEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4, loops 2 (3 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
usePersonaSync.fetchOwnerHistoryToExhaustion (cognitive 18) desktop/src/features/agents/lib/usePersonaSync.ts:188— usePersonaSync.fetchOwnerHistoryToExhaustion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus (cognitive 18) desktop/src/features/agents/ui/personaModelDiscoveryStatus.ts:44— personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (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.
CompactToolSummaryRow.CompactToolSummaryRow (cognitive 18) desktop/src/features/agents/ui/AgentSessionToolItem/CompactToolSummaryRow.tsx:22— CompactToolSummaryRow.CompactToolSummaryRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 3, if/else 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useObserverEvents.useLoadArchivedObserverEvents (cognitive 18) desktop/src/features/agents/ui/useObserverEvents.ts:115— useObserverEvents.useLoadArchivedObserverEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, error handling 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 210, 159, 165, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
observedUnreadStorage.readObservedUnreadFromStorage (cognitive 18) desktop/src/features/channels/observedUnreadStorage.ts:151— observedUnreadStorage.readObservedUnreadFromStorage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
huddlePresence.fetchHuddleLifecycleHistory (cognitive 18) desktop/src/features/huddle/lib/huddlePresence.ts:207— huddlePresence.fetchHuddleLifecycleHistory has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mentionPasteBinding.useMentionPasteBinding (cognitive 18) desktop/src/features/messages/lib/mentionPasteBinding.ts:150— mentionPasteBinding.useMentionPasteBinding has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5 (6 pts), error handling 1 (nesting depth added 4). None of this is in the body itself: all 18 points belong to 4 function literals inside it that branch (lines 215, 252, 194, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
normalizeMentionClipboard.normalizeMentionClipboardContent (cognitive 18) desktop/src/features/messages/lib/normalizeMentionClipboard.ts:121— normalizeMentionClipboard.normalizeMentionClipboardContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 3 (6 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
threadPanel.buildDescendantStatsByMessageId (cognitive 18) desktop/src/features/messages/lib/threadPanel.ts:121— threadPanel.buildDescendantStatsByMessageId has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
submitMessageEdit.submitMessageEdit (cognitive 18) desktop/src/features/messages/ui/submitMessageEdit.ts:70— submitMessageEdit.submitMessageEdit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 189, a function literal at line 148, finishEdit, …). 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.
MessageReactions.MessageReactions (cognitive 18) desktop/src/features/messages/ui/MessageReactions.tsx:144— MessageReactions.MessageReactions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 2. Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 211, 182, 172, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
desktop.getDesktopNotificationPermissionState (cognitive 18) desktop/src/features/notifications/lib/desktop.ts:134— desktop.getDesktopNotificationPermissionState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AvatarStep.AvatarStepActions (cognitive 18) desktop/src/features/onboarding/ui/AvatarStep.tsx:125— AvatarStep.AvatarStepActions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnimatedAvatarBackdropPanel.AnimatedAvatarBackdropPanel (cognitive 18) desktop/src/features/profile/ui/AnimatedAvatarBackdropPanel.tsx:20— AnimatedAvatarBackdropPanel.AnimatedAvatarBackdropPanel has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 4, if/else 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 38, 64). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AnimatedAvatarControls.AvatarFilmstripPicker (cognitive 18) desktop/src/features/profile/ui/AnimatedAvatarControls.tsx:349— AnimatedAvatarControls.AvatarFilmstripPicker has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, ternaries 7 (9 pts) (nesting depth added 2). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 408, 366, 387, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectRepositorySource.RepositoryBranchDropdown (cognitive 18) desktop/src/features/projects/ui/ProjectRepositorySource.tsx:38— ProjectRepositorySource.RepositoryBranchDropdown has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 3, if/else 3 (nesting depth added 4). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reminderFilters.groupReminders (cognitive 18) desktop/src/features/reminders/lib/reminderFilters.ts:56— reminderFilters.groupReminders has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HarnessRow.RuntimeActions (cognitive 18) desktop/src/features/settings/ui/HarnessRow.tsx:174— HarnessRow.RuntimeActions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (15 pts), boolean chains 3 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SidebarRelayConnectionCard.SidebarRelayConnectionCompactCard (cognitive 18) desktop/src/features/sidebar/ui/SidebarRelayConnectionCard.tsx:50— SidebarRelayConnectionCard.SidebarRelayConnectionCompactCard has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 13 (17 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ReadOnlyRelayClient.handleWsMessage (cognitive 18) desktop/src/shared/api/readOnlyRelayClient.ts:216— ReadOnlyRelayClient.handleWsMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RelayReconnectController.start (cognitive 18) desktop/src/shared/api/relayReconnectController.ts:130— RelayReconnectController.start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 3 (4 pts), boolean chains 2 (nesting depth added 4). Of this number, 16 points are the body's own statements and 2 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sidebar-action-card.SidebarCompactActionCard (cognitive 18) desktop/src/shared/ui/sidebar-action-card.tsx:188— sidebar-action-card.SidebarCompactActionCard has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 15 (16 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MediaConfig::validate (cognitive 17) crates/buzz-media/src/config.rs:102— MediaConfig::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
buzz_relay_mesh::runtime::control_stream_exchange (cognitive 17) crates/buzz-relay-mesh/src/runtime.rs:539— buzz_relay_mesh::runtime::control_stream_exchange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (6 pts), match/switch 2 (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.
buzz_search::query::search (cognitive 17) crates/buzz-search/src/query.rs:230— buzz_search::query::search has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IdentityFilePlugin.onMethodCall (cognitive 17) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/IdentityFilePlugin.kt:24— IdentityFilePlugin.onMethodCall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppDelegate.generateVideoPoster (cognitive 17) mobile/ios/Runner/AppDelegate.swift:1061— AppDelegate.generateVideoPoster has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuzzBrowserAuthBridge.init (cognitive 17) mobile/ios/Runner/AppDelegate.swift:1148— BuzzBrowserAuthBridge.init has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
App.build (cognitive 17) mobile/lib/app.dart:305— App.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, match/switch 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ActivityNotifier._subscribeLive (cognitive 17) mobile/lib/features/activity/activity_provider.dart:100— ActivityNotifier._subscribeLive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelSectionStore.fromJson (cognitive 17) mobile/lib/features/channels/channel_sections/channel_sections_storage.dart:61— ChannelSectionStore.fromJson has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelTypingNotifier._subscribeLive (cognitive 17) mobile/lib/features/channels/channel_typing_provider.dart:100— ChannelTypingNotifier._subscribeLive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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.
_QuickReactionRow.build (cognitive 17) mobile/lib/features/channels/message_actions/quick_reaction_row.dart:28— _QuickReactionRow.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_SearchBody.build (cognitive 17) mobile/lib/features/search/search_page.dart:258— _SearchBody.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HpkeBackup.seal (cognitive 17) mobile/lib/shared/hosted/hpke_backup.dart:17— HpkeBackup.seal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 5, error handling 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadStateManager._publishOnce (cognitive 17) mobile/lib/shared/read_state/read_state_manager.dart:462— ReadStateManager._publishOnce has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcentricSheetSurface.build (cognitive 17) mobile/lib/shared/widgets/concentric_sheet_surface.dart:113— ConcentricSheetSurface.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
SkeletonReveal.build (cognitive 17) mobile/lib/shared/widgets/skeleton_reveal.dart:36— SkeletonReveal.build has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 4 (5 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
agentSessionTranscript.upsertTool (cognitive 17) desktop/src/features/agents/ui/agentSessionTranscript.ts:607— agentSessionTranscript.upsertTool has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 6, if/else 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentCardViewerDialog.AgentCardGalleryContent (cognitive 17) desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:265— AgentCardViewerDialog.AgentCardGalleryContent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (17 pts) (nesting depth added 11). Of this number, 9 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
usePersonaModelDiscovery.getDiscoveredPersonaModelOptions (cognitive 17) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:53— usePersonaModelDiscovery.getDiscoveredPersonaModelOptions has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 6, if/else 2 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentDefinitionSubmitPayload.buildRuntimeModelProviderPayload (cognitive 17) desktop/src/features/agents/ui/agentDefinitionSubmitPayload.ts:13— agentDefinitionSubmitPayload.buildRuntimeModelProviderPayload has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (7 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
agentSessionTranscriptGrouping.flattenDisplayBlocks (cognitive 17) desktop/src/features/agents/ui/agentSessionTranscriptGrouping.ts:710— agentSessionTranscriptGrouping.flattenDisplayBlocks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usePersonaActions.usePersonaActions.handleSetActive (cognitive 17) desktop/src/features/agents/ui/usePersonaActions.ts:298— usePersonaActions.usePersonaActions.handleSetActive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useChannelUnreadState.useChannelUnreadState (cognitive 17) desktop/src/features/channels/ui/useChannelUnreadState.ts:62— useChannelUnreadState.useChannelUnreadState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 4, loops 2 (3 pts), ternaries 2 (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 7 function literals inside it that branch (lines 275, 286, 123, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useMembersSidebarActions.useMembersSidebarActions.handleLifecycleAction (cognitive 17) desktop/src/features/channels/ui/useMembersSidebarActions.ts:162— useMembersSidebarActions.useMembersSidebarActions.handleLifecycleAction has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (6 pts), boolean chains 1, 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.
useHomeInboxReadState.useHomeInboxReadState.markItemRead (cognitive 17) desktop/src/features/home/useHomeInboxReadState.ts:211— useHomeInboxReadState.useHomeInboxReadState.markItemRead has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
imetaMediaMarkdown.imetaMediaFromTags (cognitive 17) desktop/src/features/messages/lib/imetaMediaMarkdown.ts:52— imetaMediaMarkdown.imetaMediaFromTags has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 2 (3 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.
extractMentionPubkeys.extractMentionPubkeys (cognitive 17) desktop/src/features/messages/lib/extractMentionPubkeys.ts:118— extractMentionPubkeys.extractMentionPubkeys has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mentionTokenSpans.findMentionTokenSpans (cognitive 17) desktop/src/features/messages/lib/mentionTokenSpans.ts:90— mentionTokenSpans.findMentionTokenSpans has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
threadPanel.buildThreadSummaryFromVisibleEntries (cognitive 17) desktop/src/features/messages/lib/threadPanel.ts:247— threadPanel.buildThreadSummaryFromVisibleEntries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts) (nesting depth added 8). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiffViewer.DiffViewer (cognitive 17) desktop/src/features/messages/ui/DiffViewer.tsx:47— DiffViewer.DiffViewer has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 5, if/else 2 (nesting depth added 3). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 92). 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.
useAgentAddressLockPicker.useAgentAddressLockPicker.toggleAlwaysAddressAgent (cognitive 17) desktop/src/features/messages/ui/useAgentAddressLockPicker.ts:194— useAgentAddressLockPicker.useAgentAddressLockPicker.toggleAlwaysAddressAgent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useComposerLinkPreviews.ComposerLinkPreviewCard (cognitive 17) desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:72— useComposerLinkPreviews.ComposerLinkPreviewCard has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useAnchoredScroll.useAnchoredScroll.onScroll (cognitive 17) desktop/src/features/messages/ui/useAnchoredScroll.ts:551— useAnchoredScroll.useAnchoredScroll.onScroll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hooks.useFirstRunOnboardingGate (cognitive 17) desktop/src/features/onboarding/hooks.ts:282— hooks.useFirstRunOnboardingGate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 324, 391, 310, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfilePanelSections.ProfileHero (cognitive 17) desktop/src/features/profile/ui/UserProfilePanelSections.tsx:606— UserProfilePanelSections.ProfileHero has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 12 (15 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.
NoteCard.NoteCard (cognitive 17) desktop/src/features/pulse/ui/NoteCard.tsx:137— NoteCard.NoteCard has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 15 (16 pts), if/else 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
parseSearchOperators.parseSearchOperators (cognitive 17) desktop/src/features/search/lib/parseSearchOperators.ts:78— parseSearchOperators.parseSearchOperators has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
CustomHarnessForm.CustomHarnessForm (cognitive 17) desktop/src/features/settings/ui/CustomHarnessForm.tsx:206— CustomHarnessForm.CustomHarnessForm has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 5, if/else 2, error handling 1 (nesting depth added 2). Of this number, 10 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
channelSectionsStorage.parseChannelSectionPayload (cognitive 17) desktop/src/features/sidebar/lib/channelSectionsStorage.ts:37— channelSectionsStorage.parseChannelSectionPayload has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, ternaries 4 (6 pts), if/else 3 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 43, 74). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
terminalRenderer.resolvePackedColor (cognitive 17) desktop/src/features/terminal/terminalRenderer.ts:103— terminalRenderer.resolvePackedColor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CronExpressionInput.CronExpressionInput (cognitive 17) desktop/src/features/workflows/ui/CronExpressionInput.tsx:14— CronExpressionInput.CronExpressionInput has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 1. Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 104, 132, 33, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RelayClient.resetConnection (cognitive 17) desktop/src/shared/api/relayClientSession.ts:1124— RelayClient.resetConnection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deep-link.listenForEntityDeepLinks (cognitive 17) desktop/src/shared/deep-link.ts:284— deep-link.listenForEntityDeepLinks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), error handling 1 (nesting depth added 7). None of this is in the body itself: all 17 points belong to 3 function items inside it that branch (a function literal at line 293, a function literal at line 319, drain). 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.
useResolvedLinkPreviews.fetchBuzzEntityMetadata (cognitive 17) desktop/src/shared/lib/useResolvedLinkPreviews.ts:436— useResolvedLinkPreviews.fetchBuzzEntityMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
remarkSpoilers.groupSpoilers (cognitive 17) desktop/src/shared/lib/remarkSpoilers.ts:45— remarkSpoilers.groupSpoilers 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.
segmented-control.SegmentedControl (cognitive 17) desktop/src/shared/ui/segmented-control.tsx:20— segmented-control.SegmentedControl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 2. Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 7 function items inside it that branch (handlePointerMove, a function literal at line 83, handlePointerDown, …). 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.
ObserverPublishQueue::next_frame (cognitive 16) crates/buzz-acp/src/lib.rs:1301— ObserverPublishQueue::next_frame has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EffectiveRules::for_ref (cognitive 16) crates/buzz-core/src/git_perms.rs:471— EffectiveRules::for_ref has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NostrWsConnection::wait_for_auth_challenge (cognitive 16) crates/buzz-ws-client/src/connection.rs:186— NostrWsConnection::wait_for_auth_challenge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VadEndpoint::process_frame (cognitive 16) desktop/src-tauri/src/huddle/stt.rs:265— VadEndpoint::process_frame has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MainActivity.handleTranscodeVideoToMp4 (cognitive 16) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/MainActivity.kt:327— MainActivity.handleTranscodeVideoToMp4 has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (6 pts), error handling 2, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exhaustive.check_convergence (cognitive 16) docs/formal/nip-rs-unread/exhaustive.py:163— exhaustive.check_convergence has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 4 (7 pts) (nesting depth added 7). 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.
NotificationService.didReceive (cognitive 16) mobile/ios/NotificationService/NotificationService.swift:98— NotificationService.didReceive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeCommunityEntryController.render (cognitive 16) mobile/ios/Runner/NativeCommunityEntry.swift:198— NativeCommunityEntryController.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (5 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeProfileTextEditorCoordinator.handle (cognitive 16) mobile/ios/Runner/NativeProfileTextEditor.swift:27— NativeProfileTextEditorCoordinator.handle has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 2, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NativeProfileTextEditorViewController.setTapped (cognitive 16) mobile/ios/Runner/NativeProfileTextEditor.swift:469— NativeProfileTextEditorViewController.setTapped has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActivityNotifier._drainRefreshQueue (cognitive 16) mobile/lib/features/activity/activity_provider.dart:388— ActivityNotifier._drainRefreshQueue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), error handling 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_MobileHuddleDrawer.build (cognitive 16) mobile/lib/features/channels/channel_detail_page/huddle_drawer.dart:130— _MobileHuddleDrawer.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8, boolean chains 4, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChannelMutesManager._applyEvents (cognitive 16) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:284— ChannelMutesManager._applyEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelStarsManager._applyEvents (cognitive 16) mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:284— ChannelStarsManager._applyEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelTypingNotifier._handleTypingEvent (cognitive 16) mobile/lib/features/channels/channel_typing_provider.dart:164— ChannelTypingNotifier._handleTypingEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MeUnreadChannelIds.build (cognitive 16) mobile/lib/features/channels/me/me_unread_provider.dart:17— MeUnreadChannelIds.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MobileHuddleController._finishLeaveLifecycle (cognitive 16) mobile/lib/features/channels/mobile_huddle_controller.dart:388— MobileHuddleController._finishLeaveLifecycle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 3 (5 pts), boolean chains 3 (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.
TypingAvatarCluster.build (cognitive 16) mobile/lib/features/channels/typing_avatar_cluster.dart:14— TypingAvatarCluster.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), match/switch 2, boolean chains 1, if/else 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_FigmaHomeScreen.build (cognitive 16) mobile/lib/features/settings/theme_picker_page/theme_home_preview.dart:137— _FigmaHomeScreen.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RelaySessionNotifier._connect (cognitive 16) mobile/lib/shared/relay/relay_session.dart:584— RelaySessionNotifier._connect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_CarouselImages._sendFrames (cognitive 16) mobile/lib/shared/widgets/ios_media_carousel.dart:205— _CarouselImages._sendFrames has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 5, loops 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.
check-px-text-core.runPxTextCheck (cognitive 16) scripts/check-px-text-core.mjs:56— check-px-text-core.runPxTextCheck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdminConsolePanelHelpers.parseImetaAttachments (cognitive 16) desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:310— AdminConsolePanelHelpers.parseImetaAttachments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemorySection.MemoryEntryAccordion (cognitive 16) desktop/src/features/agent-memory/ui/MemorySection.tsx:526— MemorySection.MemoryEntryAccordion has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 6 (7 pts), if/else 2 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, 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.
agentSessionToolClassifier.classifyDeveloperHarnessTool (cognitive 16) desktop/src/features/agents/ui/agentSessionToolClassifier.ts:168— agentSessionToolClassifier.classifyDeveloperHarnessTool has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (6 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
observerRelayStore.handleRelayObserverEvent (cognitive 16) desktop/src/features/agents/observerRelayStore.ts:547— observerRelayStore.handleRelayObserverEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManagedAgentRow.AgentSummary (cognitive 16) desktop/src/features/agents/ui/ManagedAgentRow.tsx:203— ManagedAgentRow.AgentSummary has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
teamSnapshotImport.lib.deriveImportToast (cognitive 16) desktop/src/features/agents/ui/teamSnapshotImport.lib.ts:32— teamSnapshotImport.lib.deriveImportToast has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (5 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.
ManagedAgentSessionPanel.SessionBody (cognitive 16) desktop/src/features/agents/ui/ManagedAgentSessionPanel.tsx:208— ManagedAgentSessionPanel.SessionBody has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 3, if/else 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.
ModelPicker.ModelPicker::handleModelChange (cognitive 16) desktop/src/features/agents/ui/ModelPicker.tsx:175— ModelPicker.ModelPicker::handleModelChange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (3 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. This shape REPEATS in the file: one other method here (ModelPicker.ModelPicker) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
useCommunities.resolveCommunityUpdateResult (cognitive 16) desktop/src/features/communities/useCommunities.tsx:43— useCommunities.resolveCommunityUpdateResult has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
useHuddleReadMarker.useHuddleReadMarker (cognitive 16) desktop/src/features/channels/ui/useHuddleReadMarker.ts:21— useHuddleReadMarker.useHuddleReadMarker has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (6 pts), if/else 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 67, 29, 45, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddCommunityDialog.AddCommunityDialog (cognitive 16) desktop/src/features/communities/ui/AddCommunityDialog.tsx:30— AddCommunityDialog.AddCommunityDialog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 4, boolean chains 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, 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.
useForumMentionPreparation.useForumMentionPreparation.invite (cognitive 16) desktop/src/features/forum/ui/useForumMentionPreparation.ts:121— useForumMentionPreparation.useForumMentionPreparation.invite has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
inbox.buildInboxItems (cognitive 16) desktop/src/features/home/lib/inbox.ts:462— inbox.buildInboxItems has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 3, if/else 2 (3 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 538, 543). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
rowHeightEstimate.estimateRowHeight (cognitive 16) desktop/src/features/messages/lib/rowHeightEstimate.ts:111— rowHeightEstimate.estimateRowHeight has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelIntroBlock.ChannelIntroBlock (cognitive 16) desktop/src/features/messages/ui/ChannelIntroBlock.tsx:30— ChannelIntroBlock.ChannelIntroBlock has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (16 pts) (nesting depth added 7). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 70). 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.
NonMemberMentionDialog.NonMemberMentionDialog (cognitive 16) desktop/src/features/messages/ui/NonMemberMentionDialog.tsx:28— NonMemberMentionDialog.NonMemberMentionDialog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 2, boolean chains 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectionFormattingTray.SelectionFormattingTray (cognitive 16) desktop/src/features/messages/ui/SelectionFormattingTray.tsx:112— SelectionFormattingTray.SelectionFormattingTray has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 2. Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 224, 129, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SystemMessageRow.describeGroupedArrivals (cognitive 16) desktop/src/features/messages/ui/SystemMessageRow.tsx:361— SystemMessageRow.describeGroupedArrivals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimelineMessageList.TimelineMessageList (cognitive 16) desktop/src/features/messages/ui/TimelineMessageList.tsx:127— TimelineMessageList.TimelineMessageList has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 2, if/else 1, match/switch 1 (nesting depth added 5). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 218, 348). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UserProfilePanelFocusedViews.ChannelsFocusedView (cognitive 16) desktop/src/features/profile/ui/UserProfilePanelFocusedViews.tsx:42— UserProfilePanelFocusedViews.ChannelsFocusedView has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 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.
CreateProjectFormSettings.CreateProjectFormSettings (cognitive 16) desktop/src/features/projects/ui/CreateProjectFormSettings.tsx:26— CreateProjectFormSettings.CreateProjectFormSettings has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, ternaries 5. Of this number, 12 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, 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.
ProjectBrowserDialog.ProjectBrowserDialog (cognitive 16) desktop/src/features/projects/ui/ProjectBrowserDialog.tsx:29— ProjectBrowserDialog.ProjectBrowserDialog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3, boolean chains 2 (nesting depth added 6). Of this number, 8 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useSearchResults.useSearchResults.userResults (cognitive 16) desktop/src/features/search/useSearchResults.ts:331— useSearchResults.useSearchResults.userResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, loops 4, ternaries 1 (nesting depth added 1). Of this number, 8 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsPanels.useThemeCategories (cognitive 16) desktop/src/features/settings/ui/SettingsPanels.tsx:277— SettingsPanels.useThemeCategories has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (nesting depth added 7). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 278). 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.
SettingsView.SettingsView (cognitive 16) desktop/src/features/settings/ui/SettingsView.tsx:113— SettingsView.SettingsView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 134, 181, 188, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useStaleReaderRecovery.useStaleReaderRecovery (cognitive 16) desktop/src/features/sidebar/lib/useStaleReaderRecovery.ts:59— useStaleReaderRecovery.useStaleReaderRecovery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, ternaries 1 (nesting depth added 3). None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 89, 106, 127, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CustomChannelSection.SectionActionsMenu (cognitive 16) desktop/src/features/sidebar/ui/CustomChannelSection.tsx:120— CustomChannelSection.SectionActionsMenu has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
deep-link.drainPendingNavigationDeepLinks (cognitive 16) desktop/src/shared/deep-link.ts:194— deep-link.drainPendingNavigationDeepLinks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolveMentionNames.resolveMentionProps (cognitive 16) desktop/src/shared/lib/resolveMentionNames.ts:85— resolveMentionNames.resolveMentionProps has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
adaptive-theme.findColorWithLuminance (cognitive 16) desktop/src/shared/theme/adaptive-theme.ts:90— adaptive-theme.findColorWithLuminance has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmojiBurstProvider.EmojiBurstProvider (cognitive 16) desktop/src/shared/ui/EmojiBurstProvider.tsx:556— EmojiBurstProvider.EmojiBurstProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, loops 2 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 7 function literals inside it that branch (lines 576, 567, 671, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SpoilerParticles.mountSpoilerParticleCanvas (cognitive 16) desktop/src/shared/ui/SpoilerParticles.tsx:74— SpoilerParticles.mountSpoilerParticleCanvas has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 1. Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 6 function items inside it that branch (ensureScene, start, draw, …). 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.
rich-link-preview-attachment.RichLinkPreviewAttachment (cognitive 16) desktop/src/shared/ui/rich-link-preview-attachment.tsx:235— rich-link-preview-attachment.RichLinkPreviewAttachment has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 5, if/else 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
styled-qr-code.StyledQrCode (cognitive 16) desktop/src/shared/ui/styled-qr-code.tsx:89— styled-qr-code.StyledQrCode has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (3 members, 12 shared lines) · ×1
Near-duplicate member family (3 members, 12 shared lines) desktop/src-tauri/src/archive/store_migrations.rs:42— desktop/src-tauri/src/archive/store_migrations.rs:42-128 | desktop/src-tauri/src/archive/store_migrations.rs:191-251 | desktop/src-tauri/src/archive/store_migrations.rs:265-327 — These 3 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (180 shared lines) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:40-485 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:41-449 — These two members are variants of one another: 180 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (78 shared lines) crates/buzz-voice/src/pocket_april.rs:482— crates/buzz-voice/src/pocket_april.rs:482-623 | crates/buzz-voice/src/pocket_april.rs:825-918 — These two members are variants of one another: 78 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (48 shared lines) crates/buzz-agent/src/llm.rs:1878— crates/buzz-agent/src/llm.rs:1878-2074 | crates/buzz-agent/src/llm.rs:2271-2504 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (40 shared lines) crates/buzz-acp/src/relay.rs:3727— crates/buzz-acp/src/relay.rs:3727-3816 | crates/buzz-ws-client/src/message.rs:62-167 — These two members are variants of one another: 40 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (38 shared lines) desktop/src-tauri/src/archive/store.rs:608— desktop/src-tauri/src/archive/store.rs:608-689 | desktop/src-tauri/src/archive/store.rs:784-840 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) crates/buzz-sdk/src/builders.rs:769— crates/buzz-sdk/src/builders.rs:769-788 | desktop/src-tauri/src/events.rs:448-467 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) crates/buzz-admin/src/communities.rs:267— crates/buzz-admin/src/communities.rs:267-311 | crates/buzz-relay/src/handlers/community_provisioning.rs:180-202 — 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· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/buzz-db/src/store/event.rs:2353— crates/buzz-db/src/store/event.rs:2353-2398 | crates/buzz-db/src/store/event.rs:2413-2455 | crates/buzz-db/src/store/event.rs:2477-2507 | crates/buzz-db/src/store/event.rs:2736-2780 | crates/buzz-db/src/store/feed.rs:361-416 | crates/buzz-db/src/store/feed.rs:451-508 | crates/buzz-db/src/store/feed.rs:534-586 | crates/buzz-db/src/store/relay_members.rs:1219-1250 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/buzz-relay/src/handlers/command_executor.rs:299— crates/buzz-relay/src/handlers/command_executor.rs:299-426 | crates/buzz-relay/src/handlers/command_executor.rs:433-563 | crates/buzz-relay/src/handlers/command_executor.rs:570-636 | crates/buzz-relay/src/handlers/command_executor.rs:643-825 | crates/buzz-relay/src/handlers/command_executor.rs:1040-1145 | crates/buzz-relay/src/handlers/command_executor.rs:1152-1285 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (103–115 lines × 2) crates/buzz-db/src/store/event.rs:638— crates/buzz-db/src/store/event.rs:638-752 | crates/buzz-db/src/store/event.rs:1126-1228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (64 lines × 2) crates/buzz-dev-mcp/src/shell.rs:472— crates/buzz-dev-mcp/src/shell.rs:472-535 | desktop/src-tauri/src/managed_agents/git_bash.rs:339-402 — 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 (60–61 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:1041— crates/buzz-relay/src/handlers/command_executor.rs:1041-1101 | crates/buzz-relay/src/handlers/command_executor.rs:1153-1212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (56–58 lines × 2) crates/buzz-db/src/store/event.rs:469— crates/buzz-db/src/store/event.rs:469-524 | crates/buzz-db/src/store/event.rs:1857-1914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38–40 lines × 2) crates/buzz-db/src/store/event.rs:2359— crates/buzz-db/src/store/event.rs:2359-2398 | crates/buzz-db/src/store/event.rs:2418-2455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31–36 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:474— crates/buzz-db/src/store/relay_admin_actions.rs:474-509 | crates/buzz-db/src/store/relay_admin_actions.rs:570-600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–34 lines × 3) crates/buzz-db/src/store/relay_admin_actions.rs:474— crates/buzz-db/src/store/relay_admin_actions.rs:474-507 | crates/buzz-db/src/store/relay_admin_actions.rs:570-598 | crates/buzz-db/src/store/relay_admin_actions.rs:776-804 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (33–34 lines × 2) crates/buzz-relay/src/api/bridge.rs:2336— crates/buzz-relay/src/api/bridge.rs:2336-2368 | crates/buzz-relay/src/api/bridge.rs:2409-2442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) desktop/src-tauri/src/commands/media_animated.rs:104— desktop/src-tauri/src/commands/media_animated.rs:104-137 | desktop/src-tauri/src/commands/media_animated.rs:213-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–31 lines × 3) crates/buzz-cli/src/commands/issues.rs:542— crates/buzz-cli/src/commands/issues.rs:542-571 | crates/buzz-cli/src/commands/patches.rs:137-167 | crates/buzz-cli/src/commands/pr.rs:177-205 — before extracting anything, compare `crates/buzz-cli/src/commands/issues.rs` and `crates/buzz-cli/src/commands/patches.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (29–30 lines × 3) crates/buzz-acp/src/relay.rs:2045— crates/buzz-acp/src/relay.rs:2045-2074 | crates/buzz-acp/src/relay.rs:2084-2112 | crates/buzz-acp/src/relay.rs:2117-2145 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (28–30 lines × 3) crates/buzz-relay/src/api/bridge.rs:1000— crates/buzz-relay/src/api/bridge.rs:1000-1029 | crates/buzz-relay/src/api/bridge.rs:1393-1420 | crates/buzz-relay/src/api/bridge.rs:2087-2114 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (24–29 lines × 2) crates/buzz-relay/src/handlers/count.rs:94— crates/buzz-relay/src/handlers/count.rs:94-122 | crates/buzz-relay/src/handlers/req.rs:129-152 — before extracting anything, compare `crates/buzz-relay/src/handlers/count.rs` and `crates/buzz-relay/src/handlers/req.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 2) crates/buzz-voice/src/pocket_april.rs:575— crates/buzz-voice/src/pocket_april.rs:575-603 | crates/buzz-voice/src/pocket_april.rs:885-913 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28–29 lines × 2) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:54— desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:54-81 | desktop/src-tauri/src/managed_agents/runtime/process.rs:160-188 — 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 (26–28 lines × 3) crates/buzz-db/src/store/relay_admin_actions.rs:524— crates/buzz-db/src/store/relay_admin_actions.rs:524-551 | crates/buzz-db/src/store/relay_admin_actions.rs:617-642 | crates/buzz-db/src/store/relay_admin_actions.rs:814-840 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (28 lines × 2) crates/buzz-relay/src/audio/room.rs:346— crates/buzz-relay/src/audio/room.rs:346-373 | crates/buzz-relay/src/audio/room.rs:412-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25–27 lines × 3) crates/buzz-db/src/store/relay_admin_actions.rs:470— crates/buzz-db/src/store/relay_admin_actions.rs:470-496 | crates/buzz-db/src/store/relay_admin_actions.rs:566-590 | crates/buzz-db/src/store/relay_admin_actions.rs:671-695 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (26–27 lines × 2) desktop/src-tauri/src/nostr_convert.rs:118— desktop/src-tauri/src/nostr_convert.rs:118-144 | desktop/src-tauri/src/nostr_convert.rs:200-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25–26 lines × 2) crates/buzz-acp/src/acp.rs:1292— crates/buzz-acp/src/acp.rs:1292-1317 | crates/buzz-acp/src/acp.rs:1616-1640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–25 lines × 2) crates/buzz-relay/src/api/bridge.rs:1515— crates/buzz-relay/src/api/bridge.rs:1515-1539 | crates/buzz-relay/src/api/bridge.rs:2200-2223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23–25 lines × 2) REDACTED:826— REDACTED:826-850 | REDACTED:1133-1155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–24 lines × 2) crates/buzz-acp/src/config.rs:905— crates/buzz-acp/src/config.rs:905-928 | desktop/src-tauri/src/managed_agents/discovery.rs:335-355 — 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 (21–23 lines × 2) crates/buzz-admin/src/communities.rs:288— crates/buzz-admin/src/communities.rs:288-308 | crates/buzz-relay/src/handlers/community_provisioning.rs:123-145 — before extracting anything, compare `crates/buzz-admin/src/communities.rs` and `crates/buzz-relay/src/handlers/community_provisioning.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19–23 lines × 2) crates/buzz-relay/src/audio/handler.rs:1561— crates/buzz-relay/src/audio/handler.rs:1561-1579 | crates/buzz-relay/src/audio/handler.rs:1864-1886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–23 lines × 2) crates/buzz-relay/src/audio/room.rs:532— crates/buzz-relay/src/audio/room.rs:532-554 | crates/buzz-relay/src/audio/room.rs:592-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–22 lines × 2) crates/buzz-acp/src/pool.rs:3474— crates/buzz-acp/src/pool.rs:3474-3493 | crates/buzz-acp/src/pool.rs:3532-3553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–22 lines × 2) desktop/src-tauri/src/commands/agents.rs:97— desktop/src-tauri/src/commands/agents.rs:97-110 | desktop/src-tauri/src/commands/agents.rs:223-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 2) crates/buzz-db/src/store/moderation.rs:395— crates/buzz-db/src/store/moderation.rs:395-414 | crates/buzz-db/src/store/moderation.rs:435-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 4) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:145— desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:145-164 | desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:250-269 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:143-162 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:300-318 — before extracting anything, compare `desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs` and `desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–20 lines × 2) crates/buzz-audio-client/src/wire.rs:103— crates/buzz-audio-client/src/wire.rs:103-122 | crates/buzz-relay/src/audio/wire.rs:70-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–20 lines × 2) REDACTED:803— REDACTED:803-822 | REDACTED:1117-1131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) crates/buzz-media/src/upload.rs:92— crates/buzz-media/src/upload.rs:92-110 | crates/buzz-media/src/upload.rs:428-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 5) desktop/src-tauri/src/commands/agent_config.rs:263— desktop/src-tauri/src/commands/agent_config.rs:263-278 | desktop/src-tauri/src/commands/agent_models.rs:43-58 | desktop/src-tauri/src/commands/agents.rs:440-456 | desktop/src-tauri/src/commands/agents.rs:511-527 | desktop/src-tauri/src/commands/agents.rs:935-951 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (15–17 lines × 2) crates/buzz-agent/src/llm.rs:2007— crates/buzz-agent/src/llm.rs:2007-2023 | crates/buzz-agent/src/llm.rs:2445-2459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–16 lines × 3) crates/buzz-relay/src/audio/handler.rs:1563— crates/buzz-relay/src/audio/handler.rs:1563-1574 | crates/buzz-relay/src/audio/handler.rs:1866-1881 | crates/buzz-relay/src/audio/handler.rs:1894-1905 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–16 lines × 2) crates/buzz-acp/src/acp.rs:1447— crates/buzz-acp/src/acp.rs:1447-1462 | crates/buzz-acp/src/acp.rs:1572-1583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 6) crates/buzz-relay/src/audio/handler.rs:1561— crates/buzz-relay/src/audio/handler.rs:1561-1572 | crates/buzz-relay/src/audio/handler.rs:1864-1878 | crates/buzz-relay/src/audio/handler.rs:1892-1903 | crates/buzz-relay/src/audio/handler.rs:1927-1938 | crates/buzz-relay/src/audio/handler.rs:1956-1967 | crates/buzz-relay/src/audio/handler.rs:1985-1996 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–15 lines × 2) crates/buzz-relay/src/audio/handler.rs:250— crates/buzz-relay/src/audio/handler.rs:250-264 | crates/buzz-relay/src/connection.rs:382-392 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12–14 lines × 7) crates/buzz-db/src/store/event.rs:2366— crates/buzz-db/src/store/event.rs:2366-2379 | crates/buzz-db/src/store/event.rs:2425-2436 | crates/buzz-db/src/store/event.rs:2748-2759 | crates/buzz-db/src/store/feed.rs:381-392 | crates/buzz-db/src/store/feed.rs:472-483 | crates/buzz-db/src/store/feed.rs:553-564 | crates/buzz-db/src/store/relay_members.rs:1232-1243 — there are 7 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13–14 lines × 3) crates/buzz-cli/src/client.rs:800— crates/buzz-cli/src/client.rs:800-813 | crates/buzz-cli/src/client.rs:830-843 | crates/buzz-cli/src/client.rs:1145-1157 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–14 lines × 2) crates/buzz-cli/src/commands/mem.rs:100— crates/buzz-cli/src/commands/mem.rs:100-109 | crates/buzz-cli/src/commands/notes.rs:551-564 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–14 lines × 2) crates/buzz-relay/src/api/git/store.rs:271— crates/buzz-relay/src/api/git/store.rs:271-284 | crates/buzz-relay/src/api/git/store.rs:310-321 — both copies are in the same file, so extract the block into 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 × 4) desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:308— desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs:308-320 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:192-204 | desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs:344-356 | desktop/src-tauri/src/managed_agents/runtime/sweep.rs:395-407 — before extracting anything, compare `desktop/src-tauri/src/managed_agents/runtime/instance_reaper.rs` and `desktop/src-tauri/src/managed_agents/runtime/orphan_sweep.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–13 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:2307— crates/buzz-relay/src/handlers/side_effects.rs:2307-2319 | crates/buzz-relay/src/handlers/side_effects.rs:2893-2903 — both copies are in the same file, so extract the block into 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–12 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:491— crates/buzz-relay/src/handlers/command_executor.rs:491-502 | crates/buzz-relay/src/handlers/command_executor.rs:601-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 8) crates/buzz-db/src/store/event.rs:2365— crates/buzz-db/src/store/event.rs:2365-2375 | crates/buzz-db/src/store/event.rs:2424-2434 | crates/buzz-db/src/store/event.rs:2488-2498 | crates/buzz-db/src/store/event.rs:2747-2757 | crates/buzz-db/src/store/feed.rs:377-390 | crates/buzz-db/src/store/feed.rs:468-481 | crates/buzz-db/src/store/feed.rs:549-562 | crates/buzz-db/src/store/relay_members.rs:1231-1241 — there are 8 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 4) crates/buzz-acp/src/relay.rs:1800— crates/buzz-acp/src/relay.rs:1800-1820 | crates/buzz-acp/src/relay.rs:2059-2069 | crates/buzz-acp/src/relay.rs:2098-2108 | crates/buzz-acp/src/relay.rs:2131-2141 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–11 lines × 2) crates/buzz-relay/src/handlers/count.rs:85— crates/buzz-relay/src/handlers/count.rs:85-93 | crates/buzz-relay/src/handlers/req.rs:118-128 — before extracting anything, compare `crates/buzz-relay/src/handlers/count.rs` and `crates/buzz-relay/src/handlers/req.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–11 lines × 2) desktop/src-tauri/src/commands/media_transcode.rs:480— desktop/src-tauri/src/commands/media_transcode.rs:480-490 | desktop/src-tauri/src/commands/media_transcode.rs:510-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 4) crates/buzz-relay/src/api/bridge.rs:2313— crates/buzz-relay/src/api/bridge.rs:2313-2321 | crates/buzz-relay/src/api/bridge.rs:2385-2394 | crates/buzz-relay/src/handlers/count.rs:227-235 | crates/buzz-relay/src/handlers/count.rs:312-321 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9–10 lines × 3) crates/buzz-relay/src/audio/handler.rs:1441— crates/buzz-relay/src/audio/handler.rs:1441-1449 | crates/buzz-relay/src/audio/handler.rs:1454-1462 | crates/buzz-relay/src/audio/handler.rs:1470-1479 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 6) desktop/src-tauri/src/commands/agent_config.rs:262— desktop/src-tauri/src/commands/agent_config.rs:262-270 | desktop/src-tauri/src/commands/agent_models.rs:42-50 | desktop/src-tauri/src/commands/agent_models_update.rs:153-161 | desktop/src-tauri/src/commands/agents.rs:439-447 | desktop/src-tauri/src/commands/agents.rs:510-518 | desktop/src-tauri/src/commands/agents.rs:934-942 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 5) crates/buzz-relay/src/handlers/command_executor.rs:334— crates/buzz-relay/src/handlers/command_executor.rs:334-342 | crates/buzz-relay/src/handlers/command_executor.rs:496-504 | crates/buzz-relay/src/handlers/command_executor.rs:754-762 | crates/buzz-relay/src/handlers/command_executor.rs:1080-1088 | crates/buzz-relay/src/handlers/command_executor.rs:1191-1199 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 4) crates/buzz-cli/src/commands/notes.rs:174— crates/buzz-cli/src/commands/notes.rs:174-182 | crates/buzz-cli/src/commands/notes.rs:357-363 | crates/buzz-cli/src/commands/projects.rs:268-274 | crates/buzz-cli/src/commands/repos.rs:25-31 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (3–8 lines × 4) crates/buzz-acp/src/relay.rs:1853— crates/buzz-acp/src/relay.rs:1853-1856 | crates/buzz-acp/src/relay.rs:2456-2463 | crates/buzz-acp/src/relay.rs:2759-2765 | crates/buzz-acp/src/relay/recovery.rs:47-49 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7–8 lines × 2) crates/buzz-admin/src/main.rs:830— crates/buzz-admin/src/main.rs:830-837 | crates/buzz-relay/src/handlers/side_effects.rs:1388-1394 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5–6 lines × 2) crates/buzz-agent/src/llm.rs:2234— crates/buzz-agent/src/llm.rs:2234-2238 | crates/buzz-agent/src/llm.rs:2393-2398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–5 lines × 3) crates/buzz-db/src/store/api_token.rs:197— crates/buzz-db/src/store/api_token.rs:197-201 | crates/buzz-db/src/store/api_token.rs:259-261 | crates/buzz-db/src/store/api_token.rs:412-416 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 4) crates/buzz-db/src/store/push.rs:1102— crates/buzz-db/src/store/push.rs:1102-1116 | crates/buzz-db/src/store/push.rs:1135-1187 | crates/buzz-db/src/store/push.rs:1285-1299 | crates/buzz-db/src/store/push.rs:1344-1358 — 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 (15 lines × 3) crates/buzz-db/src/store/moderation.rs:363— crates/buzz-db/src/store/moderation.rs:363-383 | crates/buzz-db/src/store/moderation.rs:551-570 | crates/buzz-db/src/store/workflow.rs:874-888 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 5) crates/buzz-db/src/store/git_repo.rs:189— crates/buzz-db/src/store/git_repo.rs:189-202 | crates/buzz-db/src/store/moderation.rs:396-414 | crates/buzz-db/src/store/moderation.rs:436-455 | crates/buzz-db/src/store/moderation.rs:493-511 | crates/buzz-db/src/store/moderation.rs:583-600 — before extracting anything, compare `crates/buzz-db/src/store/git_repo.rs` and `crates/buzz-db/src/store/moderation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) crates/buzz-db/src/store/relay_admin_actions.rs:230— crates/buzz-db/src/store/relay_admin_actions.rs:230-248 | crates/buzz-db/src/store/relay_admin_actions.rs:1264-1282 | crates/buzz-db/src/store/relay_invite.rs:262-278 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12 lines × 5) crates/buzz-db/src/store/allowlist.rs:78— crates/buzz-db/src/store/allowlist.rs:78-89 | crates/buzz-db/src/store/push.rs:1290-1302 | crates/buzz-db/src/store/push.rs:1349-1361 | crates/buzz-db/src/store/reminder.rs:172-190 | crates/buzz-db/src/store/workflow.rs:604-621 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) desktop/src-tauri/src/archive/mod.rs:242— desktop/src-tauri/src/archive/mod.rs:242-252 | desktop/src-tauri/src/archive/mod.rs:256-266 | desktop/src-tauri/src/commands/channels/fetch.rs:352-358 | desktop/src-tauri/src/commands/profile.rs:362-372 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 20) crates/buzz-cli/src/commands/channels.rs:1703— crates/buzz-cli/src/commands/channels.rs:1703-1708 | crates/buzz-cli/src/commands/channels.rs:1719-1724 | crates/buzz-cli/src/commands/channels.rs:1735-1740 | crates/buzz-cli/src/commands/channels.rs:1747-1752 | crates/buzz-cli/src/commands/channels.rs:1759-1764 | crates/buzz-cli/src/commands/channels.rs:1771-1776 | crates/buzz-cli/src/commands/channels.rs:1783-1788 | crates/buzz-cli/src/commands/channels.rs:1795-1800 | crates/buzz-cli/src/commands/channels.rs:1826-1831 | crates/buzz-cli/src/commands/channels.rs:1843-1848 | crates/buzz-cli/src/commands/channels.rs:1928-1933 | crates/buzz-cli/src/commands/emoji.rs:149-153 | crates/buzz-cli/src/commands/messages.rs:806-812 | crates/buzz-cli/src/commands/messages.rs:837-843 | crates/buzz-cli/src/commands/messages.rs:860-866 | crates/buzz-cli/src/commands/messages.rs:891-897 | crates/buzz-cli/src/commands/reactions.rs:71-77 | crates/buzz-cli/src/commands/social.rs:34-40 | crates/buzz-cli/src/commands/social.rs:62-68 | crates/buzz-cli/src/commands/users.rs:420-426 — there are 20 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 20 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 5) crates/buzz-cli/src/commands/moderation.rs:45— crates/buzz-cli/src/commands/moderation.rs:45-49 | crates/buzz-cli/src/commands/moderation.rs:55-59 | crates/buzz-cli/src/commands/moderation.rs:73-77 | crates/buzz-cli/src/commands/moderation.rs:83-87 | crates/buzz-cli/src/commands/moderation.rs:99-103 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–27 lines × 2) docs/formal/nip-rs-unread/model.py:299— docs/formal/nip-rs-unread/model.py:299-325 | docs/formal/nip-rs-unread/mutation.py:429-442 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17–22 lines × 2) mobile/ios/Runner/AppDelegate.swift:985— mobile/ios/Runner/AppDelegate.swift:985-1006 | mobile/ios/Runner/VoiceNotePackager.swift:249-265 — 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 `mobile/ios/Runner/AppDelegate.swift:985` 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 (63 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:247— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:247-309 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:217-279 — before extracting anything, compare `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (39 lines × 2) mobile/lib/features/profile/avatar_editor_option_button.dart:101— mobile/lib/features/profile/avatar_editor_option_button.dart:101-139 | mobile/lib/shared/widgets/editor_option_button.dart:83-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (27 lines × 4) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:60— mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:60-86 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:60-86 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:67-93 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:60-86 — `mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_provider.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21–27 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:139— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:139-159 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:159-185 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:139-159 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23–24 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:319— mobile/lib/features/channels/channel_detail_page/message_bubble.dart:319-341 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:289-312 — before extracting anything, compare `mobile/lib/features/channels/channel_detail_page/message_bubble.dart` and `mobile/lib/features/channels/thread_detail_page/thread_message.dart` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:358— mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:358-378 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:483-503 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:358-378 — `mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart` and `mobile/lib/features/channels/channel_sections/channel_sections_manager.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (20 lines × 3) mobile/lib/features/forum/forum_post_card.dart:257— mobile/lib/features/forum/forum_post_card.dart:257-276 | mobile/lib/features/forum/forum_thread_page.dart:134-153 | mobile/lib/features/forum/forum_thread_page.dart:595-614 — before extracting anything, compare `mobile/lib/features/forum/forum_post_card.dart` and `mobile/lib/features/forum/forum_thread_page.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–14 lines × 2) mobile/lib/features/activity/activity_page/inbox_row.dart:314— mobile/lib/features/activity/activity_page/inbox_row.dart:314-327 | mobile/lib/features/search/search_page/message_tile.dart:99-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Low cohesion: AppState (LCOM4 4) desktop/src-tauri/src/app_state.rs:19— AppState'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.
Duplication concentrated across 28 sibling directories (284 clone groups) desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49— 284 duplicated blocks under desktop/src/features/ have copies in at least two of the sibling directories admin-console, agents, channel-templates, channels, communities, community-members (+22 more sibling(s) not listed) — 141 of them are reported below, and 143 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 284 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 284 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 284 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 5 sibling directories (111 clone groups) desktop/src/features/messages/ui/MessageReactions.tsx:371— 111 duplicated blocks under desktop/src/ have copies in at least two of the sibling directories app, features, protectedFeatures, shared, testing — 55 of them are reported below, and 56 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 111 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 111 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 111 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 3 sibling directories (20 clone groups) desktop/src/shared/ui/card.tsx:133— 20 duplicated blocks under the repository root have copies in at least two of the sibling directories desktop, mobile, web — 13 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 20 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 20 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 20 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 3 sibling directories (7 clone groups) desktop/src/features/huddle/hooks/useHuddleParticipantRoster.ts:42— 7 duplicated blocks under desktop/src/features/huddle/ have copies in at least two of the sibling directories components, hooks, lib — 4 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 2 sibling directories (6 clone groups) desktop/src/features/messages/lib/useThreadFollows.ts:16— 6 duplicated blocks under desktop/src/features/messages/ have copies in at least two of the sibling directories lib, ui — 2 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (191 matched lines × 2 locations) · ×1
Duplicated block with local edits (191 matched lines × 2 locations) desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49— desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49 · desktop/src/features/settings/ui/EncryptedBackupCreator.tsx:19 — the two spans are one implementation copied and then locally edited — 1024 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 (189 lines × 2 locations) desktop/src/features/sidebar/lib/useChannelMutes.ts:19— desktop/src/features/sidebar/lib/useChannelMutes.ts:19 · desktop/src/features/sidebar/lib/useChannelStars.ts:19 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (166 matched lines × 2 locations) · ×1
Duplicated block with local edits (166 matched lines × 2 locations) desktop/src/shared/ui/context-menu.tsx:13— desktop/src/shared/ui/context-menu.tsx:13 · desktop/src/shared/ui/dropdown-menu.tsx:13 — the two spans are one implementation copied and then locally edited — 902 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 (161 lines × 2 locations) desktop/src/features/projects/ui/ProjectsIssuesList.tsx:196— desktop/src/features/projects/ui/ProjectsIssuesList.tsx:196 · desktop/src/features/projects/ui/ProjectsPullRequestsList.tsx:203 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (152 matched lines × 2 locations) · ×1
Duplicated block with local edits (152 matched lines × 2 locations) desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:120— desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx:120 · desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx:233 — the two spans are one implementation copied and then locally edited — 666 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (152 identical lines × 2 files) desktop/src/features/sidebar/lib/channelMutesSync.ts:1— desktop/src/features/sidebar/lib/channelMutesSync.ts:1 · desktop/src/features/sidebar/lib/channelStarsSync.ts:1 — these 2 files are line-for-line copies of one another — 152 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (143 matched lines × 2 locations) · ×1
Duplicated block with local edits (143 matched lines × 2 locations) desktop/src/features/agents/ui/AgentSnapshotImportDialog.tsx:24— desktop/src/features/agents/ui/AgentSnapshotImportDialog.tsx:24 · desktop/src/features/agents/ui/TeamSnapshotImportDialog.tsx:22 — the two spans are one implementation copied and then locally edited — 629 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (129 matched lines × 2 locations) · ×1
Duplicated block with local edits (129 matched lines × 2 locations) desktop/src/features/projects/ui/IssueAssigneesRow.tsx:31— desktop/src/features/projects/ui/IssueAssigneesRow.tsx:31 · desktop/src/features/projects/ui/PullRequestReviewersRow.tsx:38 — the two spans are one implementation copied and then locally edited — 652 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 (128 matched lines × 2 locations) · ×1
Duplicated block with local edits (128 matched lines × 2 locations) desktop/src/shared/theme/ThemePreviewFrame.tsx:63— desktop/src/shared/theme/ThemePreviewFrame.tsx:63 · desktop/src/shared/theme/ThemePreviewFrame.tsx:267 — the two spans are one implementation copied and then locally edited — 565 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (123 matched lines × 2 locations) · ×1
Duplicated block with local edits (123 matched lines × 2 locations) desktop/src/features/channels/ui/MembersSidebar.tsx:268— desktop/src/features/channels/ui/MembersSidebar.tsx:268 · desktop/src/features/messages/ui/useNewMessageRecipients.ts:102 — the two spans are one implementation copied and then locally edited — 598 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 (121 lines × 2 locations) desktop/src/features/sidebar/lib/channelMutesStorage.ts:2— desktop/src/features/sidebar/lib/channelMutesStorage.ts:2 · desktop/src/features/sidebar/lib/channelStarsStorage.ts:2 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (118 matched lines × 2 locations) · ×1
Duplicated block with local edits (118 matched lines × 2 locations) desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:52— desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:52 · desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:92 — the two spans are one implementation copied and then locally edited — 607 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 (117 matched lines × 2 locations) · ×1
Duplicated block with local edits (117 matched lines × 2 locations) desktop/src/features/agents/ui/usePersonaActions.ts:70— desktop/src/features/agents/ui/usePersonaActions.ts:70 · desktop/src/features/agents/ui/useTeamActions.ts:66 — the two spans are one implementation copied and then locally edited — 647 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 (115 matched lines × 2 locations) · ×1
Duplicated block with local edits (115 matched lines × 2 locations) desktop/src/features/agents/ui/AgentsView.tsx:325— desktop/src/features/agents/ui/AgentsView.tsx:325 · desktop/src/features/agents/ui/AgentsView.tsx:551 — the two spans are one implementation copied and then locally edited — 539 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (112 matched lines × 2 locations) · ×1
Duplicated block with local edits (112 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116— desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:116 · desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:134 — the two spans are one implementation copied and then locally edited — 533 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 (107 matched lines × 2 locations) · ×1
Duplicated block with local edits (107 matched lines × 2 locations) desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33— desktop/src/features/onboarding/ui/BackupTestFlow.tsx:33 · desktop/src/features/settings/ui/BackupTestFlow.tsx:14 — the two spans are one implementation copied and then locally edited — 699 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (102 matched lines × 2 locations) · ×1
Duplicated block with local edits (102 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:148— desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:148 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:200 — the two spans are one implementation copied and then locally edited — 503 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 (99 matched lines × 2 locations) · ×1
Duplicated block with local edits (99 matched lines × 2 locations) desktop/src/features/messages/lib/useChannelLinks.ts:92— desktop/src/features/messages/lib/useChannelLinks.ts:92 · desktop/src/features/messages/lib/useEmojiAutocomplete.ts:151 — the two spans are one implementation copied and then locally edited — 521 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (94 identical lines × 2 files) desktop/src/features/onboarding/lib/encryptedBackup.ts:2— desktop/src/features/onboarding/lib/encryptedBackup.ts:2 · desktop/src/features/settings/lib/encryptedBackup.ts:2 — these 2 files are line-for-line copies of one another — 94 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (88 matched lines × 2 locations) · ×1
Duplicated block with local edits (88 matched lines × 2 locations) desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58— desktop/src/features/admin-console/AdminConsoleCommunities.tsx:58 · desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:224 — the two spans are one implementation copied and then locally edited — 432 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 (83 matched lines × 2 locations) · ×1
Duplicated block with local edits (83 matched lines × 2 locations) desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631— desktop/src/features/onboarding/ui/BackupTestFlow.tsx:631 · desktop/src/features/settings/ui/BackupTestFlow.tsx:341 — the two spans are one implementation copied and then locally edited — 358 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (79 matched lines × 2 locations) · ×1
Duplicated block with local edits (79 matched lines × 2 locations) desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13— desktop/src/features/projects/ui/CreateProjectIssueDialog.tsx:13 · desktop/src/features/projects/ui/CreatePullRequestDialog.tsx:23 — the two spans are one implementation copied and then locally edited — 425 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 (78 matched lines × 2 locations) · ×1
Duplicated block with local edits (78 matched lines × 2 locations) desktop/src/features/messages/ui/MessageRow.tsx:755— desktop/src/features/messages/ui/MessageRow.tsx:755 · desktop/src/features/messages/ui/MessageThreadSummaryRow.tsx:150 — the two spans are one implementation copied and then locally edited — 297 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 (77 matched lines × 2 locations) · ×1
Duplicated block with local edits (77 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48— desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:48 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:90 — the two spans are one implementation copied and then locally edited — 525 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 (69 matched lines × 2 locations) · ×1
Duplicated block with local edits (69 matched lines × 2 locations) desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201— desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1201 · desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1368 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (66 matched lines × 2 locations) · ×1
Duplicated block with local edits (66 matched lines × 2 locations) desktop/src/features/channels/channelSnapshot.ts:46— desktop/src/features/channels/channelSnapshot.ts:46 · desktop/src/features/projects/projectSnapshot.ts:113 — the two spans are one implementation copied and then locally edited — 393 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 (59 matched lines × 2 locations) · ×1
Duplicated block with local edits (59 matched lines × 2 locations) desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126— desktop/src/features/agents/ui/AgentSessionToolItem/SentMessageContextDialog.tsx:126 · desktop/src/features/agents/ui/PromptSectionAccordion.tsx:17 — the two spans are one implementation copied and then locally edited — 249 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 (58 matched lines × 2 locations) · ×1
Duplicated block with local edits (58 matched lines × 2 locations) desktop/src/features/agents/useAgentManagement.ts:42— desktop/src/features/agents/useAgentManagement.ts:42 · desktop/src/features/projects/useProjectChannelRequests.ts:25 — the two spans are one implementation copied and then locally edited — 328 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Complex function (anonymous) (cyclomatic 658, cognitive 556) desktop/src/testing/e2eBridge.ts:12040— (anonymous) has cyclomatic complexity 658 and cognitive complexity 556; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 AgentConfigFields (cyclomatic 122, cognitive 112) desktop/src/features/agents/ui/AgentConfigFields.tsx:212— AgentConfigFields has cyclomatic complexity 122 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 sendToMockSocket (cyclomatic 118, cognitive 237) desktop/src/testing/e2eBridge.ts:10909— sendToMockSocket has cyclomatic complexity 118 and cognitive complexity 237; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 UserProfilePanel (cyclomatic 112, cognitive 90) desktop/src/features/profile/ui/UserProfilePanel.tsx:105— UserProfilePanel has cyclomatic complexity 112 and cognitive complexity 90; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ChannelPane (cyclomatic 108, cognitive 92) desktop/src/features/channels/ui/ChannelPane.tsx:78— ChannelPane has cyclomatic complexity 108 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 AnimatedAvatarCapture (cyclomatic 98, cognitive 91) desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:71— AnimatedAvatarCapture has cyclomatic complexity 98 and cognitive complexity 91; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 processTranscriptEvent (cyclomatic 97, cognitive 166) desktop/src/features/agents/ui/agentSessionTranscript.ts:700— processTranscriptEvent has cyclomatic complexity 97 and cognitive complexity 166; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ProjectDetailScreen (cyclomatic 95, cognitive 81) desktop/src/features/projects/ui/ProjectDetailScreen.tsx:87— ProjectDetailScreen has cyclomatic complexity 95 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 91, cognitive 49) desktop/tests/e2e/projects-v3-screenshots.spec.ts:280— (anonymous) has cyclomatic complexity 91 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 AgentCreationPreview (cyclomatic 87, cognitive 92) desktop/src/features/agents/ui/AgentCreationPreview.tsx:47— AgentCreationPreview has cyclomatic complexity 87 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ProfileAvatarEditor (cyclomatic 85, cognitive 76) desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:67— ProfileAvatarEditor has cyclomatic complexity 85 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 MessageTimeline (cyclomatic 81, cognitive 71) desktop/src/features/messages/ui/MessageTimeline.tsx:162— MessageTimeline has cyclomatic complexity 81 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ProfileSummaryView (cyclomatic 70, cognitive 55) desktop/src/features/profile/ui/UserProfilePanelSections.tsx:136— ProfileSummaryView has cyclomatic complexity 70 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function AgentDefinitionDialog (cyclomatic 69, cognitive 62) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:128— AgentDefinitionDialog has cyclomatic complexity 69 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function NostrKeyImportForm (cyclomatic 68, cognitive 64) desktop/src/features/onboarding/ui/NostrKeyImportForm.tsx:60— NostrKeyImportForm has cyclomatic complexity 68 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 ProjectRepositoryActionsPanel (cyclomatic 68, cognitive 59) desktop/src/features/projects/ui/ProjectRepositoryActionsPanel.tsx:139— ProjectRepositoryActionsPanel has cyclomatic complexity 68 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function UserProfilePopoverBody (cyclomatic 68, cognitive 55) desktop/src/features/profile/ui/UserProfilePopover.tsx:257— UserProfilePopoverBody has cyclomatic complexity 68 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function MessageRow (cyclomatic 67, cognitive 63) desktop/src/features/messages/ui/MessageRow.tsx:72— MessageRow has cyclomatic complexity 67 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function apply (cyclomatic 64, cognitive 86) desktop/src/features/huddle/lib/huddlePresence.ts:260— apply has cyclomatic complexity 64 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 InboxMessageDetailPane (cyclomatic 61, cognitive 58) desktop/src/features/home/ui/InboxDetailPane.tsx:166— InboxMessageDetailPane has cyclomatic complexity 61 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· desktop/src/testing/e2eBridge.ts · ×1
desktop/src/testing/e2eBridge.ts: 14703 lines of code desktop/src/testing/e2eBridge.ts:1— desktop/src/testing/e2eBridge.ts has 14703 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· desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs · ×1
desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs: 2667 lines of code desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs:1— desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs has 2667 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· desktop/src/shared/ui/VideoPlayer.tsx · ×1
desktop/src/shared/ui/VideoPlayer.tsx: 2094 lines of code desktop/src/shared/ui/VideoPlayer.tsx:1— desktop/src/shared/ui/VideoPlayer.tsx has 2094 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· desktop/src/shared/ui/markdown.tsx · ×1
desktop/src/shared/ui/markdown.tsx: 1751 lines of code desktop/src/shared/ui/markdown.tsx:1— desktop/src/shared/ui/markdown.tsx has 1751 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· desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs · ×1
desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs: 1561 lines of code desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs:1— desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs has 1561 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· desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs · ×1
desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs: 1434 lines of code desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs:1— desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs has 1434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx · ×1
desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx: 1164 lines of code desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:1— desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx has 1164 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· desktop/src/features/onboarding/ui/SetupStep.tsx · ×1
desktop/src/features/onboarding/ui/SetupStep.tsx: 1127 lines of code desktop/src/features/onboarding/ui/SetupStep.tsx:1— desktop/src/features/onboarding/ui/SetupStep.tsx has 1127 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· desktop/src/features/agents/ui/agentSessionTranscript.ts · ×1
desktop/src/features/agents/ui/agentSessionTranscript.ts: 1126 lines of code desktop/src/features/agents/ui/agentSessionTranscript.ts:1— desktop/src/features/agents/ui/agentSessionTranscript.ts has 1126 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· desktop/src/shared/api/relayClientSession.ts · ×1
desktop/src/shared/api/relayClientSession.ts: 1097 lines of code desktop/src/shared/api/relayClientSession.ts:1— desktop/src/shared/api/relayClientSession.ts has 1097 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· desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs · ×1
desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs: 1035 lines of code desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs:1— desktop/src/features/admin-console/adminConsolePanelActions.jsdom-test.mjs has 1035 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· desktop/src/features/profile/ui/ProfileAvatarEditor.tsx · ×1
desktop/src/features/profile/ui/ProfileAvatarEditor.tsx: 1021 lines of code desktop/src/features/profile/ui/ProfileAvatarEditor.tsx:1— desktop/src/features/profile/ui/ProfileAvatarEditor.tsx has 1021 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· desktop/src/features/messages/ui/MessageComposer.tsx · ×1
desktop/src/features/messages/ui/MessageComposer.tsx: 1012 lines of code desktop/src/features/messages/ui/MessageComposer.tsx:1— desktop/src/features/messages/ui/MessageComposer.tsx has 1012 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· desktop/src/features/agents/ui/AgentDefinitionDialog.tsx · ×1
desktop/src/features/agents/ui/AgentDefinitionDialog.tsx: 1008 lines of code desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:1— desktop/src/features/agents/ui/AgentDefinitionDialog.tsx has 1008 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· desktop/src/features/agents/ui/AgentCreationPreview.tsx · ×1
desktop/src/features/agents/ui/AgentCreationPreview.tsx: 1002 lines of code desktop/src/features/agents/ui/AgentCreationPreview.tsx:1— desktop/src/features/agents/ui/AgentCreationPreview.tsx has 1002 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· desktop/src/features/agents/ui/AgentConfigFields.tsx · ×1
desktop/src/features/agents/ui/AgentConfigFields.tsx: 999 lines of code desktop/src/features/agents/ui/AgentConfigFields.tsx:1— desktop/src/features/agents/ui/AgentConfigFields.tsx has 999 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· desktop/src/features/channels/ui/ChannelScreen.tsx · ×1
desktop/src/features/channels/ui/ChannelScreen.tsx: 995 lines of code desktop/src/features/channels/ui/ChannelScreen.tsx:1— desktop/src/features/channels/ui/ChannelScreen.tsx has 995 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· desktop/src/features/channels/ui/ChannelPane.tsx · ×1
desktop/src/features/channels/ui/ChannelPane.tsx: 994 lines of code desktop/src/features/channels/ui/ChannelPane.tsx:1— desktop/src/features/channels/ui/ChannelPane.tsx has 994 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· desktop/src/features/messages/ui/useMentionSendFlow.ts · ×1
desktop/src/features/messages/ui/useMentionSendFlow.ts: 992 lines of code desktop/src/features/messages/ui/useMentionSendFlow.ts:1— desktop/src/features/messages/ui/useMentionSendFlow.ts has 992 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· desktop/src/features/projects/ui/ProjectDetailScreen.tsx · ×1
desktop/src/features/projects/ui/ProjectDetailScreen.tsx: 988 lines of code desktop/src/features/projects/ui/ProjectDetailScreen.tsx:1— desktop/src/features/projects/ui/ProjectDetailScreen.tsx has 988 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· desktop/src/app/AppShell.tsx · ×1
desktop/src/app/AppShell.tsx: 987 lines of code desktop/src/app/AppShell.tsx:1— desktop/src/app/AppShell.tsx has 987 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· desktop/src/features/messages/ui/MessageRow.tsx · ×1
desktop/src/features/messages/ui/MessageRow.tsx: 981 lines of code desktop/src/features/messages/ui/MessageRow.tsx:1— desktop/src/features/messages/ui/MessageRow.tsx has 981 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· desktop/src/features/home/ui/HomeView.tsx · ×1
desktop/src/features/home/ui/HomeView.tsx: 980 lines of code desktop/src/features/home/ui/HomeView.tsx:1— desktop/src/features/home/ui/HomeView.tsx has 980 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
admin-web/src/App.tsx: 972 lines of code admin-web/src/App.tsx:1— admin-web/src/App.tsx has 972 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· desktop/src/shared/api/tauri.ts · ×1
desktop/src/shared/api/tauri.ts: 966 lines of code desktop/src/shared/api/tauri.ts:1— desktop/src/shared/api/tauri.ts has 966 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· desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx · ×1
desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx: 965 lines of code desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:1— desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx has 965 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· desktop/src/features/profile/ui/UserProfilePanel.tsx · ×1
desktop/src/features/profile/ui/UserProfilePanel.tsx: 960 lines of code desktop/src/features/profile/ui/UserProfilePanel.tsx:1— desktop/src/features/profile/ui/UserProfilePanel.tsx has 960 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· desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx · ×1
desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx: 954 lines of code desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx:1— desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx has 954 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· desktop/src/features/messages/lib/useMentions.ts · ×1
desktop/src/features/messages/lib/useMentions.ts: 953 lines of code desktop/src/features/messages/lib/useMentions.ts:1— desktop/src/features/messages/lib/useMentions.ts has 953 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· desktop/src/features/channels/ui/ChannelManagementSheet.tsx · ×1
desktop/src/features/channels/ui/ChannelManagementSheet.tsx: 952 lines of code desktop/src/features/channels/ui/ChannelManagementSheet.tsx:1— desktop/src/features/channels/ui/ChannelManagementSheet.tsx has 952 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· desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx · ×1
desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx: 951 lines of code desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx:1— desktop/src/features/profile/ui/AnimatedAvatarCapture.tsx has 951 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· desktop/src/features/projects/ui/ProjectsView.tsx · ×1
desktop/src/features/projects/ui/ProjectsView.tsx: 948 lines of code desktop/src/features/projects/ui/ProjectsView.tsx:1— desktop/src/features/projects/ui/ProjectsView.tsx has 948 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· desktop/src/features/admin-console/AdminConsoleReportsTab.tsx · ×1
desktop/src/features/admin-console/AdminConsoleReportsTab.tsx: 945 lines of code desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:1— desktop/src/features/admin-console/AdminConsoleReportsTab.tsx has 945 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· desktop/src/shared/ui/sidebar.tsx · ×1
desktop/src/shared/ui/sidebar.tsx: 940 lines of code desktop/src/shared/ui/sidebar.tsx:1— desktop/src/shared/ui/sidebar.tsx has 940 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· desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx · ×1
desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx: 933 lines of code desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:1— desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx has 933 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· desktop/src/features/channels/useUnreadChannels.ts · ×1
desktop/src/features/channels/useUnreadChannels.ts: 931 lines of code desktop/src/features/channels/useUnreadChannels.ts:1— desktop/src/features/channels/useUnreadChannels.ts has 931 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· desktop/src/features/search/ui/TopbarSearch.tsx · ×1
desktop/src/features/search/ui/TopbarSearch.tsx: 929 lines of code desktop/src/features/search/ui/TopbarSearch.tsx:1— desktop/src/features/search/ui/TopbarSearch.tsx has 929 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· desktop/src/features/messages/ui/SystemMessageRow.tsx · ×1
desktop/src/features/messages/ui/SystemMessageRow.tsx: 923 lines of code desktop/src/features/messages/ui/SystemMessageRow.tsx:1— desktop/src/features/messages/ui/SystemMessageRow.tsx has 923 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· desktop/src/features/sidebar/ui/AppSidebar.tsx · ×1
desktop/src/features/sidebar/ui/AppSidebar.tsx: 922 lines of code desktop/src/features/sidebar/ui/AppSidebar.tsx:1— desktop/src/features/sidebar/ui/AppSidebar.tsx has 922 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· desktop/src/features/messages/ui/useAnchoredScroll.ts · ×1
desktop/src/features/messages/ui/useAnchoredScroll.ts: 920 lines of code desktop/src/features/messages/ui/useAnchoredScroll.ts:1— desktop/src/features/messages/ui/useAnchoredScroll.ts has 920 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~429 LoC) desktop/src/features/agents/ui/ManagedAgentRow.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (desktop/src/features/agents/ui/AgentGroupRows.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~380 LoC) desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~320 LoC) desktop/src/features/agents/ui/ModelPicker.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~289 LoC) desktop/src/features/community-members/ui/CommunityMembersCard.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~272 LoC) desktop/src/features/home/ui/FeedSection.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~211 LoC) desktop/src/features/profile/ui/AvatarUpload.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~106 LoC) desktop/src/features/messages/useLoadMissingAncestors.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~92 LoC) desktop/src/features/community-members/ui/ConfirmRemoveDialog.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (desktop/src/features/community-members/ui/CommunityMembersCard.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~84 LoC) mobile/scripts/generate-emoji-data.mjs— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~83 LoC) web/src/shared/ui/card.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~78 LoC) desktop/src/features/channels/ui/MembersSidebarAgentControls.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~75 LoC) desktop/src/features/agents/lib/pickBotName.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~74 LoC) desktop/src/features/agents/ui/useWindowFileDragOver.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~71 LoC) desktop/src/features/channels/ui/useQuickBotDrop.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~66 LoC) desktop/src/features/channels/ui/useReusableAgentDetection.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~64 LoC) desktop/src/features/channels/ui/AddChannelBotGenericSection.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~60 LoC) desktop/src/shared/hooks/useFileImportZone.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~58 LoC) desktop/src/features/moderation/ui/TimeoutDurationSubmenu.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~57 LoC) desktop/src/features/agents/ui/AgentGroupRows.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~52 LoC) desktop/src/features/projects/ui/ProjectsListScopeDropdown.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~51 LoC) desktop/src/features/channels/ui/useEffectiveRuntimes.ts— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~37 LoC) desktop/src/features/projects/ui/ProjectsOverviewChatToggle.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~33 LoC) desktop/src/features/agents/ui/CreateNewButton.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~32 LoC) web/src/shared/theme/ThemeToggle.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~29 LoC) desktop/src/shared/ui/import-status-icon.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~28 LoC) desktop/src/shared/ui/TopChromeBackdrop.tsx— no import path from any entry point (80 application, 32 tooling, 943 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~5 LoC) desktop/src/features/projects/lib/projectLabels.ts— no import path from any entry point (80 application, 32 tooling, 943 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 'qrcode.react' — Declared in desktop/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.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:93— `warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:113— `warn!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:121— `warn!` at line 121 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:130— `warn!` at line 130 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:137— `warn!` at line 137 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:144— `warn!` at line 144 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/custom_harnesses.rs:480— `warn!` at line 480 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging desktop/src-tauri/src/managed_agents/discovery.rs:1156— `warn!` at line 1156 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-ws-client/src/connection.rs:86— `debug!` at line 86 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-ws-client/src/connection.rs:152— `debug!` at line 152 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:619— `info!` at line 619 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:656— `warn!` at line 656 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:668— `info!` at line 668 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:701— `info!` at line 701 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:731— `info!` at line 731 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:758— `info!` at line 758 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:856— `debug!` at line 856 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:1133— `warn!` at line 1133 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/executor.rs:1208— `warn!` at line 1208 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:253— `error!` at line 253 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:272— `error!` at line 272 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:280— `error!` at line 280 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:299— `error!` at line 299 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:366— `error!` at line 366 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/buzz-workflow/src/lib.rs:375— `warn!` at line 375 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Silent fallback default in catch mobile/lib/features/activity/compose_drafts_provider.dart:127— `build` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch mobile/lib/features/activity/reminders_provider.dart:168— `_fetch` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch mobile/lib/features/channels/recent_emoji_provider.dart:134— `build` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch mobile/lib/features/channels/thread_follows/thread_follows_storage.dart:61— `read` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch mobile/lib/shared/community/community.dart:175— `nameFromUrl` turns every thrown error into `'Community'` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch mobile/lib/shared/community/community_icon_cache.dart:40— `build` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch mobile/lib/shared/custom_emoji/custom_emoji_provider.dart:38— `_fetch` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch mobile/lib/shared/security/sensitive_action_authorizer.dart:36— `enrolledBiometrics` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. 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 at the `catch` or in the `///` doc, and the row stops firing.
Silent fallback default in catch desktop/src/app/huddleBackingChannelStorage.ts:10— `readStoredIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/agents/lib/useBotRecents.ts:70— `useBotRecents` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/communities/communityStorage.ts:97— `loadCommunities` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/communities/communityStorage.ts:207— `deriveCommunityName` swallows every exception into `return "Community"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/communities/communityNavigationStorage.ts:44— `loadCommunityDestinations` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/channels/readState/readStateIdentity.ts:48— `loadExtraSlotIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/channels/threadActivityStorage.ts:73— `readActivityFromStorage` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/communities/communityRelaySet.ts:21— `communityRelaySetKey` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/home/useFeedItemState.ts:26— `readStoredIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx:63— `readDraft` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/messages/lib/formatTimelineMessages.ts:562— `extractSystemMessagePubkeys` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/messages/lib/useThreadFollows.ts:32— `readFromStorage` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/messages/ui/useQuickReactionEmojis.ts:92— `readQuickReactionEntries` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/notifications/lib/desktop.ts:182— `getDesktopNotificationPermissionState` swallows every exception into `return "default"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/notifications/use-feed-desktop-notifications.ts:55— `readStoredSeenFeedIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/projects/projectFetch.ts:26— `readHiddenProjectCards` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch desktop/src/features/projects/lib/projectsViewHelpers.ts:98— `readStoredFilter` swallows every exception into `return "all"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Duplicated predicate mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:85— `!_remoteEnabled || _relaySession == null` appears character-identically in 4 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart, mobile/lib/shared/read_state/read_state_manager.dart. 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 mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:53— `!context.mounted || pending == null || pending == isScrolledUnder.value` appears character-identically in 2 files — mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart, mobile/lib/shared/widgets/frosted_scaffold.dart. 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 mobile/lib/features/channels/add_members_sheet.dart:29— `!kIsWeb && defaultTargetPlatform == TargetPlatform.iOS` appears character-identically in 6 files — mobile/lib/features/channels/add_members_sheet.dart, mobile/lib/features/channels/message_content/media_carousel.dart, mobile/lib/features/profile/settings_profile_header.dart, mobile/lib/shared/success_haptic.dart. 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 mobile/lib/features/profile/user_status_cache_provider.dart:52— `!state.containsKey(pk) && !_pending.contains(pk)` appears character-identically in 2 files — mobile/lib/features/profile/user_status_cache_provider.dart, mobile/lib/shared/profile/user_cache_provider.dart. 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 mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:341— `(!allowDisposed && _disposed) || !_remoteEnabled || _signedEventRelay == null || !_servesThisCommunity` appears character-identically in 3 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. 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 mobile/lib/shared/identity_transfer/native_community_entry.dart:88— `AccountIdentityFailure.occupied || AccountIdentityFailure.mismatch` appears character-identically in 2 files — mobile/lib/shared/identity_transfer/native_community_entry.dart, mobile/lib/shared/identity_transfer/nsec_import_sheet.dart. 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 mobile/lib/features/channels/channel_details_page.dart:269— `Navigator.canPop(context) && Theme.of(context).platform == TargetPlatform.iOS` appears character-identically in 2 files — mobile/lib/features/channels/channel_details_page.dart, mobile/lib/features/channels/thread_detail_page/app_bar.dart. 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 mobile/lib/features/channels/compose_bar/attachments.dart:481— `_AttachmentSurface.camera || _AttachmentSurface.photos` appears character-identically in 2 files — mobile/lib/features/channels/compose_bar/attachments.dart, mobile/lib/features/channels/compose_bar/compose_bar_widget.dart. 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 mobile/lib/features/pairing/pairing_socket.dart:162— `_authCompleter != null && !_authCompleter!.isCompleted` appears character-identically in 2 files — mobile/lib/features/pairing/pairing_socket.dart, mobile/lib/shared/relay/relay_socket.dart. 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 mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:98— `_disposed || !_remoteEnabled || _relaySession == null` appears character-identically in 3 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sort/channel_sort_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. 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 mobile/lib/features/channels/agent_activity/observer_subscription.dart:112— `_disposed || epoch != _subscriptionEpoch` appears character-identically in 2 files — mobile/lib/features/channels/agent_activity/observer_subscription.dart, mobile/lib/shared/theme/community_theme_sync.dart. 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 mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:354— `_isIdenticalToLastPublished() || !_servesThisCommunity` appears character-identically in 3 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. 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 mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:129— `_liveSettled || await _startLiveSubscription()` appears character-identically in 2 files — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart, mobile/lib/features/channels/channel_stars/channel_stars_manager.dart. 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 mobile/lib/features/pairing/pairing_socket.dart:235— `_pendingAuthEventId != null && eventId == _pendingAuthEventId` appears character-identically in 2 files — mobile/lib/features/pairing/pairing_socket.dart, mobile/lib/shared/relay/relay_socket.dart. 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 mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:146— `_unsubscribe != null || await _startLiveSubscription()` appears character-identically in 2 files — mobile/lib/features/channels/channel_sections/channel_sections_manager.dart, mobile/lib/features/channels/channel_sort/channel_sort_manager.dart. 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 mobile/lib/shared/theme/accent_colors.dart:91— `accentIndex < 0 || accentIndex >= accentColors.length` appears character-identically in 2 files — mobile/lib/shared/theme/accent_colors.dart, mobile/lib/shared/theme/color_scheme.dart. 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 mobile/lib/features/channels/channel_detail_page/message_list.dart:309— `activeDayTimestamp == null || activeDayStartIndex == null` appears character-identically in 2 files — mobile/lib/features/channels/channel_detail_page/message_list.dart, mobile/lib/features/channels/thread_detail_page/sticky_date.dart. 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 mobile/lib/features/profile/settings_profile_header.dart:80— `animatedAvatar != null && stoppedAnimationUrl.value != animatedAvatar.animationUrl` appears character-identically in 2 files — mobile/lib/features/profile/settings_profile_header.dart, mobile/lib/features/profile/user_profile_sheet.dart. 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 mobile/lib/features/activity/activity_page/header_actions.dart:113— `buttonContext.mounted && selected != null` appears character-identically in 2 files — mobile/lib/features/activity/activity_page/header_actions.dart, mobile/lib/features/profile/settings_profile_header.dart. 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 mobile/lib/shared/widgets/ios_native_segmented_control.dart:47— `call.method == 'changed' && call.arguments is int` appears character-identically in 2 files — mobile/lib/shared/widgets/ios_native_segmented_control.dart, mobile/lib/shared/widgets/ios_native_skin_tone_control.dart. 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 mobile/lib/shared/profile/user_cache_provider.dart:181— `completer != null && !completer.isCompleted` appears character-identically in 2 files — mobile/lib/shared/profile/user_cache_provider.dart, mobile/lib/shared/relay/relay_rate_limit_gate.dart. 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 mobile/lib/features/channels/channel_management_provider.dart:332— `current == null || event.createdAt > current.createdAt` appears character-identically in 4 files — mobile/lib/features/channels/channel_management_provider.dart, mobile/lib/features/channels/channel_member_snapshots.dart, mobile/lib/features/channels/mentions/mention_candidates_provider.dart, mobile/lib/features/invites/invite_create_provider.dart. 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 mobile/lib/features/channels/channel_directory.dart:243— `current == null || event.createdAt > current.createdAt || (event.createdAt == current.createdAt && event.id.compareTo(current.id) < 0)` appears character-identically in 2 files — mobile/lib/features/channels/channel_directory.dart, mobile/lib/shared/profile/profile_event_parser.dart. 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 mobile/lib/features/channels/channel_actions_sheet.dart:114— `currentMember?.isElevated == true || ownsOwnerAgent` appears character-identically in 2 files — mobile/lib/features/channels/channel_actions_sheet.dart, mobile/lib/features/channels/channel_details_page.dart. 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 mobile/lib/features/channels/channel_detail_page.dart:372— `currentPubkey == null || e.pubkey.toLowerCase() != currentPubkey.toLowerCase()` appears character-identically in 2 files — mobile/lib/features/channels/channel_detail_page.dart, mobile/lib/features/channels/thread_detail_page.dart. 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 85 significant file(s) lose their only recent owner: mobile/lib/features/profile/animated_avatar_capture.dart, mobile/ios/Runner/NativeAttachmentPopover.swift, mobile/ios/Runner/NativeProfileTextEditor.swift, mobile/lib/features/channels/voice_note_recording.dart, mobile/lib/features/profile/profile_avatar_editor.dart, mobile/lib/features/profile/profile_edit_page.dart, mobile/lib/shared/huddle/huddle_media.dart, mobile/ios/Runner/JumpToLatestGlassButton.swift (+77 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 55 significant file(s) lose their only recent owner: REDACTED, crates/buzz-relay/src/nip_fi_http.rs, desktop/src-tauri/src/secret_store.rs, desktop/src-tauri/src/managed_agents/custom_harnesses.rs, crates/buzz-cli/src/commands/agents.rs, crates/buzz-relay/src/handlers/report_resolution.rs, desktop/src-tauri/src/commands/admin/mod.rs, crates/buzz-auth/src/nip_fi/verifier.rs (+47 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 35 significant file(s) lose their only recent owner: desktop/src/features/projects/ui/ProjectPullRequestsPanel.tsx, desktop/src-tauri/src/commands/project_git_workflow.rs, desktop/src/features/projects/ui/ProjectPullRequestFilesChangedPanel.tsx, desktop/src/features/projects/ui/ProjectRepositoryActionsPanel.tsx, desktop/src/features/projects/ui/ProjectWorkspaceTabs.tsx, desktop/src/features/projects/ui/ProjectIssuesPanel.tsx, desktop/src-tauri/src/commands/project_git_diff.rs, desktop/src/features/projects/ui/ProjectDetailFeedPanels.tsx (+27 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 20 significant file(s) lose their only recent owner: desktop/src-tauri/src/managed_agents/persona_avatars.rs, crates/buzz-core/src/private_managed_agent.rs, desktop/src/features/terminal/TerminalSubstrate.tsx, crates/buzz-db/src/store/read_state.rs, REDACTED, crates/buzz-agent/src/databricks_test_support.rs, desktop/src/features/channels/channelSnapshot.ts, crates/buzz-agent/src/databricks.rs (+12 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 17 significant file(s) lose their only recent owner: desktop/src/features/messages/ui/useComposerLinkPreviews.tsx, desktop/src/features/messages/ui/ComposerImageEditor.tsx, desktop/src-tauri/src/commands/link_preview_youtube.rs, desktop/src/shared/theme/communityThemeSync.ts, desktop/src/features/messages/lib/linkPreviewPreparationStore.ts, REDACTED, desktop/src/shared/theme/CommunityThemeController.tsx, desktop/src/features/messages/ui/useAutoPinMentionedAgents.ts (+9 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 16 significant file(s) lose their only recent owner: crates/buzz-push-gateway/src/config.rs, mobile/lib/shared/push/push_bootstrap.dart, mobile/lib/shared/push/push_bridge.dart, mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift, mobile/ios/NotificationService/NotificationService.swift, mobile/ios/Runner/PushSnapshotBridge.swift, mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzCommunicationNotification.swift, mobile/lib/features/age_gate/age_signal_push_bootstrap.dart (+8 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 13 significant file(s) lose their only recent owner: crates/buzz-cli/src/commands/mem.rs, crates/buzz-core/src/git_perms.rs, desktop/src-tauri/src/huddle/tts_playback.rs, desktop/src/features/community-members/useCommunityJoinAlerts.ts, crates/buzz-backend-kubernetes/src/config.rs, crates/buzz-auth/src/scope.rs, desktop/src/features/community-members/lib/joinAlerts.ts, crates/buzz-backend-kubernetes/src/image.rs (+5 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 7 significant file(s) lose their only recent owner: crates/buzz-sdk/src/broker/mod.rs, crates/buzz-sdk/src/broker/actions/args.rs, crates/buzz-sdk/src/broker/actions/mod.rs, crates/buzz-sdk/src/broker/actions/outcomes.rs, crates/buzz-sdk/src/broker/client.rs, crates/buzz-sdk/src/broker/wire.rs, crates/buzz-sdk/src/broker/correlate.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 3 significant file(s) lose their only recent owner: mobile/lib/shared/push/push_subscription.dart, desktop/src/shared/lib/videoPlaybackSpeedPreference.ts, desktop/src/features/channels/ui/ThreadViewModeToggle.tsx. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #10 — If anonymized user #10 becomes unavailable, 3 significant file(s) lose their only recent owner: crates/buzz-db/src/store/reminder.rs, crates/buzz-db/src/test_support.rs, desktop/src/features/profile/lib/userLabelStorage.ts. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #11 — If anonymized user #11 becomes unavailable, 3 significant file(s) lose their only recent owner: mobile/ios/BuzzPushKit/Sources/BuzzPushKit/Bech32.swift, crates/buzz-acp/src/relay/recovery.rs, mobile/lib/features/channels/laid_out_viewport.dart. Pair on, review, or document these before any departure.
Subsumed condition operand web/src/features/repos/git-client.ts:325— `ref.startsWith("//")` can never decide this `||` — every value satisfying `ref.startsWith("//")` also satisfies `ref.startsWith("/")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand desktop/src-tauri/src/managed_agents/team_catalog/tests.rs:939— `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand desktop/src-tauri/src/commands/agents_pending.rs:333— `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand desktop/src-tauri/src/commands/agents_pending.rs:419— `err.contains("archive insert blocked")` can never decide this `||` — every value satisfying `err.contains("archive insert blocked")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand desktop/src-tauri/src/commands/teams/tests.rs:153— `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand desktop/src-tauri/src/commands/personas/pending.rs:575— `err.contains("insert blocked by test trigger")` can never decide this `||` — every value satisfying `err.contains("insert blocked by test trigger")` also satisfies `err.contains("blocked")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand desktop/src/features/workflows/ui/workflowDefinition.ts:181— `detail.startsWith(" is not ")` can never decide this `||` — every value satisfying `detail.startsWith(" is not ")` also satisfies `detail.startsWith(" is ")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/buzz-test-client/tests/e2e_relay.rs:1808— `msg_lower.contains("relay signed only")` can never decide this `||` — every value satisfying `msg_lower.contains("relay signed only")` also satisfies `msg_lower.contains("relay")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/buzz-db/src/runtime/migration.rs:734— `normalized.contains("community_id")` can never decide this `&&` — every value satisfying `normalized.contains("old.community_id")` also satisfies `normalized.contains("community_id")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Silent fallback default on Err crates/buzz-agent/src/agent.rs:1220— `format_hook_output_body` turns every `Err` into `String::from("{\"hook\":\"\",\"server\":\"\",\"text\":\"\"}")` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/buzz-cli/src/commands/notes.rs:224— `resolve_author` turns every `Err` into `false` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/buzz-relay/src/api/git/cas_publish.rs:880— `read_prefix` turns every `Err` into `"<stderr unavailable>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/buzz-relay/src/api/git/transport.rs:1554— `read_log_prefix` turns every `Err` into `"<stderr unavailable>".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 desktop/src-tauri/src/commands/identity_archive.rs:446— `fetch_archived_pubkeys_at` turns every `Err` into `vec![]` — 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 desktop/src-tauri/src/commands/project_git_diff.rs:189— `diff_range` turns every `Err` into `"HEAD^..HEAD".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 desktop/src-tauri/src/managed_agents/storage.rs:855— `read_all_agent_runtime_receipts` 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 desktop/src-tauri/src/managed_agents/storage.rs:883— `read_all_agent_pid_files` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Orphaned file desktop/src/features/search/lib/parseSearchOperators.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file desktop/src/features/messages/useLoadMissingAncestors.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 9 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (268 single-owned of 2288 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2288 of the 3268 production source files in this repository met that bar). They are anonymized user #12 (2 file(s)), anonymized user #13 (2 file(s)), anonymized user #14 (1 file(s)), anonymized user #15 (1 file(s)), anonymized user #16 (1 file(s)), anonymized user #17 (1 file(s)) (+3 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/buzz-relay/src/lifecycle.rs, crates/buzz-db/src/runtime/connection_observability.rs, desktop/src-tauri/src/nostr_bind.rs, desktop/src/shared/ui/markdown/ImageLightboxZoomControls.tsx, crates/ifc-core/src/lib.rs, desktop/src/features/projects/useProjectChannelRequests.ts, desktop/src-tauri/src/mouse_nav.rs, desktop/src/shared/ui/markdown/ProgressiveImage.tsx (+3 more).
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 5 of 43 project(s) overshoot their size bounds, lowering Project Cohesion to 7.7/10. The most over is `desktop` (326664 LoC, 2004 module-visible types across 104 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 2 of 2288 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2288 of the 3268 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: desktop/src/features/search/lib/parseSearchOperators.ts, desktop/src/features/messages/useLoadMissingAncestors.ts. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 20/28 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/buzz-backend-kubernetes`, `crates/buzz-cli`, `crates/buzz-pair-relay`, `crates/buzz-pairing-cli` and 3 more.
Unused export 'CM_OP_PUBKEY' desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:356— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'AdminReadError' · ×1
Unused export 'AdminReadError' desktop/src/features/admin-console/api.ts:626— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'useSetManagedAgentAutoRestartMutation' · ×1
Unused export 'useSetManagedAgentAutoRestartMutation' desktop/src/features/agents/hooks.ts:646— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'useEnsureChannelAgentPresetMutation' · ×1
Unused export 'useEnsureChannelAgentPresetMutation' desktop/src/features/agents/hooks.ts:752— Nothing imports this binding — it is safe to review for removal.
No security response headers detected deploy/compose/Caddyfile:4— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
X2 · Cancellation propagation· Not all functions that make a request accept an AbortSignal or a CancelToken · ×1
Not all functions that make a request accept an AbortSignal or a CancelToken — Only 11/21 functions that make a cancellable request (fetch, axios, ky, ofetch; Dio, AbortableRequest) accept an AbortSignal or a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Dart: `CancelToken? cancelToken`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 3/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Hand-rolled JSON/XML parsing via regex REDACTED:327— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
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 34 file(s) — `admin-web/src/App.tsx`, `desktop/src/app/useAppShellDesktopNotifications.ts`, `desktop/src/features/agents/channelAgents.ts`, `desktop/src/features/agents/ui/AgentRuntimeAvatarControl.tsx`, `desktop/src/features/agents/ui/activityRenderClasses/TranscriptActivityItem.tsx`, … (+29 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 — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a17ace-fedb-7fa3-b497-52cc4ba09767 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 90 · Warnings: 4394 · Recommendations: 150 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 27-10-2026 @ 00:42 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.