Public report — buzz, published 28 Sep 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.16 (frozen) · verify this survey Filed cd_67e3f32584ac4386a77d759a528a9725 Filed 28 September 2026, 21:32 UTC Public

Block/buzz

Measured 28 September 2026, 20:46 UTC

55% Weak
CriticalWeakAdequateStrongExemplary

Very large · 913,098 LoC · 41 projects · rebuild ~9.0 person-years · weakest lens: Architecture (52%)

Findings by grade

60 critical 3968 serious 42 minor 46 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 September 2026, 20:46 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

60/65dimensions tool-verifieddeterministic · confidence 1.0 · 5 LLM-assisted, advisory
4028findings with an exact file:lineof 4070 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
65/134dimensions across the health lenses913098 LoC · 41 projects — wide & deep
Chapters

Executive summary

Band capped at Weak: the weakest category (Security, 0%) reads Critical — the cover never out-promises the category table.

Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.

The system holds a weak overall standing at 55%, indicating a large, complex asset that is workable but carries significant operational risk. With nearly one million lines of production code, the platform represents a substantial investment, estimated at roughly €1.3 million and nine person-years to rebuild. This scale amplifies the impact of its structural weaknesses, making immediate attention to architectural integrity essential for protecting business continuity and delivery speed.

The primary risk is architectural fragility. The architecture lens scores poorly, meaning changes ripple unpredictably through the system. This lack of clear boundaries creates a velocity tax, where every modification in weaker areas likely costs 7–16% more effort than in clean code. For a team changing millions of lines annually, this inefficiency compounds into a massive, hidden cost in delayed releases and increased defect rates, eroding the value of the engineering investment.

A secondary concern is operational exposure. While security scanning found five potential secret leaks, the broader readiness and accessibility scores suggest the system is not fully optimized for safe, observable operation. The absence of measured coverage for key JavaScript and TypeScript suites leaves a blind spot in our confidence regarding regression safety. This uncertainty increases the likelihood of outages or security incidents, which are costly to resolve and damage customer trust.

However, the codebase is not beyond repair. The highest-leverage action is clear: fixing import violations to respect layer boundaries. This specific fix is inexpensive, requiring only a few engineer-days, yet it pays for itself within two months by reducing the annual drag on productivity. It is the single most effective step to stop the bleeding of engineering time and stabilize the platform.

Focus first on enforcing strict import rules to break architectural cycles. This low-effort, high-impact change provides immediate relief to delivery velocity. While the picture is partial due to unmeasured test coverage, addressing the structural debt is the critical first step toward a reliable, maintainable system.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Architecture 52% · 46% weightReadiness 52% · 25% weightAccessibility 54% · 14% weightCode Health 67% · 8% weightPerformance 70% · 4% weightMaturity 71% · 2% weightSecurity 76% · 1% weight

No single dominant problem — the weakest areas are close, so progress on any of them moves the score.

Code composition — where the lines go
Tests 100%
New since the last scan (100+)

573 finding(s) are new versus the previous scan (2026-09-11) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.

  • D1 · buzz_acp::run_harness (cyclomatic 169) crates/buzz-acp/src/lib.rs
  • D1 · modelCapabilities.generateDatabricksLabel (cyclomatic 51) desktop/src/features/agents/ui/modelCapabilities.ts
  • D1 · AdminConsoleSettingsCard.AdminConsoleSettingsSession (cyclomatic 42) desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx
  • D1 · AdminConsoleStaffingTab.RestrictionsSection (cyclomatic 40) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx
  • D1 · buzz_agent::databricks_label_grammar::generate_databricks_label (cyclomatic 34) crates/buzz-agent/src/databricks_label_grammar.rs
  • D1 · AdminConsoleStaffingTab.StaffingTab (cyclomatic 33) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx
  • D1 · SetupStep.SetupStepContent (cyclomatic 29) desktop/src/features/onboarding/ui/SetupStep.tsx
  • D1 · LaneReconciler.runAttempt (cyclomatic 29) desktop/src/features/sidebar/lib/sidebarLaneReconciler.ts
  • D1 · SetupStep.RuntimeCard (cyclomatic 28) desktop/src/features/onboarding/ui/SetupStep.tsx
  • D1 · CanvasHistoryPanel.CanvasHistoryPanel (cyclomatic 25) desktop/src/features/channels/ui/CanvasHistoryPanel.tsx
  • D1 · SetupStep.RuntimeProvidersSection (cyclomatic 24) desktop/src/features/onboarding/ui/SetupStep.tsx
  • D1 · AdminConsoleReportsTab.ResolveReportForm (cyclomatic 22) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx
  • D1 · ChannelCanvas.ChannelCanvas (cyclomatic 22) desktop/src/features/channels/ui/ChannelCanvas.tsx
  • D1 · buzz_desktop::media_proxy::proxy_handler (cyclomatic 21) desktop/src-tauri/src/media_proxy.rs
  • D1 · buzz_desktop::relay::profile_avatar::localize_avatar (cyclomatic 21) desktop/src-tauri/src/relay/profile_avatar.rs
  • D1 · ChannelMessagesNotifier._handleLiveEvent (cyclomatic 21) mobile/lib/features/channels/channel_messages_provider.dart
  • D1 · buzz_relay::api::bridge::thread_window::query (cyclomatic 20) crates/buzz-relay/src/api/bridge/thread_window.rs
  • D1 · ProfileStep.ProfileStep (cyclomatic 20) desktop/src/features/onboarding/ui/ProfileStep.tsx
  • D1 · RelayClient.sendRawWithReconnectRetry (cyclomatic 20) desktop/src/shared/api/relayClientSession.ts
  • D1 · buzz_acp::run_task::run (cyclomatic 18) crates/buzz-acp/src/run_task.rs
  • D1 · BuzzDevPushEnrollmentDriver.completeEnrollment (cyclomatic 18) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift
  • D1 · AdminConsoleFeedbackTab.AttachmentViewer (cyclomatic 18) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx
  • D1 · AnimatedAvatarCameraControls.AnimatedAvatarCameraControls (cyclomatic 18) desktop/src/features/profile/ui/AnimatedAvatarCameraControls.tsx
  • D1 · buzz-download.normalizeOperatingSystem (cyclomatic 18) web/src/shared/lib/buzz-download.ts
  • D1 · AcpClient::spawn_with_env (cyclomatic 17) crates/buzz-acp/src/acp.rs
  • D1 · buzz_acp::isolated_execution::execute (cyclomatic 17) crates/buzz-acp/src/isolated_execution.rs
  • D1 · buzz_agent::llm::anthropic_body (cyclomatic 17) crates/buzz-agent/src/llm.rs
  • D1 · buzz_acp::pool::parse_nostr_thread_response_with_meta (cyclomatic 16) crates/buzz-acp/src/pool.rs
  • D1 · buzz_db::store::thread::get_thread_replies_on (cyclomatic 16) crates/buzz-db/src/store/thread.rs
  • D1 · ChannelMessagesNotifier.cachedThreadReplyIds (cyclomatic 16) mobile/lib/features/channels/channel_messages_provider.dart
  • D1 · SettingsView.SettingsView (cyclomatic 16) desktop/src/features/settings/ui/SettingsView.tsx
  • D1 · channelSectionsStorage.parseChannelSectionPayload (cyclomatic 16) desktop/src/features/sidebar/lib/channelSectionsStorage.ts
  • D2 · buzz_acp::run_harness (cognitive 395) crates/buzz-acp/src/lib.rs
  • D2 · modelCapabilities.generateDatabricksLabel (cognitive 66) desktop/src/features/agents/ui/modelCapabilities.ts
  • D2 · buzz_relay::api::bridge::thread_window::query (cognitive 59) crates/buzz-relay/src/api/bridge/thread_window.rs
  • D2 · AdminConsoleSettingsCard.AdminConsoleSettingsSession (cognitive 48) desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx
  • D2 · buzz_agent::databricks_label_grammar::generate_databricks_label (cognitive 42) crates/buzz-agent/src/databricks_label_grammar.rs
  • D2 · AdminConsoleStaffingTab.RestrictionsSection (cognitive 40) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx
  • D2 · SetupStep.RuntimeCard (cognitive 38) desktop/src/features/onboarding/ui/SetupStep.tsx
  • D2 · SetupStep.RuntimeProvidersSection (cognitive 36) desktop/src/features/onboarding/ui/SetupStep.tsx
  • D2 · buzz_desktop::commands::admin::admin_probe_inner (cognitive 33) desktop/src-tauri/src/commands/admin/mod.rs
  • D2 · CanvasHistoryPanel.CanvasHistoryPanel (cognitive 31) desktop/src/features/channels/ui/CanvasHistoryPanel.tsx
  • D2 · SetupStep.SetupStepContent (cognitive 29) desktop/src/features/onboarding/ui/SetupStep.tsx
  • D2 · RelayClient.sendRawWithReconnectRetry (cognitive 29) desktop/src/shared/api/relayClientSession.ts
  • D2 · ChannelCanvas.ChannelCanvas (cognitive 28) desktop/src/features/channels/ui/ChannelCanvas.tsx
  • D2 · relayClosedRecovery.handleRelayClosed (cognitive 28) desktop/src/shared/api/relayClosedRecovery.ts
  • D2 · AdminConsoleStaffingTab.StaffingTab (cognitive 27) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx
  • D2 · LaneReconciler.runAttempt (cognitive 26) desktop/src/features/sidebar/lib/sidebarLaneReconciler.ts
  • D2 · buzz_db::store::thread::get_thread_replies_on (cognitive 25) crates/buzz-db/src/store/thread.rs
  • D2 · buzz_push_gateway::app_attest::verify_attestation_environment (cognitive 25) crates/buzz-push-gateway/src/app_attest.rs
  • D2 · buzz_desktop::relay::profile_avatar::localize_avatar (cognitive 25) desktop/src-tauri/src/relay/profile_avatar.rs
  • D2 · UserCacheNotifier._flushPending (cognitive 25) mobile/lib/shared/profile/user_cache_provider.dart
  • D2 · ProfileStep.ProfileStep (cognitive 24) desktop/src/features/onboarding/ui/ProfileStep.tsx
  • D2 · ChannelMessagesNotifier.cachedThreadReplyIds (cognitive 23) mobile/lib/features/channels/channel_messages_provider.dart
  • D2 · AnimatedAvatarCameraControls.AnimatedAvatarCameraControls (cognitive 23) desktop/src/features/profile/ui/AnimatedAvatarCameraControls.tsx
  • D2 · ChannelMessagesNotifier._pruneOffWindowReplies (cognitive 22) mobile/lib/features/channels/channel_messages_provider.dart
  • D2 · AcpClient::spawn_with_env (cognitive 21) crates/buzz-acp/src/acp.rs
  • D2 · buzz_desktop::native_relay_client::reconcile (cognitive 21) desktop/src-tauri/src/native_relay_client.rs
  • D2 · prepare-inter.main (cognitive 21) mobile/scripts/prepare-inter.py
  • D2 · BuzzDevPushEnrollmentDriver.completeEnrollment (cognitive 21) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift
  • D2 · AdminConsoleFeedbackTab.AttachmentViewer (cognitive 21) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx
  • D2 · buzz_desktop::managed_agents::backend::discover_acp_command_candidates_in (cognitive 19) desktop/src-tauri/src/managed_agents/backend.rs
  • D2 · prepare-inter.verify (cognitive 19) mobile/scripts/prepare-inter.py
  • D2 · BuzzPushSnapshotBridge.syncCommunities (cognitive 19) mobile/ios/Runner/PushSnapshotBridge.swift
  • D2 · PairingNotifier._pairNipAb (cognitive 19) mobile/lib/features/pairing/pairing_provider.dart
  • D2 · AdminConsoleReportsTab.ResolveReportForm (cognitive 19) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx
  • D2 · buzz_relay::api::media::upload_blob_result (cognitive 18) crates/buzz-relay/src/api/media.rs
  • D2 · buzz_acp::run_task::run (cognitive 17) crates/buzz-acp/src/run_task.rs
  • D2 · buzz_auth::nip98::verify_nip98_event (cognitive 17) crates/buzz-auth/src/nip98.rs
  • D2 · buzz_relay::connection::handle_active_connection (cognitive 17) crates/buzz-relay/src/connection.rs
  • D2 · buzz_desktop::native_relay_client::run_session (cognitive 17) desktop/src-tauri/src/native_relay_client.rs
  • D2 · ChannelSectionsManager._publish (cognitive 17) mobile/lib/features/channels/channel_sections/channel_sections_manager.dart
  • D2 · RelaySessionNotifier.queryRelay (cognitive 17) mobile/lib/shared/relay/relay_session.dart
  • D2 · AdminConsolePanelHelpers.parseImetaAttachments (cognitive 16) desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx
  • D2 · SettingsView.SettingsView (cognitive 16) desktop/src/features/settings/ui/SettingsView.tsx
  • D2 · useStaleReaderRecovery.useStaleReaderRecovery (cognitive 16) desktop/src/features/sidebar/lib/useStaleReaderRecovery.ts
  • D3 · FunctionTooLong: buzz_acp::run_harness crates/buzz-acp/src/lib.rs
  • D3 · FunctionTooLong: AdminConsoleStaffingTab.RestrictionsSection desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx
  • D3 · FunctionTooLong: AdminConsoleStaffingTab.StaffingTab desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx
  • D3 · FunctionTooLong: CanvasHistoryPanel.CanvasHistoryPanel desktop/src/features/channels/ui/CanvasHistoryPanel.tsx
  • D3 · FunctionTooLong: AdminConsoleSettingsCard.AdminConsoleSettingsSession desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx
  • D3 · FunctionTooLong: SetupStep.RuntimeCard desktop/src/features/onboarding/ui/SetupStep.tsx
  • D3 · ClassTooLong: ChannelMessagesNotifier mobile/lib/features/channels/channel_messages_provider.dart
  • D3 · FunctionTooLong: SetupStep.SetupStepContent desktop/src/features/onboarding/ui/SetupStep.tsx
  • D3 · FunctionTooLong: SetupStep.RuntimeProvidersSection desktop/src/features/onboarding/ui/SetupStep.tsx
  • D3 · FileTooLong: channels/channel_messages_provider.dart mobile/lib/features/channels/channel_messages_provider.dart
  • D3 · TooManyMethods: ChannelMessagesNotifier mobile/lib/features/channels/channel_messages_provider.dart
  • D3 · FileTooLong: admin-console/AdminConsoleReportsTab.tsx desktop/src/features/admin-console/AdminConsoleReportsTab.tsx
  • D3 · FunctionTooLong: buzz_relay::api::media::upload_blob_result crates/buzz-relay/src/api/media.rs
  • D3 · FunctionTooLong: AdminConsoleReportsTab.ResolveReportForm desktop/src/features/admin-console/AdminConsoleReportsTab.tsx
  • D3 · FileTooLong: admin/mod.rs desktop/src-tauri/src/commands/admin/mod.rs
  • D3 · MethodTooLong: BuzzDevPushEnrollmentDriver.completeEnrollment mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift
  • D3 · FileTooLong: admin-console/AdminConsoleStaffingTab.tsx desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx
  • D3 · FileTooLong: src/connection.rs crates/buzz-relay/src/connection.rs
  • D3 · FunctionTooLong: buzz_acp::run_task::run crates/buzz-acp/src/run_task.rs
  • D3 · FunctionTooLong: AdminConsoleFeedbackTab.AttachmentViewer desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx
  • D3 · FunctionTooLong: buzz_desktop::relay::profile_avatar::localize_avatar desktop/src-tauri/src/relay/profile_avatar.rs
  • D3 · FunctionTooLong: buzz_desktop::native_relay_client::run_connection desktop/src-tauri/src/native_relay_client.rs
  • D3 · FunctionTooLong: buzz_desktop::media_proxy::handle_buzz_media desktop/src-tauri/src/media_proxy.rs
  • D3 · TooManyFields: DeletionRequest REDACTED

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €440,000–€2,200,000
Cost to rebuild€440,000–€2,200,000 (4.3–13.7 person-years (7,256–23,020 h), ~5–18 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 55% quality) — the last 20% of quality is most of the work
Size & shapeVery large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~9.0 person-years of build effort (about ~€1,300,000 to rebuild). Its weakest lens is Architecture at 52% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.1) — vertical slice × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Resolve the 5 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
+3.0 pts · Low effort · REDACTED Scanning
2
Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1095 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).
+3.1 pts · Medium effort · Import Boundaries
3
Break each cycle by extracting the shared piece into a module both sides can import.
+3.1 pts · Medium effort · Circular Imports

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 1068–6407.7 engineer-days every year, paid as drag on the ~6,196,994 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 7–16% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 1,528,026 line(s) changed over a 90-day window ⇒ ~6,196,994/year · D1/D2/D4 code quality: averaging 5.2/10 ⇒ a 7–16% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Very large asset (~9.0 person-years to rebuild), and its weakest lens is Architecture at 52%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~9.0 person-years rebuild (913,098 LoC) · weakest lens: Architecture 52%
→ Direct remediation budget at Architecture first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1095 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). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1095 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).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.2/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 7–16% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 5.2/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch buzz-acp buzz-acp buzz-core buzz-core buzz-acp->buzz-core buzz-persona buzz-persona buzz-acp->buzz-persona buzz-sdk buzz-sdk buzz-acp->buzz-sdk buzz-admin buzz-admin buzz-audit buzz-audit buzz-admin->buzz-audit buzz-auth buzz-auth buzz-admin->buzz-auth buzz-admin->buzz-core buzz-db buzz-db buzz-admin->buzz-db buzz-deletion buzz-deletion buzz-admin->buzz-deletion buzz-media buzz-media buzz-admin->buzz-media buzz-pubsub buzz-pubsub buzz-admin->buzz-pubsub buzz-search buzz-search buzz-admin->buzz-search buzz-workflow buzz-workflow buzz-admin->buzz-workflow buzz-audit->buzz-core buzz-datastore-tracing buzz-datastore-tracing buzz-audit->buzz-datastore-tracing buzz-auth->buzz-core buzz-cli buzz-cli buzz-cli->buzz-core buzz-cli->buzz-persona buzz-cli->buzz-sdk buzz-ws-client buzz-ws-client buzz-cli->buzz-ws-client buzz-db->buzz-core buzz-db->buzz-datastore-tracing buzz-deletion->buzz-core buzz-deletion->buzz-db buzz-deletion->buzz-media buzz-desktop buzz-desktop buzz-desktop->buzz-core buzz-desktop->buzz-persona buzz-desktop->buzz-sdk buzz-desktop->buzz-ws-client buzz-dev-mcp buzz-dev-mcp buzz-dev-mcp->buzz-cli buzz-dev-mcp->buzz-core buzz-media->buzz-core buzz-pubsub->buzz-auth buzz-pubsub->buzz-core buzz-relay buzz-relay buzz-relay->buzz-audit buzz-relay->buzz-auth buzz-relay->buzz-core buzz-relay->buzz-datastore-tracing buzz-relay->buzz-db buzz-relay->buzz-deletion buzz-relay->buzz-media buzz-relay->buzz-pubsub buzz-relay->buzz-sdk buzz-relay->buzz-search buzz-relay->buzz-workflow buzz-sdk->buzz-core buzz-search->buzz-core buzz-search->buzz-datastore-tracing buzz-workflow->buzz-core buzz-workflow->buzz-db buzz-workflow->buzz-deletion sprig sprig sprig->buzz-acp sprig->buzz-dev-mcp __more__ +21 more projects

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

1178 modules, 1379 dependencies. 13 dependency cycles across 63 modules, marked above the diagonal.

Showing the 40 most-connected modules; 1138 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 buzz_acp.config2 buzz_agent.databricks_test_support3 buzz_backend_kubernetes.wire4 buzz_core.event5 buzz_core.private_managed_agent6 buzz_core.tenant7 buzz_desktop.managed_agents.types.teams8 desktop.src.shared.api.types9 desktop.src.shared.lib10 buzz_acp.relay11 buzz_agent.types12 buzz_cli13 buzz_cli.client14 buzz_db.runtime.observability15 buzz_media.storage16 buzz_push_gateway.http17 buzz_relay_mesh.wire18 desktop.src.features.agents.ui19 desktop.src.features.messages.lib20 buzz_acp.pool21 buzz_agent22 buzz_db.runtime23 buzz_desktop.managed_agents.retention24 buzz_relay.api.media25 buzz_acp26 buzz_admin27 buzz_desktop.terminal_runtime28 buzz_relay.handlers.ingest29 buzz_relay.tunnel.directory30 buzz_acp.setup_mode31 buzz_relay.api.git.transport32 buzz_relay.audio.join33 buzz_desktop.managed_agents.types34 buzz_relay.mesh_boot35 buzz_desktop.managed_agents.global_config36 buzz_desktop.managed_agents.session_policy37 buzz_relay.state38 buzz_desktop.app_state39 buzz_desktop.managed_agents.types.requests40 buzz_relay.connection
1 buzz_acp.config
2 buzz_agent.databricks_test_support
3 buzz_backend_kubernetes.wire
4 buzz_core.event
5 buzz_core.private_managed_agent
6 buzz_core.tenant
7 buzz_desktop.managed_agents.types.teams
8 desktop.src.shared.api.types
9 desktop.src.shared.lib
10 buzz_acp.relay22
11 buzz_agent.types1
12 buzz_cli2
13 buzz_cli.client1
14 buzz_db.runtime.observability1
15 buzz_media.storage2
16 buzz_push_gateway.http11
17 buzz_relay_mesh.wire1
18 desktop.src.features.agents.ui1
19 desktop.src.features.messages.lib1
20 buzz_acp.pool34
21 buzz_agent24
22 buzz_db.runtime1222
23 buzz_desktop.managed_agents.retention11
24 buzz_relay.api.media224112
25 buzz_acp857
26 buzz_admin12
27 buzz_desktop.terminal_runtime12
28 buzz_relay.handlers.ingest211
29 buzz_relay.tunnel.directory4712
30 buzz_acp.setup_mode2411
31 buzz_relay.api.git.transport114211
32 buzz_relay.audio.join3151
33 buzz_desktop.managed_agents.types523
34 buzz_relay.mesh_boot15122
35 buzz_desktop.managed_agents.global_config1
36 buzz_desktop.managed_agents.session_policy11
37 buzz_relay.state27111
38 buzz_desktop.app_state11
39 buzz_desktop.managed_agents.types.requests321
40 buzz_relay.connection211
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
buzz_acp.config…tabricks_test_support…ckend_kubernetes.wirebuzz_core.event…private_managed_agentbuzz_core.tenant…ed_agents.types.teams….src.shared.api.typesdesktop.src.shared.libbuzz_acp.relaybuzz_agent.typesbuzz_clibuzz_cli.client…runtime.observabilitybuzz_media.storagebuzz_push_gateway.httpbuzz_relay_mesh.wire…rc.features.agents.ui…features.messages.libbuzz_acp.poolbuzz_agentbuzz_db.runtime…aged_agents.retentionbuzz_relay.api.mediabuzz_acpbuzz_admin…ktop.terminal_runtime…relay.handlers.ingest…elay.tunnel.directorybuzz_acp.setup_mode…lay.api.git.transportbuzz_relay.audio.join….managed_agents.typesbuzz_relay.mesh_boot…_agents.global_config…agents.session_policybuzz_relay.statebuzz_desktop.app_state…agents.types.requestsbuzz_relay.connectionbuzz_acp.config1…tabricks_test_support2…ckend_kubernetes.wire3buzz_core.event4…private_managed_agent5buzz_core.tenant6…ed_agents.types.teams7….src.shared.api.types8desktop.src.shared.lib9buzz_acp.relay10buzz_agent.types11buzz_cli12buzz_cli.client13…runtime.observability14buzz_media.storage15buzz_push_gateway.http16buzz_relay_mesh.wire17…rc.features.agents.ui18…features.messages.lib19buzz_acp.pool20buzz_agent21buzz_db.runtime22…aged_agents.retention23buzz_relay.api.media24buzz_acp25buzz_admin26…ktop.terminal_runtime27…relay.handlers.ingest28…elay.tunnel.directory29buzz_acp.setup_mode30…lay.api.git.transport31buzz_relay.audio.join32….managed_agents.types33buzz_relay.mesh_boot34…_agents.global_config35…agents.session_policy36buzz_relay.state37buzz_desktop.app_state38…agents.types.requests39buzz_relay.connection4022121121111134241222112241128571212211471224111142113151523151221112711111321211+1138 more modules (most-connected shown)

At a glance — Code Health · 67% · Adequate · gated by D2 ·

At a glance — Architecture · 52% · Adequate · gated by R11, R9 ·

At a glance — Maturity · 71% · Strong ·

At a glance — Readiness · 52% · Adequate · gated by D13, P7 ·

At a glance — Security · 76% · Adequate · gated by D29, D30 ·

At a glance — Accessibility · 54% · Adequate · gated by AC4 ·

At a glance — Performance · 70% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A03:2021 — Injection56High / Critical
A06:2021 — Vulnerable & Outdated Components32High / Critical
A05:2021 — Security Misconfiguration25High / Critical
A02:2021 — Cryptographic Failures7High / Critical

Roadmap

First, enforce strict import boundaries by routing all dependencies through public indices and eliminate circular imports by extracting shared logic into independent modules. Next, immediately remediate the five identified secret leaks and integrate automated secret scanning into CI to prevent future exposure. Finally, harden outbound HTTP calls by enforcing request timeouts and implementing retry logic with back-off to improve resilience.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 5 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.+3.0 ptsLowREDACTED Scanning
Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (1095 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).+3.1 ptsMediumImport Boundaries
Break each cycle by extracting the shared piece into a module both sides can import.+3.1 ptsMediumCircular Imports
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.+3.0 ptsMediumOutbound HTTP resilience
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.+2.8 ptsMediumSecurity & performance tooling
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+2.8 ptsMediumDR & Backup
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.4 ptsMediumKeyboard semantics
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.+2.4 ptsMediumA11y enforcement

File quality

Per-file score 0–10 — a quality signature. Of 998 files carrying findings, judged against the Preview bar: 0% slop · 6% mixed · 94% near-clean.

FileScoreBandWorst signal
REDACTED0.4SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.1SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
desktop/src/features/messages/ui/MessageThreadPanel.tsx4.8MixedCyclomatic Complexity: MessageThreadPanel.MessageThreadPanel (cyclomatic 91)
desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx4.9MixedCyclomatic Complexity: AgentSessionTranscriptList.AgentSessionTranscriptList (cyclomatic 20)
REDACTED5.0MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.4MixedStatic Analysis (SAST): Medium: REDACTED
desktop/src-tauri/src/commands/agents.rs5.5MixedCyclomatic Complexity: buzz_desktop::commands::agents::create_managed_agent (cyclomatic 30)
desktop/src/features/onboarding/hooks.ts5.6MixedCyclomatic Complexity: hooks.useAppOnboardingState (cyclomatic 30)
mobile/lib/features/search/search_page.dart5.6MixedCyclomatic Complexity: SearchPage.build (cyclomatic 22)
desktop/src/features/home/ui/HomeView.tsx5.6MixedCyclomatic Complexity: HomeView.HomeView (cyclomatic 87)
desktop/src/features/sidebar/ui/AppSidebar.tsx5.6MixedCyclomatic Complexity: AppSidebar.AppSidebar (cyclomatic 61)
mobile/lib/features/activity/activity_page.dart5.6MixedCyclomatic Complexity: ActivityPage.build (cyclomatic 50)
desktop/src/app/AppShell.tsx5.6MixedCyclomatic Complexity: AppShell.AppShell (cyclomatic 45)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 60

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 — 3968

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 — 42

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 46

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. 60 of 65 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. 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 — 65 dimensions across the health lenses
D1D2D3D4D5D9D10D13D15D16D17D19D20D21D22D26D28D29D30D31D34D35D36D37D40D41D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX3AX5AX7AX8AX9M1M2M3M4P1P2P3P4P5P6P7P8PF3R1R10R11R2R3R4R6R7R8R9S1

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
  1. 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, 4028 of 4070 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.)
  2. 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.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a0e9c4-8896-7a82-8d69-075eb225793a.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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.

  • D6 Cohesion (LCOM4) — 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.
  • 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,107 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 435 test source file(s) (.py, .rs, .swift, .dart) 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.
  • 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. Dependency Hygiene ran out of its 5-minute budget before it had finished, so what it reports here is a floor rather than a complete count. The rows above are real and stand; what is not known is how many more there are. This is a limit of the analysis run, not a finding about 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`, … (+24 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • AX2 Stateful singletons — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX6 Interface segregation — 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
  • 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 finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • P10 Library API & versioning — 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 NuGet packaging and C# public API only, and no .NET project was loaded for this repository, 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.
  • PF1 Benchmark discipline — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • PF2 Allocation 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. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • PF3 Async & latency hygiene — 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. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
  • 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. 697 further occurrence(s) are not listed individually; the score already reflects all 737.
  • 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. 1061 further occurrence(s) are not listed individually; the score already reflects all 1101.
  • 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. 28 further occurrence(s) are not listed individually; the score already reflects all 68.
  • 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. 97 further occurrence(s) are not listed individually; the score already reflects all 137.
  • X1 Async correctness — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X10 Duplicated predicate — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X12 Unreachable branch — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X13 Undrained process stream — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X14 Bypassable address classification — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X15 Unvalidated length from an untrusted reader — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X16 Unfloored truncation loop — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X17 Uncapped recursion over a caller-supplied document — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X18 Disposal-pattern correctness — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X19 Unrestored process-global state — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X2 Cancellation propagation — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X20 Mistyped argument guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X22 Contradicted release guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X23 Unguarded diagnostic materialisation — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X24 Document value interpolated into markup unescaped — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X25 Inert configuration knob — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X26 Unsynchronised callback handoff — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X27 Collection changed while being enumerated — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X28 Index access outside its own emptiness guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X29 Per-element action decided by a fixed element — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X3 Exception handling — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X30 Support guard that admits what it rejects — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X32 Type resolved by simple name across every loaded assembly — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X4 Structured logging — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X5 Nullable reference types — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
  • X6 Hand-rolled structured-format parsing — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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.
  • 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").
  • 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • 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.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • 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.
  • 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.

The LLM boundary

LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity4.1 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 4.1 / 10 · rule-coverage 100% · ceiling Prevented

659 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was AgentConfigFields.AgentConfigFields at 170. A further 13 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. 9 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/shared/lib/configNudge.ts (configNudge.isConfigNudgeRequirement at 20), crates/buzz-auth/src/nip_fi/verifier.rs (VerifierError::code at 18), and 4 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.

buzz_desktop::huddle::tts::tts_worker (cyclomatic 71) · ×43desktop/src-tauri/src/huddle/tts.rs:322
buzz_relay::handlers::ingest::ingest_event_inner (cyclomatic 149) · ×36crates/buzz-relay/src/handlers/ingest.rs:2252
buzz_acp::run_harness (cyclomatic 169) · ×14crates/buzz-acp/src/lib.rs:2575
buzz_agent::llm::openrouter_post (cyclomatic 36) · ×9crates/buzz-agent/src/llm.rs:2258
buzz_db::store::event::query_events_on (cyclomatic 43) · ×7crates/buzz-db/src/store/event.rs:474

+ 524 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 43 buzz_desktop finding(s) in Cyclomatic Complexity — start with pipeline.rs (3), migration.rs (2), agents.rs (2). — One of this dimension's main actionable groups (43 warning-level).
  2. Resolve the 36 buzz_relay finding(s) in Cyclomatic Complexity — start with ingest.rs (6), bridge.rs (4), side_effects.rs (3). — One of this dimension's main actionable groups (36 warning-level).
  3. Resolve the 14 buzz_acp finding(s) in Cyclomatic Complexity — start with relay.rs (6), lib.rs (2), pool.rs (2). — One of this dimension's main actionable groups (14 warning-level).
  4. 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.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

959 method(s) exceeded the cognitive complexity threshold of 15; the worst was buzz_acp::run_harness at 395.

buzz_desktop::huddle::playout::run_playout_recv_loop (cognitive 175) · ×109desktop/src-tauri/src/huddle/playout.rs:273
buzz_relay::handlers::ingest::ingest_event_inner (cognitive 212) · ×62crates/buzz-relay/src/handlers/ingest.rs:2252
buzz_acp::run_harness (cognitive 395) · ×28crates/buzz-acp/src/lib.rs:2575
buzz_agent::llm::openrouter_post (cognitive 86) · ×16crates/buzz-agent/src/llm.rs:2258
buzz_db::store::event::query_events_on (cognitive 73) · ×12crates/buzz-db/src/store/event.rs:474

+ 662 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 109 buzz_desktop finding(s) in Cognitive Complexity — start with instance_reaper.rs (5), backend.rs (4), pipeline.rs (4). — One of this dimension's main actionable groups (109 warning-level).
  2. Resolve the 62 buzz_relay finding(s) in Cognitive Complexity — start with ingest.rs (8), bridge.rs (6), side_effects.rs (6). — One of this dimension's main actionable groups (62 warning-level).
  3. Resolve the 28 buzz_acp finding(s) in Cognitive Complexity — start with relay.rs (8), lib.rs (6), pool.rs (3). — One of this dimension's main actionable groups (28 warning-level).
  4. 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.

D3 · God Classes6.9 / 10Adequate✓ 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.

Maturity: Documented → Verified → Prevented · effective 6.9 / 10 · rule-coverage 100% · ceiling Prevented

895 god class(es) detected.

FunctionTooLong: buzz_acp::run_harness · ×479crates/buzz-acp/src/lib.rs:2575
FileTooLong: src/lib.rs · ×225crates/buzz-acp/src/lib.rs
MethodTooLong: ComposeBar.build · ×93mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:33
ClassTooLong: DeletionStore · ×75REDACTED:678
TooManyMethods: Db · ×11crates/buzz-db/src/runtime/mod.rs:126

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 479 FunctionTooLong finding(s) in God Classes — start with lib.rs (9), hooks.ts (6), SetupStep.tsx (5). — One of this dimension's main actionable groups (479 warning-level).
  2. Resolve the 225 FileTooLong finding(s) in God Classes — start with lib.rs (8), mod.rs (5), hooks.ts (4). — One of this dimension's main actionable groups (225 warning-level).
  3. Resolve the 93 MethodTooLong finding(s) in God Classes — start with message_list.dart (2), config.rs (2), sheets.dart (2). — One of this dimension's main actionable groups (93 warning-level).
  4. 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.

D4 · Code Duplication9.7 / 10Stronggated by 655 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Verified

626 duplicated block group(s) detected. A further 29 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, .ts (36% 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.

Duplicated block (6 lines × 2) · ×46crates/buzz-acp/src/filter.rs:283
Duplicated block (8 lines × 2) · ×44crates/buzz-acp/src/relay.rs:3369
Duplicated block (7 lines × 2) · ×41crates/buzz-acp/src/relay.rs:487
Duplicated block (10 lines × 2) · ×35crates/buzz-acp/src/queue.rs:2083
Duplicated block (9 lines × 2) · ×34crates/buzz-acp/src/lib.rs:2885

+ 149 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 46 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with main.rs (3), filter.rs (2), client.rs (2). — One of this dimension's main actionable groups (46 warning-level).
  2. Resolve the 44 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 (44 warning-level).
  3. Resolve the 41 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with relay.rs (2), REDACTED (2), event.rs (2). — One of this dimension's main actionable groups (41 warning-level).
  4. 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.

D5 · Coupling7.7 / 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.

Maturity: Documented → Verified → Prevented · effective 7.7 / 10 · rule-coverage 100% · ceiling Prevented

41 production modules (Gradle+Cargo+npm+SwiftPM), 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; 12 module(s) off the main sequence, with abstractness counted on 37 of the 41 (the rest declare no modelled class or interface, export only macros, or are not Gradle/Maven modules or Cargo crates).

Off the main sequence: buzz-core · ×12

What to do

  1. Resolve the 12 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (12 warning-level).
  2. 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.

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.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Documented

18423 test methods: 16109 unit, 440 integration, 0 BDD, 1874 e2e. The JavaScript/TypeScript suite contributes 8153 `it`/`test` case(s) across 900 test file(s) declaring at least one beside 179 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 9967 `#[test]` function(s) across 658 file(s) declaring at least one; its unit/integration split is Cargo's own — 45 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

  1. Improve Test Distribution — currently 8.7/10. — 18423 test methods: 16109 unit, 440 integration, 0 BDD, 1874 e2e. The JavaScript/TypeScript suite contributes 8153 `it`/`test` case(s) across 900 test file(s) declaring at least one beside 179 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 9967 `#[test]` function(s) across 658 file(s) declaring at least one; its unit/integration split is Cargo's own — 45 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.

D10 · Test Quality10.0 / 10Stronggated by 17 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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

4 skipped (4 with a documented reason), 17 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 8107 tests. Measured on the JavaScript/TypeScript suite only — at least 435 test source file(s) (.py, .rs, .swift, .dart) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: ${row.name}: ${row.desc} · ×17desktop/src/features/admin-console/adminConsolePanel.test.mjs:1066
Skipped (documented): (unnamed test) · ×4desktop/tests/e2e/relay-restart.live.spec.ts:135

What to do

  1. Resolve the 17 No assertions finding(s) in Test Quality — start with channel-add-screenshots.spec.ts (4), add-community-screenshots.spec.ts (3), adminConsolePanel.test.mjs. — One of this dimension's main actionable groups (17 warning-level).
  2. 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.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

5 secret(s) detected.

REDACTED

What to do

  1. Resolve the 5 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. 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.

D15 · Churn × Complexity Hotspots8.2 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.2 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: desktop/src/testing/e2eBridge.ts (225×592=133200); crates/buzz-acp/src/lib.rs (55×169=9295); desktop/src/features/channels/ui/ChannelPane.tsx (57×128=7296) Repeated repair below the complexity floor: desktop/src-tauri/src/relay.rs (9 of 17 changes were fixes); desktop/src/features/profile/hooks.ts (8 of 13 changes were fixes); desktop/src/shared/api/relayClientShared.ts (7 of 12 changes were fixes)

Hotspot: desktop/src/testing/e2eBridge.ts · ×371desktop/src/testing/e2eBridge.ts:11397
Repeated repair: desktop/src-tauri/src/relay.rs · ×56desktop/src-tauri/src/relay.rs:285

What to do

  1. Resolve the 371 Hotspot finding(s) in Churn × Complexity Hotspots — start with hooks.ts (5), lib.rs (4), config.rs (3). — One of this dimension's main actionable groups (371 warning-level).
  2. Resolve the 56 Repeated repair finding(s) in Churn × Complexity Hotspots — start with hooks.ts (6), relay.rs, relayClientShared.ts. — One of this dimension's main actionable groups (56 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

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.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Documented

252 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 2091 of the 3018 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 · ×9
Further sole-owners (lower concentration)

What to do

  1. Resolve the 9 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (9 recommendation-level).
  2. 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.

D17 · Explicit Debt10.0 / 10Stronggated by 19 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

19 deducted task-comment markers across 913098 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×17crates/buzz-cli/src/commands/workflows.rs:10
HackCommentcrates/buzz-search/tests/postgres_fts_integration.rs:270
FixmeCommentdesktop/tests/e2e/navigation.spec.ts:127

What to do

  1. Resolve the 17 TodoComment finding(s) in Explicit Debt — start with executor.rs (3), media.rs (2), conformance_multitenant.rs (2). — One of this dimension's main actionable groups (17 warning-level).
  2. 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).
  3. 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).
  4. 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.

D19 · Documentation QualityExemplary◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

The repository's READMEs and architecture/Docs markdown files are clear, complete, and well-structured. Each directory's README documents itself with an overview, installation/build/run instructions, usage examples, and a targeted contribution guide (for the deploy/compose and docs/admin directories). The architecture/Docs set provides comprehensive design documentation covering feature flags, pairing, nostr credential helpers, Docker Compose deployment, and a private moderation dashboard, all well-organized. All visible content is present and clear; no missing-overview, missing-installation, or unstructured sections. The repository's READMEs are well written for their directories: each one states what it documents (a MinIO CI image, a dataset benchmark suite) and gives precise usage (how to run the test harness, how to stage a first publication). The architecture/Docs markdown files (47 total) cover design decisions, deployment, and cross-suite guarantees that are not exposed in any README. The visible content is clear and well ordered; clipped documents carry their full outline, so no section is flagged as missing. (9 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

Documentation: no licence statement · ×2crates/buzz-feature-flags/README.md

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyAdequate◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

Maturity: Documented → Verified → Prevented · effective Adequate / 10 · rule-coverage 100% · ceiling Verified

5 API inconsistencies across a 400-member sample of 1020 exposed types.

Ambiguous distinction between 'bearer' and 'bearer_no_browser'. It is unclear if 'bearer' implies a browser-based flow by default or if it is a generic alias. If 'bearer' is the standard method, 'bearer_no_browser' suggests a variant that should perhaps be the default or named more explicitly (e.g., 'fetch_silent').
Inconsistent constructor naming and parameter explosion. 'new' takes minimal args, 'new_with' adds an opener, and a third constructor adds timeout. This violates the 'new' convention for primary construction and forces users to guess which constructor to use based on optional-like behavior.
Inconsistent return types for construction. 'from_env' returns 'Result', implying it can fail, while 'for_discovery' returns 'Self' directly, implying it cannot fail. This inconsistency makes error handling patterns unpredictable when constructing Config instances.
Inconsistent naming for version/type identifiers. 'code' is used for error types, 'hash_version' for audit entries, and 'schema_version' for traces. While domains differ, the pattern of using 'version' for numeric identifiers is inconsistent with 'code' for string identifiers in errors. More critically, 'AuthError.code()' returns a string, which is unusual for a 'code' (often numeric), whereas 'hash_version' is numeric. This suggests a lack of unified error/code type.
Duplicate method name 'estimated_bytes' on distinct types that likely serve similar purposes (memory estimation). While not strictly an inconsistency in signature, it suggests a missing trait (e.g., 'EstimatableSize') that could unify these behaviors and allow for generic handling of memory pressure.

What to do

  1. Resolve the 1 Ambiguous distinction between 'bearer' and 'bearer_no_browser'. It is… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Inconsistent constructor naming and parameter explosion. 'new' takes… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Inconsistent return types for construction. 'from_env' returns 'Result',… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion8.3 / 10Strong✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Documented

3 of 35 build units (Cargo) flagged as possibly oversized/incoherent.

Split crates/buzz-relay
Split desktop/src-tauri

What to do

  1. Resolve the 1 Split crates/buzz-relay finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Split desktop/src-tauri 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.

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. 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.

D29 · Static Analysis (SAST)0.2 / 10Critical✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 0.2 / 10 · rule-coverage 100% · ceiling Documented

56 finding(s): 0 critical, 9 high, 46 medium, 1 low. semgrep hit a parse error in 68 file(s) — `REDACTED` (lines 23–186), `admin-web/src/App.tsx` (lines 75–76), `bin/activate-hermit` (line 12), `bin/activate-hermit.fish` (lines 8–24), `REDACTED`, … (+63 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

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. 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.

D30 · Dependency Vulnerabilities1.9 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir/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, Go, Java and Kotlin via Maven/Gradle, 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.

Maturity: Documented → Verified → Prevented · effective 1.9 / 10 · rule-coverage 100% · ceiling Documented

32 finding(s): 0 critical, 5 high, 26 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 11 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (11). — One of this dimension's main actionable groups (11 warning-level).
  2. Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. 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.

D31 · IaC & Container Security7.2 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 7.2 / 10 · rule-coverage 100% · ceiling Documented

25 finding(s): 0 critical, 3 high, 17 medium, 5 low.

REDACTED
REDACTED
REDACTED

What to do

  1. 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).
  2. 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).
  3. 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.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 2091 of the 3018 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.6 / 10Stronggated by 33 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: ChannelPane.types.ts↔ChannelScreen.tsx 85%; TopbarSearch.tsx↔AppSidebar.tsx 80%; tests.rs↔e2eBridge.ts 79%

Change coupling: ChannelPane.types.ts ↔ ChannelScreen.tsx · ×26desktop/src/features/channels/ui/ChannelPane.types.ts
Change-coupling hub: AppSidebar.tsx → ChatHeader.tsx, ProfilePopover.tsx, TopbarSearch.tsx, ViewLoadingFallback.tsx · ×7desktop/src/features/sidebar/ui/AppSidebar.tsx

What to do

  1. Resolve the 26 Change coupling finding(s) in Change Coupling — start with lib.rs (3), MessageThreadPanel.tsx (2), AgentSessionTranscriptList.tsx (2). — One of this dimension's main actionable groups (26 warning-level).
  2. Resolve the 7 Change-coupling hub finding(s) in Change Coupling — start with AppSidebar.tsx, e2eBridge.ts, MessageRow.tsx. — One of this dimension's main actionable groups (7 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Build pipeline generates provenance, signs artifacts and produces an SBOM.

REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — 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.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D40 · Network Egress Confinement10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Kubernetes workloads are covered by a network policy that restricts egress.

✓ On the Gold path — maintain.

Detailed fixes: d40_recommendation.md.

D41 · Kernel & Syscall Confinement8.0 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

1/2 syscall-confinement controls present (seccomp, AppArmor/SELinux).

No AppArmor/SELinux confinement

What to do

  1. Resolve the 1 No AppArmor/SELinux confinement finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 7 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.

End-of-life runtime: Rust 1.95

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.

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.
AC2 · Forms & labels7.0 / 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. (×7) — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:488, desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:608, desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:657, …
  • 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:666, 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.
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.
AC4 · Keyboard semantics3.2 / 10Weak✓ Tool-verified

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: interactive elements plus elements the markup gives a click/key handler or the repo's own CSS styles `cursor: pointer`, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). 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. (×5) — 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

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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.

AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

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.

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 739 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.
AX10 · Code composition9.2 / 10Exemplary✓ Tool-verified

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.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

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.

AX7 · Slice cohesion10.0 / 10Exemplary✓ Tool-verified

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.

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.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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:36

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.
M1 · Documentation (README)7.8 / 10Strong✓ Tool-verified

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

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add a README to the 34 of 44 project(s) that lack one — worth up to 1.5 pts.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy7.0 / 10Strong◐ Sampled · advisory

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.

  • README omits the admin-web project (buzz-admin-web) — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
  • omits the hosted relay deployment guide — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.

What to do

  • Reconcile the README with reality: README omits the admin-web project (buzz-admin-web); omits the hosted relay deployment guide.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

P2 · Observability9.1 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 19/27 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.
P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

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.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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.

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).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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. — desktop/src-tauri/src/app_state.rs:182

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.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

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.

PF3 · Async & latency hygiene7.0 / 10Strong✓ Tool-verified

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) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `load` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — desktop/test-loader-hooks.mjs:143

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.
R1 · Type Safety7.3 / 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.
R10 · Code Duplication9.0 / 10Exemplary✓ Tool-verified

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.

  • 281 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) — 140 of them are reported below, and 141 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 281 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 281 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 281 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
  • 109 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 54 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 109 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 109 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 109 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:69 · 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:69
  • desktop/src/features/agents/ui/AgentsView.tsx:325 · desktop/src/features/agents/ui/AgentsView.tsx:550 — 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:115 · desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:127 — the two spans are one implementation copied and then locally edited — 528 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:115
  • 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:150 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:198 — the two spans are one implementation copied and then locally edited — 511 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:150
  • 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/communities/ui/HostedCommunityCreateFlow.tsx:45 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:84 — the two spans are one implementation copied and then locally edited — 579 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:45
  • 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/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:24 — 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
  • desktop/src/features/projects/ui/AddProjectRepositoryDialog.tsx:148 · desktop/src/features/projects/ui/CreateProjectWorkItemDialog.tsx:156 — the two spans are one implementation copied and then locally edited — 236 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/AddProjectRepositoryDialog.tsx:148
  • desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs:120 · desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs:307 — the two spans are one implementation copied and then locally edited — 325 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/adminConsolePanelFeedback.jsdom-test.mjs:120

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.
R11 · Import Boundaries0.0 / 10Critical✓ Tool-verified

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/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/AdminConsoleStaffingTab.tsx:24 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules. — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:24
  • 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:59 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules. — desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:59
  • 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
  • desktop/src/features/agents/ui/AgentSessionToolItem/ToolItem.tsx:3 imports desktop/src/features/profile/lib/identity.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AgentSessionToolItem/ToolItem.tsx:3
  • desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:14 imports desktop/src/features/messages/ui/useAnchoredScroll.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx:14
  • desktop/src/features/agents/ui/AgentsScreen.tsx:3 imports desktop/src/app/navigation/useAppNavigation.ts against the feature-sliced rules. — desktop/src/features/agents/ui/AgentsScreen.tsx:3

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 (1095 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).
R2 · Cyclomatic Complexity8.0 / 10Strong✓ Tool-verified

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 651 and cognitive complexity 547; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:12010
  • 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:10879
  • 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:104
  • 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:124
  • 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.
R3 · Large Files5.3 / 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.

  • 215 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: desktop/src/testing/e2eBridge.ts (14643), desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs (2539), desktop/src/shared/ui/VideoPlayer.tsx (2094), desktop/src/shared/ui/markdown.tsx (1751), desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs (1512), desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs (1434) (+209 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.6 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
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.

R7 · Dead Code7.3 / 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.

  • 10 file(s) (~1323 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
  • Unreachable from the 87 application, 32 tooling and 911 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 (87 application, 32 tooling, 911 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 (×35) — desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs, …
  • no import path from any entry point (87 application, 32 tooling, 911 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 (87 application, 32 tooling, 911 test roots considered), but 4 in-repo import(s) from 4 other file(s) do name it (desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs and 1 more) — 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/admin-console/adminConsolePanelTestHelpers.jsdom.mjs
  • no import path from any entry point (87 application, 32 tooling, 911 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

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene9.5 / 10Exemplary✓ Tool-verified

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.
R9 · Circular Imports1.7 / 10Critical✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

  • desktop/src/features/agents/activeAgentTurnsStore.ts → desktop/src/features/agents/observerRelayStore.ts → desktop/src/features/agents/hooks.ts → desktop/src/features/agents/managedAgentRuntimeHooks.ts → desktop/src/features/agents/activeAgentTurnsStore.ts (one verified cycle inside a mutually-dependent group of 8 files) — desktop/src/features/agents/activeAgentTurnsStore.ts
  • desktop/src/features/huddle/components/HuddleBar.tsx → desktop/src/features/huddle/components/ParticipantList.tsx → desktop/src/features/profile/ui/UserProfilePopover.tsx → desktop/src/features/profile/ui/useProfileInteractionActions.ts → desktop/src/features/huddle/index.ts → desktop/src/features/huddle/components/HuddleBar.tsx (one verified cycle inside a mutually-dependent group of 6 files) — desktop/src/features/huddle/components/HuddleBar.tsx
  • 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) — desktop/src/shared/api/editMessage.ts
  • desktop/src/shared/hooks/use-mobile.tsx → desktop/src/shared/layout/AuxiliaryPanel/index.ts → desktop/src/shared/layout/AuxiliaryPanelShell.tsx → desktop/src/shared/hooks/use-mobile.tsx — desktop/src/shared/hooks/use-mobile.tsx

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

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. Deterministic.

  • No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — 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.

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).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

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.

LensScoreRatingImpact
Code Health67%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture52%Adequate — gated by R11, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity71%StrongStrongest area.
Readiness52%Adequate — gated by D13, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security76%Adequate — gated by D29, D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility54%Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance70%StrongSolid.
Unscored — 1 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.

  • 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 — 65 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — 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
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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
  • 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) — prometheus Pulling postgres Error Get "https://registry-1.docker.io/v2/": Forbidden adminer Error Get "https://registry-1.docker.io/v2/": Forbidden redis Error context canceled keycloak Error context canceled minio Error context canceled minio-init Error context canceled prometheus Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: adminer Pulling redis Pulling redis Error Get "https://registry-1.docker.io/v2/": Forbidden keycloak Error context canceled adminer Error context canceled prometheus Error context canceled minio Error context canceled minio-init Error context canceled postgres Error Get "https://registry-1.docker.io/v2/": Forbidden 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 — Dependency Hygiene incomplete (time budget)
  • D14 License Compliance — Not scored — this repository's 1018 shipped crate(s) were read from its REDACTED, but crates.io could not be asked for the licence of 54 of them (HTTP 429 Unknown Error), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
  • 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.
  • 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. 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 — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — too few calls resolved to assess navigability
  • D32 Data Compliance (PII/GDPR) — 29 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.
  • D6 Cohesion (LCOM4) — D6 reads a CS/VB/GO/SCALA/SWIFT/DART/JAVA/PY/KT/TS/TSX/MTS/CTS/JS/JSX/MJS/CJS/PHP class graph only — this repository's production source is .h, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — admin-web/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 2 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 88 value object(s)
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and 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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That 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# syntax, and none was loaded for this repository. 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
  • P10 Library API & versioning — 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
  • PF1 Benchmark discipline — 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
  • PF2 Allocation hygiene — 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
  • 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.
  • X1 Async correctness — 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
  • X10 Duplicated predicate — 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
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — 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
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — 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
  • X7 Silent fallback defaults — 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

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 60 finding(s)
AC2 · Forms & labels · <input> without a programmatic label · ×11
  • <input> without a programmatic label desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:488 — 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:608 — 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:657 — 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:666 — 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.
D13 · REDACTED Scanning · Leaked secret · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×4
  • 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/features/sidebar/ui/SidebarProfileCard.tsx:104 — 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.
D30 · Dependency Vulnerabilities · High CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
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 · 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.
D31 · IaC & Container Security · High IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
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}.
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.
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:36 — `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.
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (4 files) · ×1
  • Import cycle (4 files) desktop/src/features/agents/activeAgentTurnsStore.ts — desktop/src/features/agents/activeAgentTurnsStore.ts → desktop/src/features/agents/observerRelayStore.ts → desktop/src/features/agents/hooks.ts → desktop/src/features/agents/managedAgentRuntimeHooks.ts → desktop/src/features/agents/activeAgentTurnsStore.ts (one verified cycle inside a mutually-dependent group of 8 files)
R9 · Circular Imports · Import cycle (5 files) · ×1
  • Import cycle (5 files) desktop/src/features/huddle/components/HuddleBar.tsx — desktop/src/features/huddle/components/HuddleBar.tsx → desktop/src/features/huddle/components/ParticipantList.tsx → desktop/src/features/profile/ui/UserProfilePopover.tsx → desktop/src/features/profile/ui/useProfileInteractionActions.ts → desktop/src/features/huddle/index.ts → desktop/src/features/huddle/components/HuddleBar.tsx (one verified cycle inside a mutually-dependent group of 6 files)
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) desktop/src/shared/api/editMessage.ts — 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)
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) desktop/src/shared/hooks/use-mobile.tsx — desktop/src/shared/hooks/use-mobile.tsx → desktop/src/shared/layout/AuxiliaryPanel/index.ts → desktop/src/shared/layout/AuxiliaryPanelShell.tsx → desktop/src/shared/hooks/use-mobile.tsx
Serious — 3968 finding(s)
D3 · God Classes · FunctionTooLong · ×479
  • FunctionTooLong: buzz_acp::run_harness crates/buzz-acp/src/lib.rs:2575 — FunctionTooLong — buzz_acp::run_harness runs 903 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 803 over it, 9.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AgentInstanceEditDialog.AgentInstanceEditDialog desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:100 — FunctionTooLong — AgentInstanceEditDialog runs 838 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 738 over it, 8.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChannelScreen.ChannelScreen desktop/src/features/channels/ui/ChannelScreen.tsx:90 — FunctionTooLong — ChannelScreen 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: 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: buzz_acp::pool::run_prompt_task crates/buzz-acp/src/pool.rs:2323 — FunctionTooLong — buzz_acp::pool::run_prompt_task runs 813 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 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: 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: 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: useMentionSendFlow.useMentionSendFlow desktop/src/features/messages/ui/useMentionSendFlow.ts:51 — FunctionTooLong — useMentionSendFlow runs 746 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 646 over it, 7.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AppShell.AppShell desktop/src/app/AppShell.tsx:110 — FunctionTooLong — AppShell runs 740 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 640 over it, 7.40× 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:124 — FunctionTooLong — AgentDefinitionDialog runs 737 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 637 over it, 7.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: UserProfilePanel.UserProfilePanel desktop/src/features/profile/ui/UserProfilePanel.tsx:104 — FunctionTooLong — UserProfilePanel 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: AppSidebar.AppSidebar desktop/src/features/sidebar/ui/AppSidebar.tsx:80 — FunctionTooLong — AppSidebar runs 728 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 628 over it, 7.28× 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: buzz_relay::handlers::ingest::ingest_event_inner crates/buzz-relay/src/handlers/ingest.rs:2252 — FunctionTooLong — buzz_relay::handlers::ingest::ingest_event_inner runs 697 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 597 over it, 6.97× 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:118 — FunctionTooLong — buzz_relay::run_relay_main runs 694 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 594 over it, 6.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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 644 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 544 over it, 6.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: WorkflowDialog.WorkflowDialog desktop/src/features/workflows/ui/WorkflowDialog.tsx:216 — FunctionTooLong — WorkflowDialog runs 639 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 539 over it, 6.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: markdown.ImageZoomOverlay desktop/src/shared/ui/markdown.tsx:149 — FunctionTooLong — ImageZoomOverlay runs 639 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 539 over it, 6.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 454 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×371
  • Hotspot: desktop/src/testing/e2eBridge.ts desktop/src/testing/e2eBridge.ts:11397 — desktop/src/testing/e2eBridge.ts changed 225 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 592 in e2eBridge.maybeInstallE2eTauriMocks at line 11397. 80 of those changes were fix/bug commits, and the other 145 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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:2575 — crates/buzz-acp/src/lib.rs changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 169 in buzz_acp::run_harness at line 2575. 24 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/channels/ui/ChannelPane.tsx desktop/src/features/channels/ui/ChannelPane.tsx:78 — desktop/src/features/channels/ui/ChannelPane.tsx changed 57 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in ChannelPane.ChannelPane at line 78. 24 of those changes were fix/bug commits, and the other 33 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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/handlers/ingest.rs crates/buzz-relay/src/handlers/ingest.rs:2252 — crates/buzz-relay/src/handlers/ingest.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 149 in buzz_relay::handlers::ingest::ingest_event_inner at line 2252. 6 of those changes were fix/bug commits, and the other 32 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src-tauri/src/lib.rs desktop/src-tauri/src/lib.rs:101 — desktop/src-tauri/src/lib.rs changed 117 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in buzz_desktop::run at line 101. 34 of those changes were fix/bug commits, and the other 83 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/agents/ui/AgentDefinitionDialog.tsx desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:124 — desktop/src/features/agents/ui/AgentDefinitionDialog.tsx changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in AgentDefinitionDialog.AgentDefinitionDialog at line 124. 8 of those changes were fix/bug commits, and the other 28 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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.
  • Hotspot: mobile/lib/features/channels/thread_detail_page.dart mobile/lib/features/channels/thread_detail_page.dart:93 — mobile/lib/features/channels/thread_detail_page.dart changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in ThreadDetailPage.build at line 93. 13 of those changes were fix/bug commits, and the other 18 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/messages/ui/MessageComposer.tsx desktop/src/features/messages/ui/MessageComposer.tsx:70 — desktop/src/features/messages/ui/MessageComposer.tsx changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in MessageComposer.MessageComposerImpl at line 70. 19 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/profile/ui/UserProfilePanel.tsx desktop/src/features/profile/ui/UserProfilePanel.tsx:104 — desktop/src/features/profile/ui/UserProfilePanel.tsx changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 147 in UserProfilePanel.UserProfilePanel at line 104. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/shared/ui/markdown.tsx desktop/src/shared/ui/markdown.tsx:149 — desktop/src/shared/ui/markdown.tsx changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in markdown.ImageZoomOverlay at line 149. 12 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/agents/ui/AgentConfigFields.tsx desktop/src/features/agents/ui/AgentConfigFields.tsx:212 — desktop/src/features/agents/ui/AgentConfigFields.tsx changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 170 in AgentConfigFields.AgentConfigFields at line 212. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/agents/ui/AgentConfigFields.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/agents/ui/AgentInstanceEditDialog.tsx desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:100 — desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in AgentInstanceEditDialog.AgentInstanceEditDialog at line 100. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/agents/ui/AgentInstanceEditDialog.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/main.rs crates/buzz-relay/src/main.rs:118 — crates/buzz-relay/src/main.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in buzz_relay::run_relay_main at line 118. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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/messages/ui/useMentionSendFlow.ts desktop/src/features/messages/ui/useMentionSendFlow.ts:51 — desktop/src/features/messages/ui/useMentionSendFlow.ts changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in useMentionSendFlow.useMentionSendFlow at line 51. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: mobile/lib/features/channels/channel_detail_page/message_list.dart mobile/lib/features/channels/channel_detail_page/message_list.dart:42 — mobile/lib/features/channels/channel_detail_page/message_list.dart changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 161 in _MessageList.build at line 42. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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-acp/src/pool.rs crates/buzz-acp/src/pool.rs:2323 — crates/buzz-acp/src/pool.rs changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in buzz_acp::pool::run_prompt_task at line 2323. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/messages/ui/MessageThreadPanel.tsx desktop/src/features/messages/ui/MessageThreadPanel.tsx:145 — desktop/src/features/messages/ui/MessageThreadPanel.tsx changed 34 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: mobile/lib/features/channels/channel_detail_page.dart mobile/lib/features/channels/channel_detail_page.dart:268 — mobile/lib/features/channels/channel_detail_page.dart changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in ChannelDetailPage.build at line 268. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/messages/ui/MessageRow.tsx desktop/src/features/messages/ui/MessageRow.tsx:72 — desktop/src/features/messages/ui/MessageRow.tsx changed 34 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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/app/AppShell.tsx desktop/src/app/AppShell.tsx:110 — desktop/src/app/AppShell.tsx changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/messages/lib/useMentions.ts desktop/src/features/messages/lib/useMentions.ts:76 — desktop/src/features/messages/lib/useMentions.ts changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in useMentions.useMentions at line 76. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/messages/lib/useMentions.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/agents/ui/AgentsView.tsx desktop/src/features/agents/ui/AgentsView.tsx:40 — desktop/src/features/agents/ui/AgentsView.tsx changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in AgentsView.AgentsView at line 40. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/agents/ui/AgentsView.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/ChannelScreen.tsx desktop/src/features/channels/ui/ChannelScreen.tsx:90 — desktop/src/features/channels/ui/ChannelScreen.tsx changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in ChannelScreen.ChannelScreen at line 90. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/channels/ui/ChannelScreen.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:1306 — crates/buzz-relay/src/api/bridge.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in buzz_relay::api::bridge::query_events_authed at line 1306. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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/onboarding/ui/CommunityOnboardingFlow.tsx desktop/src/features/onboarding/ui/CommunityOnboardingFlow.tsx:157 — desktop/src/features/onboarding/ui/CommunityOnboardingFlow.tsx changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in CommunityOnboardingFlow.CommunityOnboardingFlow at line 157. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/onboarding/ui/CommunityOnboardingFlow.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.
  • + 346 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×225
  • FileTooLong: src/lib.rs crates/buzz-acp/src/lib.rs — FileTooLong — 3236 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 69 free functions. The bar is 500 significant lines; this is 2736 over it, 6.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/pool.rs crates/buzz-acp/src/pool.rs — FileTooLong — 3033 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 65 free functions. The bar is 500 significant lines; this is 2533 over it, 6.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2427 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: DeletionStore (2 blocks, 678-2862). The bar is 500 significant lines; this is 1927 over it, 4.85× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/relay.rs crates/buzz-acp/src/relay.rs — FileTooLong — 2425 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 1925 over it, 4.85× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: handlers/side_effects.rs crates/buzz-relay/src/handlers/side_effects.rs — FileTooLong — 2289 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 65 free functions. The bar is 500 significant lines; this is 1789 over it, 4.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: handlers/ingest.rs crates/buzz-relay/src/handlers/ingest.rs — FileTooLong — 1996 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1496 over it, 3.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/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: api/bridge.rs crates/buzz-relay/src/api/bridge.rs — FileTooLong — 1763 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 47 free functions. The bar is 500 significant lines; this is 1263 over it, 3.53× 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 — 1491 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 991 over it, 2.98× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: store/event.rs crates/buzz-db/src/store/event.rs — FileTooLong — 1485 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 32 free functions. The bar is 500 significant lines; this is 985 over it, 2.97× 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: store/relay_admin_actions.rs crates/buzz-db/src/store/relay_admin_actions.rs — FileTooLong — 1417 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 917 over it, 2.83× 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 — 1379 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 879 over it, 2.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/main.rs crates/buzz-relay/src/main.rs — FileTooLong — 1290 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 790 over it, 2.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: src/lib.rs crates/buzz-cli/src/lib.rs — FileTooLong — 1273 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 773 over it, 2.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: commands/channels.rs crates/buzz-cli/src/commands/channels.rs — FileTooLong — 1209 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 709 over it, 2.42× 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 — 1160 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: AcpClient (3 blocks, 144-2370). The bar is 500 significant lines; this is 660 over it, 2.32× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/lib.rs crates/buzz-deletion/src/lib.rs — FileTooLong — 1154 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 654 over it, 2.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/queue.rs crates/buzz-acp/src/queue.rs — FileTooLong — 1144 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 644 over it, 2.29× 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 — 1133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 633 over it, 2.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: git/transport.rs crates/buzz-relay/src/api/git/transport.rs — FileTooLong — 1127 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 627 over it, 2.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: store/channel_members.rs crates/buzz-db/src/store/channel_members.rs — FileTooLong — 1101 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 601 over it, 2.20× 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/push.rs crates/buzz-db/src/store/push.rs — FileTooLong — 1095 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 595 over it, 2.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: src/pocket_april.rs crates/buzz-voice/src/pocket_april.rs — FileTooLong — 996 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 496 over it, 1.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: admin/mod.rs crates/buzz-relay/src/api/admin/mod.rs — FileTooLong — 995 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 495 over it, 1.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.
  • + 200 more in this group — see findings.md.
D2 · Cognitive Complexity · buzz_desktop · ×109
  • 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::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::commands::pairing::pairing_ws_task_inner (cognitive 98) desktop/src-tauri/src/commands/pairing.rs:298 — buzz_desktop::commands::pairing::pairing_ws_task_inner has cognitive complexity 98 (threshold 15). Drivers by points: if/else 21 (90 pts), match/switch 2 (7 pts), loops 1 (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • 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::pipeline::check_pipeline_hotstart (cognitive 59) desktop/src-tauri/src/huddle/pipeline.rs:38 — buzz_desktop::huddle::pipeline::check_pipeline_hotstart has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch (cognitive 57) desktop/src-tauri/src/managed_agents/restore.rs:95 — buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (45 pts), match/switch 3 (6 pts), loops 5, 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_desktop::huddle::start_huddle (cognitive 53) desktop/src-tauri/src/huddle/mod.rs:190 — 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::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::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::app_state::resolve_identity_with_store (cognitive 42) desktop/src-tauri/src/app_state.rs:382 — 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::commands::agents::create_managed_agent (cognitive 42) desktop/src-tauri/src/commands/agents.rs:341 — buzz_desktop::commands::agents::create_managed_agent has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (29 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::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::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::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::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::commands::agent_models::normalize_agent_models (cognitive 39) desktop/src-tauri/src/commands/agent_models.rs:710 — buzz_desktop::commands::agent_models::normalize_agent_models has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 3 (9 pts) (nesting depth added 27). 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.
  • + 84 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×93
  • MethodTooLong: ComposeBar.build mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:33 — MethodTooLong — build 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.
  • MethodTooLong: NativeAttachmentPopoverViewController.makeMenuView mobile/ios/Runner/NativeAttachmentPopover.swift:6 — MethodTooLong — makeMenuView runs 723 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 623 over it, 7.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: _MessageList.build mobile/lib/features/channels/channel_detail_page/message_list.dart:42 — MethodTooLong — build runs 688 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 588 over it, 6.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.
  • MethodTooLong: ThreadDetailPage.build mobile/lib/features/channels/thread_detail_page.dart:93 — MethodTooLong — build runs 658 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 558 over it, 6.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Config.from_env crates/buzz-relay/src/config.rs:605 — MethodTooLong — from_env runs 546 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 446 over it, 5.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AnimatedAvatarCapture.build mobile/lib/features/profile/animated_avatar_capture.dart:64 — MethodTooLong — build runs 475 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 375 over it, 4.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChannelDetailPage.build mobile/lib/features/channels/channel_detail_page.dart:268 — 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: ChannelDetailsPage.build mobile/lib/features/channels/channel_details_page.dart:41 — MethodTooLong — build runs 431 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 331 over it, 4.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.
  • 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:124 — MethodTooLong — build runs 363 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 263 over it, 3.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: MediaImageViewerPage.build mobile/lib/features/channels/media_viewer_page.dart:195 — MethodTooLong — build runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.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.
  • 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: ActivityPage.build mobile/lib/features/activity/activity_page.dart:72 — MethodTooLong — build runs 283 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 183 over it, 2.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.
  • MethodTooLong: _NewDirectMessageSheet.build mobile/lib/features/channels/channels_page/sheets.dart:441 — MethodTooLong — build runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 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: SearchPage.build mobile/lib/features/search/search_page.dart:105 — MethodTooLong — build runs 234 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 134 over it, 2.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MediaVideoViewerPage.build mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19 — MethodTooLong — build runs 230 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChannelActionsSheet.build mobile/lib/features/channels/channel_actions_sheet.dart:78 — MethodTooLong — build runs 227 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _SliverChannelsList.build mobile/lib/features/channels/channels_page/body.dart:102 — MethodTooLong — build runs 218 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AcpClient.read_until_response_with_idle_timeout crates/buzz-acp/src/acp.rs:1371 — MethodTooLong — read_until_response_with_idle_timeout runs 215 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 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _InboxRow.build mobile/lib/features/activity/activity_page/inbox_row.dart:68 — MethodTooLong — build runs 215 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _MessageBubble.build mobile/lib/features/channels/channel_detail_page/message_bubble.dart:30 — MethodTooLong — build runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ThreadMessage.build mobile/lib/features/channels/thread_detail_page/thread_message.dart:35 — MethodTooLong — build runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: GitStore.run_conformance_probe crates/buzz-relay/src/api/git/store.rs:576 — MethodTooLong — run_conformance_probe runs 209 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 109 over it, 2.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.
  • + 68 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×75
  • ClassTooLong: DeletionStore REDACTED:678 — ClassTooLong — 1628 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 2 blocks, lines 678-2862. The bar is 400 significant lines; this is 1228 over it, 4.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.
  • ClassTooLong: AcpClient crates/buzz-acp/src/acp.rs:144 — ClassTooLong — 880 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 144-2370. The bar is 400 significant lines; this is 480 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentInstanceEditDialog desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:1 — ClassTooLong — 838 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 438 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.
  • 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: 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 — 817 significant lines (blank, comment-only and punctuation-only lines excluded), 1 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: 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: ComposeBar mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:3 — ClassTooLong — 768 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 368 over it, 1.92× 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: useMentionSendFlow desktop/src/features/messages/ui/useMentionSendFlow.ts:1 — ClassTooLong — 746 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 346 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: AppShell desktop/src/app/AppShell.tsx:1 — ClassTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 340 over it, 1.85× 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 — 737 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 337 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 — 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: AppSidebar desktop/src/features/sidebar/ui/AppSidebar.tsx:1 — ClassTooLong — 728 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 328 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _MessageList mobile/lib/features/channels/channel_detail_page/message_list.dart:3 — ClassTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 324 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), 1 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: ChannelMessagesNotifier mobile/lib/features/channels/channel_messages_provider.dart:24 — ClassTooLong — 685 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 285 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.
  • 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.
  • ClassTooLong: ThreadDetailPage mobile/lib/features/channels/thread_detail_page.dart:64 — ClassTooLong — 678 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 278 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 50 more in this group — see findings.md.
D2 · Cognitive Complexity · buzz_relay · ×62
  • buzz_relay::handlers::ingest::ingest_event_inner (cognitive 212) crates/buzz-relay/src/handlers/ingest.rs:2252 — buzz_relay::handlers::ingest::ingest_event_inner has cognitive complexity 212 (threshold 15). Drivers by points: if/else 109 (160 pts), match/switch 18 (34 pts), boolean chains 18 (nesting depth added 67). To reduce it, split the body into named stages: move each independent 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 139) crates/buzz-relay/src/main.rs:118 — buzz_relay::run_relay_main has cognitive complexity 139 (threshold 15). Drivers by points: if/else 49 (76 pts), match/switch 24 (46 pts), loops 11 (15 pts), boolean chains 2 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buzz_relay::api::bridge::query_events_authed (cognitive 137) crates/buzz-relay/src/api/bridge.rs:1306 — buzz_relay::api::bridge::query_events_authed has cognitive complexity 137 (threshold 15). Drivers by points: if/else 42 (93 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 113) crates/buzz-relay/src/handlers/side_effects.rs:445 — buzz_relay::handlers::side_effects::validate_admin_event has cognitive complexity 113 (threshold 15). Drivers by points: if/else 28 (61 pts), match/switch 13 (39 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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 109) crates/buzz-relay/src/handlers/count.rs:18 — buzz_relay::handlers::count::handle_count has cognitive complexity 109 (threshold 15). Drivers by points: if/else 22 (67 pts), match/switch 8 (21 pts), loops 4 (14 pts), boolean chains 7 (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_relay::handlers::req::handle_search_req (cognitive 88) crates/buzz-relay/src/handlers/req.rs:598 — buzz_relay::handlers::req::handle_search_req has cognitive complexity 88 (threshold 15). Drivers by points: if/else 19 (55 pts), match/switch 6 (20 pts), loops 4 (12 pts), boolean chains 1 (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::api::bridge::count_events_authed (cognitive 88) crates/buzz-relay/src/api/bridge.rs:1931 — buzz_relay::api::bridge::count_events_authed has cognitive complexity 88 (threshold 15). Drivers by points: if/else 18 (57 pts), match/switch 4 (13 pts), loops 3 (11 pts), boolean chains 7 (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::audio::handler::handle_active_audio_connection (cognitive 87) crates/buzz-relay/src/audio/handler.rs:170 — buzz_relay::audio::handler::handle_active_audio_connection has cognitive complexity 87 (threshold 15). Drivers by points: if/else 41 (62 pts), match/switch 15 (22 pts), boolean chains 2, 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.
  • buzz_relay::handlers::req::handle_req (cognitive 87) crates/buzz-relay/src/handlers/req.rs:52 — buzz_relay::handlers::req::handle_req has cognitive complexity 87 (threshold 15). Drivers by points: if/else 33 (61 pts), match/switch 6 (13 pts), loops 5 (10 pts), boolean chains 3 (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::api::bridge::thread_window::query (cognitive 59) crates/buzz-relay/src/api/bridge/thread_window.rs:121 — 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::relay_admin::execute_relay_admin_command (cognitive 59) crates/buzz-relay/src/handlers/relay_admin.rs:223 — buzz_relay::handlers::relay_admin::execute_relay_admin_command has cognitive complexity 59 (threshold 15). Drivers by points: if/else 27 (50 pts), boolean chains 6, match/switch 2 (3 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_relay::handlers::auth::handle_auth (cognitive 59) crates/buzz-relay/src/handlers/auth.rs:97 — buzz_relay::handlers::auth::handle_auth has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (44 pts), match/switch 6 (13 pts), boolean chains 2 (nesting depth added 33). 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::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::side_effects::handle_standard_deletion_event (cognitive 54) crates/buzz-relay/src/handlers/side_effects.rs:2365 — 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::handlers::report_resolution::drive_enforcement (cognitive 52) crates/buzz-relay/src/handlers/report_resolution.rs:380 — buzz_relay::handlers::report_resolution::drive_enforcement has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (37 pts), match/switch 4 (14 pts), loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent 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::emit_db_usage_metrics (cognitive 42) crates/buzz-relay/src/main.rs:1949 — 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:1048 — 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::handlers::ingest::validate_project_envelope (cognitive 37) crates/buzz-relay/src/handlers/ingest.rs:1681 — 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::workflow_sink::resolve_mention_pubkeys (cognitive 34) crates/buzz-relay/src/workflow_sink.rs:45 — buzz_relay::workflow_sink::resolve_mention_pubkeys has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 7 (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.
  • buzz_relay::handlers::ingest::effective_message_author (cognitive 33) crates/buzz-relay/src/handlers/ingest.rs:1177 — buzz_relay::handlers::ingest::effective_message_author has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 1 (2 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_relay::handlers::side_effects::handle_edit_metadata (cognitive 32) crates/buzz-relay/src/handlers/side_effects.rs:1568 — buzz_relay::handlers::side_effects::handle_edit_metadata has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (7 pts), loops 2 (6 pts), boolean chains 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_relay::api::bridge::handle_bridge_search (cognitive 31) crates/buzz-relay/src/api/bridge.rs:2214 — buzz_relay::api::bridge::handle_bridge_search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 3 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 37 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×56
  • Repeated repair: desktop/src-tauri/src/relay.rs desktop/src-tauri/src/relay.rs:285 — desktop/src-tauri/src/relay.rs changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is buzz_desktop::relay::relay_error_message at line 285), 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): keep managed agent avatars usable across communities (#7732)”; “fix(desktop): isolate quota backoff and reuse channel discovery rosters (#6998)”; “fix(desktop): bound thread /query and surface load errors, not false-empty (#6447)”; “fix(desktop): exclude archived agents from nest, order regeneration (#5905)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src-tauri/src/relay.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/profile/hooks.ts desktop/src/features/profile/hooks.ts:328 — desktop/src/features/profile/hooks.ts changed 13 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 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)”; “fix(desktop): refresh cached channel member names (#2258)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/shared/api/relayClientShared.ts desktop/src/shared/api/relayClientShared.ts:149 — desktop/src/shared/api/relayClientShared.ts changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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/mesh_llm/mod.rs desktop/src-tauri/src/mesh_llm/mod.rs:340 — desktop/src-tauri/src/mesh_llm/mod.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is DesktopMeshRuntime::start at line 340), 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): supervise and re-arm relay-mesh runtime (#2823)”; “fix(desktop): shared-compute usability — share toggle, usage indicator, model resync (#2448)”; “fix(mesh): dedupe models + retry throttled startup channel discovery (#2063)”; “fix(desktop): keep mesh allowlist on transient roster query failure (#2024)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src-tauri/src/mesh_llm/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: desktop/src-tauri/src/models.rs desktop/src-tauri/src/models.rs:366 — desktop/src-tauri/src/models.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is buzz_desktop::models::deserialize_null_string_as_empty at line 366), 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): emit singular `mention` feed category so alerts route correctly (#6665)”; “fix(desktop): remove 0.5.9+ perf regressions, speed up get_channels (#5599)”; “fix(desktop): make @mention clicks reliably open the profile panel (#1705)”; “fix(desktop): stop losing imported identity on every launch (#1568)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src-tauri/src/models.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: desktop/src/features/channels/ui/useChannelAgentSessions.ts desktop/src/features/channels/ui/useChannelAgentSessions.ts:113 — desktop/src/features/channels/ui/useChannelAgentSessions.ts changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 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)”; “fix(desktop): scope observer feed by channel and add session-boundary dividers (#1634)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: mobile/lib/features/channels/channel_sections/channel_sections_manager.dart mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:461 — mobile/lib/features/channels/channel_sections/channel_sections_manager.dart changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ChannelSectionsManager._publish at line 461), 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 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)”; “fix(mobile): retry channel-sections startup sync when relay rate-limits cold start (#3004)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/shared/api/relayClosedRecovery.ts desktop/src/shared/api/relayClosedRecovery.ts:26 — desktop/src/shared/api/relayClosedRecovery.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is relayClosedRecovery.handleRelayClosed at line 26), 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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-cli/src/commands/users.rs crates/buzz-cli/src/commands/users.rs:15 — crates/buzz-cli/src/commands/users.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is buzz_cli::commands::users::cmd_get_users at line 15), 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(cli): enrich template cardinality error with per-candidate presence and profile hints (#4825)”; “fix(cli): resolve agents from owner records (#3178)”; “Revert "fix(cli,relay): resolve agents by verified owner" (#3168)”; “fix(cli,relay): resolve agents by verified owner (#2615)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- crates/buzz-cli/src/commands/users.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/channels/ui/FocusThreadDrawer.tsx desktop/src/features/channels/ui/FocusThreadDrawer.tsx:186 — desktop/src/features/channels/ui/FocusThreadDrawer.tsx changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is FocusThreadDrawer.FocusThreadDrawer at line 186), 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): keep project sheets independent from threads (#6901)”; “fix(messages): route edits to the owning composer (#6575)”; “fix(desktop): isolate main timeline stacking context from focus drawer (#6398)”; “fix(desktop): refine focused thread dismissal targets (#2644)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/channels/ui/FocusThreadDrawer.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-tauri/src/commands/profile.rs desktop/src-tauri/src/commands/profile.rs:338 — desktop/src-tauri/src/commands/profile.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is buzz_desktop::commands::profile::get_presence at line 338), 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): derive agent availability from relay presence (#7127)”; “Fix avatar upload lifecycle edge cases (#2277)”; “fix: user search returns zero results for partially typed names (#1603)”; “fix(onboarding): guard against webkit2gtk WAL race with explicit profile-event signal (#1508)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src-tauri/src/commands/profile.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: desktop/src/features/home/hooks.ts desktop/src/features/home/hooks.ts:18 — desktop/src/features/home/hooks.ts changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/features/sidebar/lib/useChannelSections.ts desktop/src/features/sidebar/lib/useChannelSections.ts:36 — desktop/src/features/sidebar/lib/useChannelSections.ts 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 11 (its worst body is useChannelSections.useChannelSections at line 36), 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)”; “fix(sidebar): scope channel sections storage to relay URL (#1477)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/sidebar/lib/useChannelSections.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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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: desktop/src/shared/api/tauriArchive.ts desktop/src/shared/api/tauriArchive.ts:188 — desktop/src/shared/api/tauriArchive.ts 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 5 (its worst body is tauriArchive.decodeRawSubscription at line 188), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local-archive): default both archive settings to enabled (#4750)”; “fix(desktop): enforce observer archive policy reconciliation on internal builds (#1923)”; “fix(desktop): scope observer feed by channel and add session-boundary dividers (#1634)”; “fix(archive): atomic remove-kind path + split test modules (#1562)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/shared/api/tauriArchive.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 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 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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/shared/api/relayMembers.ts desktop/src/shared/api/relayMembers.ts:54 — desktop/src/shared/api/relayMembers.ts 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 9 (its worst body is relayMembers.relayMembersFromEvent at line 54), 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: expose community icon control on open relays (#2640)”; “fix: skip membership lookup for open relays (#2107)”; “fix: recover community access visibility (#2074)”; “fix(desktop): stop losing imported identity on every launch (#1568)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/shared/api/relayMembers.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 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 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)”; “fix(mobile): mitigate message-post delay with optimistic rendering (#3037)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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-tauri/src/nostr_convert.rs desktop/src-tauri/src/nostr_convert.rs:113 — desktop/src-tauri/src/nostr_convert.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 8 (its worst body is buzz_desktop::nostr_convert::channel_info_from_event 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): discover authenticated owned relay agents (#7122)”; “fix(desktop): enforce shared agent access across devices (#6086)”; “fix(desktop): make @mention clicks reliably open the profile panel (#1705)”; “fix(onboarding): guard against webkit2gtk WAL race with explicit profile-event signal (#1508)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src-tauri/src/nostr_convert.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/lib/timelineSnapshot.ts desktop/src/features/messages/lib/timelineSnapshot.ts:290 — desktop/src/features/messages/lib/timelineSnapshot.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 13 (its worst body is timelineSnapshot.classifyTimelineMessageDelta at line 290), 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): surface channel history load failures (#7013)”; “fix(desktop): bound thread /query and surface load errors, not false-empty (#6447)”; “fix(desktop): preserve fresh channel timelines (#5577)”; “fix(desktop): classify timeline prepends so history loads don't bump unread (#1416)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src/features/messages/lib/timelineSnapshot.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 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 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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-tauri/src/managed_agents/runtime/path.rs desktop/src-tauri/src/managed_agents/runtime/path.rs:104 — desktop/src-tauri/src/managed_agents/runtime/path.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 9 (its worst body is buzz_desktop::managed_agents::runtime::path::build_augmented_path at line 104), 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): surface install failures hidden by curl-pipe exit codes (#2892)”; “fix(desktop): fix Windows PATH clobber and .cmd shim EINVAL (#2563)”; “fix(desktop): make doctor installs retryable with per-runtime progress and auth status (#1765)”; “fix(desktop): use augmented PATH for readiness probes (#1613)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src-tauri/src/managed_agents/runtime/path.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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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-tauri/src/managed_agents/readiness/cli_probe.rs desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs:56 — desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is buzz_desktop::managed_agents::readiness::cli_probe::login_probe at line 56), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): use augmented PATH for model discovery subprocess (#2753)”; “fix(desktop): suppress Windows console flashes and reject WSL bash alias (#2587)”; “fix(desktop): make doctor installs retryable with per-runtime progress and auth status (#1765)”; “fix(desktop): surface codex config-parse failures and -32603 internal errors clearly (#1745)”. 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07:00' --full-history --no-merges -- desktop/src-tauri/src/managed_agents/readiness/cli_probe.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 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is 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-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 12:46:43 -07:00' --until='2026-09-28 12:46:43 -07: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.
  • + 31 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×46
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×46
  • 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-agent/src/llm.rs:1989 — crates/buzz-agent/src/llm.rs:1989-1994 | crates/buzz-agent/src/llm.rs:2428-2433 — both copies are in the same file, so extract the block into 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:1369-1374 — both copies are in the same file, so extract the block into 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-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/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-db/src/store/api_token.rs:228 — crates/buzz-db/src/store/api_token.rs:228-234 | crates/buzz-db/src/store/api_token.rs:540-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 (6 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:1690 — crates/buzz-db/src/store/relay_admin_actions.rs:1690-1695 | crates/buzz-db/src/store/relay_admin_actions.rs:1707-1712 — both copies are in the same file, so extract the block into 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:482 — crates/buzz-pairing-cli/src/main.rs:482-487 | desktop/src-tauri/src/commands/pairing.rs:751-756 — 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:1748 — crates/buzz-relay/src/api/bridge.rs:1748-1753 | crates/buzz-relay/src/handlers/req.rs:379-384 — 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 48 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:2491 — crates/buzz-relay/src/api/bridge.rs:2491-2496 | crates/buzz-relay/src/handlers/command_executor.rs:933-938 — 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:1375 — crates/buzz-relay/src/api/git/transport.rs:1375-1380 | crates/buzz-relay/src/api/git/transport.rs:1779-1784 — both copies are in the same file, so extract the block into 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/main.rs:692 — crates/buzz-relay/src/main.rs:692-697 | crates/buzz-relay/src/main.rs:1175-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 (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:413 — crates/buzz-sdk/src/builders.rs:413-418 | crates/buzz-sdk/src/builders.rs:484-489 — both copies are in the same file, so extract the block into 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/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 (6 lines × 2) desktop/src-tauri/src/secret_store.rs:321 — desktop/src-tauri/src/secret_store.rs:321-326 | desktop/src-tauri/src/secret_store.rs:413-418 — both copies are in the same file, so extract the block into 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/relay/profile_avatar.rs:112 — desktop/src-tauri/src/relay/profile_avatar.rs:112-117 | desktop/src-tauri/src/relay/profile_avatar.rs:144-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 (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) crates/buzz-acp/src/git.rs:278 — crates/buzz-acp/src/git.rs:278-283 | crates/buzz-dev-mcp/src/shim.rs:33-38 — 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.
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×44
  • Duplicated block (8 lines × 2) crates/buzz-acp/src/relay.rs:3369 — crates/buzz-acp/src/relay.rs:3369-3376 | crates/buzz-acp/src/relay.rs:3424-3431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/buzz-cli/src/commands/channels.rs:233 — crates/buzz-cli/src/commands/channels.rs:233-240 | crates/buzz-cli/src/commands/channels.rs:256-263 — both copies are in the same file, so extract the block into 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/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:2649-2656 — 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/audio/handler.rs:151 — crates/buzz-relay/src/audio/handler.rs:151-158 | crates/buzz-relay/src/connection.rs:269-276 — 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-relay/src/handlers/moderation_commands.rs:541 — crates/buzz-relay/src/handlers/moderation_commands.rs:541-548 | crates/buzz-relay/src/handlers/moderation_commands.rs:556-563 — both copies are in the same file, so extract the block into 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/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/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/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:421 — desktop/src-tauri/src/managed_agents/nest.rs:421-428 | desktop/src-tauri/src/managed_agents/nest.rs:470-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 (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) 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/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/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/agents.rs:151 — desktop/src-tauri/src/commands/agents.rs:151-158 | desktop/src-tauri/src/commands/agents.rs:966-973 — both copies are in the same file, so extract the block into 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:293 — desktop/src-tauri/src/commands/agents.rs:293-300 | desktop/src-tauri/src/commands/agents.rs:1015-1022 — both copies are in the same file, so extract the block into 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/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) crates/buzz-acp/src/config.rs:791 — crates/buzz-acp/src/config.rs:791-798 | desktop/src-tauri/src/managed_agents/discovery.rs:323-330 — 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:3434 — crates/buzz-acp/src/relay.rs:3434-3441 | crates/buzz-acp/src/relay.rs:3467-3476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 19 more in this group — see findings.md.
D1 · Cyclomatic Complexity · buzz_desktop · ×43
  • 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::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::managed_agents::restore::restore_managed_agents_on_launch (cyclomatic 33) desktop/src-tauri/src/managed_agents/restore.rs:95 — buzz_desktop::managed_agents::restore::restore_managed_agents_on_launch 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_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::commands::agents::create_managed_agent (cyclomatic 30) desktop/src-tauri/src/commands/agents.rs:341 — buzz_desktop::commands::agents::create_managed_agent 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::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::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::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::pipeline::check_pipeline_hotstart (cyclomatic 28) desktop/src-tauri/src/huddle/pipeline.rs:38 — buzz_desktop::huddle::pipeline::check_pipeline_hotstart 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_desktop::commands::pairing::pairing_ws_task_inner (cyclomatic 27) desktop/src-tauri/src/commands/pairing.rs:298 — buzz_desktop::commands::pairing::pairing_ws_task_inner 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_desktop::huddle::start_huddle (cyclomatic 25) desktop/src-tauri/src/huddle/mod.rs:190 — 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::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::commands::personas::inbound::reconcile_inbound_persona_event_blocking (cyclomatic 22) desktop/src-tauri/src/commands/personas/inbound.rs:148 — 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::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::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.
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×41
  • Duplicated block (7 lines × 2) crates/buzz-acp/src/relay.rs:487 — crates/buzz-acp/src/relay.rs:487-493 | crates/buzz-acp/src/relay.rs:500-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 (7 lines × 2) crates/buzz-acp/src/relay.rs:3745 — crates/buzz-acp/src/relay.rs:3745-3751 | 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-cli/src/commands/dms.rs:42 — crates/buzz-cli/src/commands/dms.rs:42-48 | crates/buzz-cli/src/commands/users.rs:480-486 — 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:82-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/buzz-db/src/store/channel.rs:460 — crates/buzz-db/src/store/channel.rs:460-466 | crates/buzz-db/src/store/dm.rs:493-499 — 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) REDACTED:2604 — REDACTED:2604-2610 | REDACTED:2673-2679 — both copies are in the same file, so extract the block into 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) REDACTED:2674 — REDACTED:2674-2680 | REDACTED:2739-2745 — both copies are in the same file, so extract the block into 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/event.rs:2227 — crates/buzz-db/src/store/event.rs:2227-2233 | crates/buzz-db/src/store/relay_members.rs:813-819 — 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/handlers/community_provisioning.rs:107 — crates/buzz-relay/src/handlers/community_provisioning.rs:107-117 | crates/buzz-relay/src/handlers/community_provisioning.rs:191-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 (7 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:1234 — crates/buzz-relay/src/handlers/ingest.rs:1234-1240 | crates/buzz-relay/src/handlers/ingest.rs:1315-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 (7 lines × 2) crates/buzz-relay/src/handlers/moderation_commands.rs:585 — crates/buzz-relay/src/handlers/moderation_commands.rs:585-591 | 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/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/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/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/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/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/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/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.
  • + 16 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs — 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/admin-console/adminConsolePanelStaffing.jsdom-test.mjs — 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/admin-console/adminConsolePanelSession.jsdom-test.mjs — 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/admin-console/adminConsolePanelFeedback.jsdom-test.mjs — 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/BestiePopover.tsx — 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 — 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 — 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 — 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/admin-console/adminConsolePanelTestHelpers.jsdom.mjs — 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 — 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 — 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/settings/ui/settingsNavModeration.jsdom-test.mjs — 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 — 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 — 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 — 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 — 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 — 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/moderation/lib/timeoutStore.jsdom-test.mjs — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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.
  • + 15 more in this group — see findings.md.
R11 · Import Boundaries · Boundary violation [fsd · ×37
  • Boundary violation [fsd:cross-slice] desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:11 — desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:11 imports desktop/src/features/forum/lib/time.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:18 — desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:18 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:33 — desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:33 imports desktop/src/features/settings/ui/SettingsSectionHeader.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:23 — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:23 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:24 — desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:24 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/admin-console/adminConsolePanel.test.mjs:461 — desktop/src/features/admin-console/adminConsolePanel.test.mjs:461 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:59 — desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs:59 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agent-memory/hooks.ts:4 — desktop/src/features/agent-memory/hooks.ts:4 imports desktop/src/features/agents/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/hooks.ts:14 — desktop/src/features/agents/hooks.ts:14 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/hooks.ts:18 — desktop/src/features/agents/hooks.ts:18 imports desktop/src/features/channels/channelMemberProfileCache.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/hooks.ts:19 — desktop/src/features/agents/hooks.ts:19 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:61 — desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:61 imports desktop/src/features/communities/useCommunities.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:68 — desktop/src/features/agents/lib/managedAgentDeletionAvailability.test.mjs:68 imports desktop/src/features/profile/ui/UserProfilePanelDeletion.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/lib/personaEditCaches.ts:3 — desktop/src/features/agents/lib/personaEditCaches.ts:3 imports desktop/src/features/profile/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/lib/useAgentAvailability.ts:3 — desktop/src/features/agents/lib/useAgentAvailability.ts:3 imports desktop/src/features/presence/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/managedAgentRuntimeHooks.ts:9 — desktop/src/features/agents/managedAgentRuntimeHooks.ts:9 imports desktop/src/features/communities/communityStorage.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/observerRelayStore.ts:14 — desktop/src/features/agents/observerRelayStore.ts:14 imports desktop/src/features/projects/projectChannelRequest.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:7 — desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:7 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AddCustomHarnessDialog.tsx:1 — desktop/src/features/agents/ui/AddCustomHarnessDialog.tsx:1 imports desktop/src/features/settings/ui/CustomHarnessForm.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:19 — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:19 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:20 — desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:20 imports desktop/src/features/profile/ui/ProfileAvatar.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:16 — desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:16 imports desktop/src/features/channels/hooks.ts against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AgentConfigFields.tsx:62 — desktop/src/features/agents/ui/AgentConfigFields.tsx:62 imports desktop/src/features/settings/ui/SettingsOptionGroup.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AgentCreationPreview.tsx:6 — desktop/src/features/agents/ui/AgentCreationPreview.tsx:6 imports desktop/src/features/profile/ui/MaskedAvatarBadgeFrame.tsx against the feature-sliced rules.
  • Boundary violation [fsd:cross-slice] desktop/src/features/agents/ui/AgentCreationPreview.tsx:7 — desktop/src/features/agents/ui/AgentCreationPreview.tsx:7 imports desktop/src/features/profile/ui/ProfileAvatar.tsx against the feature-sliced rules.
  • + 12 more in this group — see findings.md.
D1 · Cyclomatic Complexity · buzz_relay · ×36
  • buzz_relay::handlers::ingest::ingest_event_inner (cyclomatic 149) crates/buzz-relay/src/handlers/ingest.rs:2252 — buzz_relay::handlers::ingest::ingest_event_inner has cyclomatic complexity 149 (threshold 15). To reduce it, separate the cases: extract each independent 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 86) crates/buzz-relay/src/main.rs:118 — buzz_relay::run_relay_main 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.
  • buzz_relay::api::bridge::query_events_authed (cyclomatic 69) crates/buzz-relay/src/api/bridge.rs:1306 — buzz_relay::api::bridge::query_events_authed has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::audio::handler::handle_active_audio_connection (cyclomatic 57) crates/buzz-relay/src/audio/handler.rs:170 — buzz_relay::audio::handler::handle_active_audio_connection has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent 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 54) crates/buzz-relay/src/handlers/side_effects.rs:445 — buzz_relay::handlers::side_effects::validate_admin_event 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.
  • 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::req::handle_req (cyclomatic 43) crates/buzz-relay/src/handlers/req.rs:52 — buzz_relay::handlers::req::handle_req has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_relay::handlers::count::handle_count (cyclomatic 38) crates/buzz-relay/src/handlers/count.rs:18 — 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::relay_admin::execute_relay_admin_command (cyclomatic 37) crates/buzz-relay/src/handlers/relay_admin.rs:223 — buzz_relay::handlers::relay_admin::execute_relay_admin_command 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_relay::api::bridge::count_events_authed (cyclomatic 30) crates/buzz-relay/src/api/bridge.rs:1931 — buzz_relay::api::bridge::count_events_authed 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_relay::handlers::auth::handle_auth (cyclomatic 30) crates/buzz-relay/src/handlers/auth.rs:97 — buzz_relay::handlers::auth::handle_auth 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_relay::handlers::ingest::validate_project_envelope (cyclomatic 28) crates/buzz-relay/src/handlers/ingest.rs:1681 — 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::handlers::req::handle_search_req (cyclomatic 28) crates/buzz-relay/src/handlers/req.rs:598 — buzz_relay::handlers::req::handle_search_req 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:1949 — 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:382 — 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 23) crates/buzz-relay/src/handlers/report_resolution.rs:380 — buzz_relay::handlers::report_resolution::drive_enforcement 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_relay::handlers::event::handle_event (cyclomatic 22) crates/buzz-relay/src/handlers/event.rs:608 — buzz_relay::handlers::event::handle_event 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_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::api::bridge::thread_window::query (cyclomatic 20) crates/buzz-relay/src/api/bridge/thread_window.rs:121 — 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.
  • buzz_relay::connection::send_loop_inner (cyclomatic 19) crates/buzz-relay/src/connection.rs:595 — buzz_relay::connection::send_loop_inner 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_relay::api::bridge::handle_channel_window_filter (cyclomatic 19) crates/buzz-relay/src/api/bridge.rs:672 — buzz_relay::api::bridge::handle_channel_window_filter 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_relay::api::git::transport::finalize_push_inner (cyclomatic 18) crates/buzz-relay/src/api/git/transport.rs:1903 — buzz_relay::api::git::transport::finalize_push_inner 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_relay::workflow_sink::resolve_mention_pubkeys (cyclomatic 18) crates/buzz-relay/src/workflow_sink.rs:45 — buzz_relay::workflow_sink::resolve_mention_pubkeys 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.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×35
  • Duplicated block (10 lines × 2) crates/buzz-acp/src/queue.rs:2083 — crates/buzz-acp/src/queue.rs:2083-2092 | crates/buzz-acp/src/queue.rs:2126-2135 — both copies are in the same file, so extract the block into 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:3734 — crates/buzz-acp/src/relay.rs:3734-3743 | 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) REDACTED:2922 — REDACTED:2922-2931 | REDACTED:2939-2948 — both copies are in the same file, so extract the block into 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/event.rs:713 — crates/buzz-db/src/store/event.rs:713-722 | crates/buzz-db/src/store/event.rs:1347-1356 — both copies are in the same file, so extract the block into 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/handlers/identity_archive.rs:143 — crates/buzz-relay/src/handlers/identity_archive.rs:143-152 | crates/buzz-relay/src/handlers/relay_admin.rs:236-245 — 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:643 — crates/buzz-relay/src/handlers/ingest.rs:643-652 | crates/buzz-relay/src/handlers/side_effects.rs:2446-2455 — 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/handlers/ingest.rs:1244 — crates/buzz-relay/src/handlers/ingest.rs:1244-1253 | crates/buzz-relay/src/handlers/ingest.rs:1330-1339 — both copies are in the same file, so extract the block into 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-relay/src/protocol.rs:98 — crates/buzz-relay/src/protocol.rs:98-107 | crates/buzz-relay/src/protocol.rs:169-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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:969 — desktop/src-tauri/src/commands/admin/mod.rs:969-978 | desktop/src-tauri/src/commands/admin/mod.rs:1005-1014 — both copies are in the same file, so extract the block into 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:456 — desktop/src-tauri/src/huddle/pipeline.rs:456-465 | desktop/src-tauri/src/huddle/pipeline.rs:582-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 (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:909 — crates/buzz-agent/src/mcp.rs:909-918 | 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:3367-3376 — 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/allowlist.rs:76 — crates/buzz-db/src/store/allowlist.rs:76-87 | crates/buzz-db/src/store/relay_members.rs:155-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 (10 lines × 2) crates/buzz-sdk/src/builders.rs:989 — crates/buzz-sdk/src/builders.rs:989-998 | crates/buzz-sdk/src/builders.rs:1052-1063 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×34
  • Duplicated block (9 lines × 2) crates/buzz-acp/src/lib.rs:2885 — crates/buzz-acp/src/lib.rs:2885-2893 | crates/buzz-acp/src/lib.rs:2906-2914 — both copies are in the same file, so extract the block into 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:3556 — crates/buzz-acp/src/relay.rs:3556-3564 | crates/buzz-acp/src/relay.rs:3583-3591 — both copies are in the same file, so extract the block into 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:577 — crates/buzz-agent/src/llm.rs:577-585 | crates/buzz-agent/src/llm.rs:745-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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/api/bridge.rs:2246 — crates/buzz-relay/src/api/bridge.rs:2246-2254 | crates/buzz-relay/src/handlers/req.rs:634-648 — 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 48 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 (9 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:1018 — crates/buzz-relay/src/handlers/ingest.rs:1018-1026 | crates/buzz-relay/src/handlers/ingest.rs:1127-1135 — both copies are in the same file, so extract the block into 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:1520 — crates/buzz-relay/src/handlers/side_effects.rs:1520-1528 | crates/buzz-relay/src/handlers/side_effects.rs:2180-2188 — both copies are in the same file, so extract the block into 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:1658 — crates/buzz-relay/src/main.rs:1658-1666 | crates/buzz-relay/src/main.rs:1683-1691 — both copies are in the same file, so extract the block into 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:134 — crates/buzz-ws-client/src/connection.rs:134-142 | crates/buzz-ws-client/src/connection.rs:244-252 — both copies are in the same file, so extract the block into 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/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:324 — desktop/src-tauri/src/managed_agents/runtime_commands.rs:324-332 | 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 (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) crates/buzz-acp/src/relay.rs:2697 — crates/buzz-acp/src/relay.rs:2697-2708 | crates/buzz-acp/src/relay.rs:2871-2879 — both copies are in the same file, so extract the block into 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/protocol.rs:85 — crates/buzz-relay/src/protocol.rs:85-95 | crates/buzz-relay/src/protocol.rs:158-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×33
  • Duplicated block (5 lines × 2) crates/buzz-acp/src/relay.rs:3741 — crates/buzz-acp/src/relay.rs:3741-3745 | crates/buzz-acp/src/relay.rs:3769-3775 — both copies are in the same file, so extract the block into 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: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) 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:685 — crates/buzz-media/src/validation.rs:685-689 | crates/buzz-media/src/validation.rs:718-722 — both copies are in the same file, so extract the block into 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:815 — crates/buzz-relay/src/api/bridge.rs:815-819 | 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:375 — crates/buzz-relay/src/handlers/side_effects.rs:375-379 | crates/buzz-relay/src/handlers/side_effects.rs:2281-2285 — both copies are in the same file, so extract the block into 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/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:176 — desktop/src-tauri/src/managed_agents/nest.rs:176-182 | desktop/src-tauri/src/managed_agents/nest.rs:202-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 (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) crates/buzz-media/src/bucket_index.rs:75 — crates/buzz-media/src/bucket_index.rs:75-79 | crates/buzz-push-gateway/src/http.rs:70-74 — 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:631-637 — 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/commands/agent_models.rs:734 — desktop/src-tauri/src/commands/agent_models.rs:734-739 | desktop/src-tauri/src/commands/agent_models.rs:757-761 — both copies are in the same file, so extract the block into 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:371 — crates/buzz-cli/src/commands/channels.rs:371-375 | 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:781 — crates/buzz-cli/src/commands/channels.rs:781-785 | 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 (5 lines × 2) desktop/src-tauri/src/archive/store.rs:683 — desktop/src-tauri/src/archive/store.rs:683-687 | desktop/src-tauri/src/archive/store.rs:834-838 — both copies are in the same file, so extract the block into 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-core/src/engram.rs:504 — crates/buzz-core/src/engram.rs:504-508 | crates/buzz-core/src/engram.rs:523-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 8 more in this group — see findings.md.
D2 · Cognitive Complexity · buzz_acp · ×28
  • buzz_acp::run_harness (cognitive 395) crates/buzz-acp/src/lib.rs:2575 — buzz_acp::run_harness has cognitive complexity 395 (threshold 15). Drivers by points: if/else 104 (275 pts), loops 22 (57 pts), match/switch 22 (51 pts), boolean chains 12 (nesting depth added 235). 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:1736 — 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 140) crates/buzz-acp/src/pool.rs:2323 — buzz_acp::pool::run_prompt_task has cognitive complexity 140 (threshold 15). Drivers by points: if/else 45 (94 pts), match/switch 22 (41 pts), boolean chains 5 (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:2173 — 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 54) crates/buzz-acp/src/lib.rs:4655 — buzz_acp::handle_prompt_result has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (39 pts), match/switch 6 (11 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:1606 — 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:2669 — 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:1337 — 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:1548 — 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:5732 — 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:176 — 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:3203 — 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:1439 — 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:3073 — 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:1490 — 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:1993 — 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:2973 — 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::setup_mode::run_setup_listener (cognitive 24) crates/buzz-acp/src/setup_mode.rs:321 — buzz_acp::setup_mode::run_setup_listener has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 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_acp::pool::parse_nostr_thread_response_with_meta (cognitive 23) crates/buzz-acp/src/pool.rs:4629 — 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:2271 — 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::config::load_rules (cognitive 20) crates/buzz-acp/src/config.rs:1263 — 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::acp::build_codex_config_env (cognitive 18) crates/buzz-acp/src/acp.rs:274 — 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.
  • buzz_acp::run_relay_observer_publisher (cognitive 18) crates/buzz-acp/src/lib.rs:1136 — 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:4403 — 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.
  • + 3 more in this group — see findings.md.
D35 · Change Coupling · Change coupling · ×26
  • Change coupling: ChannelPane.types.ts ↔ ChannelScreen.tsx desktop/src/features/channels/ui/ChannelPane.types.ts — `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: ForumComposer.tsx ↔ MessageComposer.tsx desktop/src/features/forum/ui/ForumComposer.tsx — `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 — `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 — `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: mod.rs ↔ builders.rs crates/buzz-cli/src/commands/mod.rs — `crates/buzz-cli/src/commands/mod.rs` and `crates/buzz-sdk/src/builders.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `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: teams.rs ↔ types.ts desktop/src-tauri/src/managed_agents/teams.rs — `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 — `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 — `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: activity_page.dart ↔ thread_detail_page.dart mobile/lib/features/activity/activity_page.dart — `mobile/lib/features/activity/activity_page.dart` and `mobile/lib/features/channels/thread_detail_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 `93114c9c` Fix mobile Activity thread navigation (#5850); `69107dc3` Polish mobile message threads and composer (#5645); `06582ee6` Render mobile agent mention chips (#3702) — run `git show` on any of them.
  • Change coupling: HomeView.tsx ↔ InboxMessageRow.tsx desktop/src/features/home/ui/HomeView.tsx — `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: lib.rs ↔ mod.rs crates/buzz-db/src/lib.rs — `crates/buzz-db/src/lib.rs` and `crates/buzz-relay/src/api/mod.rs` 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 — 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 `2693e0db` Make workflow run history authoritative in Desktop (#5780); `e0f76b0e` feat(relay): add operator community provisioning (#1657); `8bfce097` feat: social notes MCP + CLI tools (kind:1/kind:3) (#268) (at that commit the files were still `crates/sprout-db/src/lib.rs` and `crates/sprout-relay/src/api/mod.rs`) — run `git show` on any of them.
  • Change coupling: InboxDetailPane.tsx ↔ InboxListPane.tsx desktop/src/features/home/ui/InboxDetailPane.tsx — `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 — `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: lib.rs ↔ router.rs crates/buzz-db/src/lib.rs — `crates/buzz-db/src/lib.rs` and `crates/buzz-relay/src/router.rs` change together 51% of the time (18 of the 35 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 18 shared commits counted here, the most recent 3 are `15d44dcc` Add owner deletion admission control plane (#7818); `c4c86006` feat(relay): deliver pubkey mentions to relay companions (#7793); `beb76406` feat(relay): add detailed readiness metrics (#7149) — run `git show` on any of them.
  • Change coupling: MessageThreadPanel.tsx ↔ TimelineMessageList.tsx desktop/src/features/messages/ui/MessageThreadPanel.tsx — `desktop/src/features/messages/ui/MessageThreadPanel.tsx` and `desktop/src/features/messages/ui/TimelineMessageList.tsx` change together 50% of the time (21 of the 42 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 21 shared commits counted here, the most recent 3 are `8e81afa4` fix(desktop): keep thread-open affordance in archived channels (#4012); `f48f3f05` Fix video reviews in thread replies (#3719); `095f3c72` fix(desktop): centralize known-agent trust set in useKnownAgentPubkey… — run `git show` on any of them.
  • Change coupling: formatTimelineMessages.ts ↔ MessageTimeline.tsx desktop/src/features/messages/lib/formatTimelineMessages.ts — `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: types.ts ↔ tauri.ts desktop/src/features/messages/types.ts — `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: auth.rs ↔ event.rs crates/buzz-relay/src/handlers/auth.rs — `crates/buzz-relay/src/handlers/auth.rs` and `crates/buzz-relay/src/handlers/event.rs` 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 `89120891` Add authenticated WebSocket recovery telemetry (#7546); `b9f54c43` relay: add author_type label to buzz_events_stored_total (#2243); `d52dedb0` Scope relay runtime state by community (#1658) — run `git show` on any of them.
  • Change coupling: hooks.ts ↔ OnboardingFlow.tsx desktop/src/features/onboarding/hooks.ts — `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 — `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: readStateManager.ts ↔ useUnreadChannels.ts desktop/src/features/channels/readState/readStateManager.ts — `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: AgentSessionTranscriptList.tsx ↔ AgentSessionThreadPanel.tsx desktop/src/features/agents/ui/AgentSessionTranscriptList.tsx — `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: MessageThreadPanel.tsx ↔ ViewLoadingFallback.tsx desktop/src/features/messages/ui/MessageThreadPanel.tsx — `desktop/src/features/messages/ui/MessageThreadPanel.tsx` and `desktop/src/shared/ui/ViewLoadingFallback.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `09254649` Polish desktop navigation chrome (#1238); `6b5cf325` Update navigation header height (#1212); `c30d7274` Refine app loading skeletons (#1001) — run `git show` on any of them.
  • Change coupling: AddTeamToChannelDialog.tsx ↔ AgentDefinitionDialog.tsx desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx — `desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx` and `desktop/src/features/agents/ui/AgentDefinitionDialog.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 5 shared commits counted here, the most recent 3 are `c19e0ce2` Add preferred runtime onboarding (#2040); `f3319dd1` fix(desktop): correct provider and model handling in agent config dia…; `4269fd27` Show all ACP runtimes with install status and one-click install (#724) (at that commit the file was still `desktop/src/features/agents/ui/PersonaDialog.tsx`) — run `git show` on any of them.
  • Change coupling: ChatHeader.tsx ↔ ViewLoadingFallback.tsx desktop/src/features/chat/ui/ChatHeader.tsx — `desktop/src/features/chat/ui/ChatHeader.tsx` and `desktop/src/shared/ui/ViewLoadingFallback.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `09254649` Polish desktop navigation chrome (#1238); `6b5cf325` Update navigation header height (#1212); `9e76a08a` fix(desktop): refine header scaling and shadow (#573) — run `git show` on any of them.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×25
  • Duplicated block (11 lines × 2) crates/buzz-admin/src/main.rs:323 — crates/buzz-admin/src/main.rs:323-333 | crates/buzz-admin/src/main.rs:361-371 — both copies are in the same file, so extract the block into 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:506 — crates/buzz-db/src/store/channel_members.rs:506-516 | crates/buzz-db/src/store/channel_members.rs:626-636 — both copies are in the same file, so extract the block into 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:1420 — crates/buzz-db/src/store/channel_members.rs:1420-1430 | crates/buzz-db/src/store/event.rs:1156-1166 — 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:299 — crates/buzz-pair-relay/src/lib.rs:299-309 | crates/buzz-pair-relay/src/lib.rs:583-593 — both copies are in the same file, so extract the block into 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/api/gifs.rs:155 — crates/buzz-relay/src/api/gifs.rs:155-165 | crates/buzz-relay/src/api/workflows.rs:87-97 — before extracting anything, compare `crates/buzz-relay/src/api/gifs.rs` and `crates/buzz-relay/src/api/workflows.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 (11 lines × 2) crates/buzz-relay/src/handlers/ingest.rs:613 — crates/buzz-relay/src/handlers/ingest.rs:613-623 | crates/buzz-relay/src/handlers/side_effects.rs:2495-2505 — 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/side_effects.rs:3255 — crates/buzz-relay/src/handlers/side_effects.rs:3255-3265 | crates/buzz-relay/src/handlers/side_effects.rs:3708-3718 — both copies are in the same file, so extract the block into 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-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:205 — crates/buzz-ws-client/src/connection.rs:205-215 | crates/buzz-ws-client/src/connection.rs:259-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) desktop/src-tauri/src/commands/agent_discovery.rs:591 — desktop/src-tauri/src/commands/agent_discovery.rs:591-601 | desktop/src-tauri/src/commands/global_agent_config.rs:326-336 — 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:118 — crates/buzz-db/src/store/allowlist.rs:118-128 | crates/buzz-db/src/store/channel_members.rs:1266-1285 — 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/channel_members.rs:1382 — crates/buzz-db/src/store/channel_members.rs:1382-1392 | crates/buzz-db/src/store/git_repo.rs:159-170 — 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/api/admin/mod.rs:917 — crates/buzz-relay/src/api/admin/mod.rs:917-927 | crates/buzz-relay/src/api/admin/mod.rs:1080-1090 — both copies are in the same file, so extract the block into 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/channels/message_actions/message_action_popover.dart:523 — mobile/lib/features/channels/message_actions/message_action_popover.dart:523-533 | mobile/lib/features/channels/message_actions/reaction_popover.dart:105-115 — 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) mobile/lib/features/forum/forum_post_card.dart:267 — mobile/lib/features/forum/forum_post_card.dart:267-277 | mobile/lib/features/forum/forum_thread_page.dart:570-580 — 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 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) mobile/lib/features/profile/profile_text_edit_sheet.dart:91 — mobile/lib/features/profile/profile_text_edit_sheet.dart:91-101 | mobile/lib/shared/widgets/buzz_sheet_header.dart:102-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:87 — mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:87-97 | mobile/lib/shared/widgets/frosted_scaffold.dart:78-88 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×23
  • Duplicated block (12 lines × 2) crates/buzz-acp/src/queue.rs:373 — crates/buzz-acp/src/queue.rs:373-384 | crates/buzz-acp/src/queue.rs:707-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/buzz-agent/src/llm.rs:2550 — crates/buzz-agent/src/llm.rs:2550-2561 | crates/buzz-agent/src/llm.rs:2574-2585 — both copies are in the same file, so extract the block into 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:629 — crates/buzz-db/src/store/channel.rs:629-640 | crates/buzz-db/src/store/channel.rs:654-665 — both copies are in the same file, so extract the block into 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/workflow.rs:646 — crates/buzz-db/src/store/workflow.rs:646-657 | crates/buzz-db/src/store/workflow.rs:705-717 — both copies are in the same file, so extract the block into 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/bridge.rs:1389 — crates/buzz-relay/src/api/bridge.rs:1389-1400 | crates/buzz-relay/src/api/bridge.rs:1981-1992 — both copies are in the same file, so extract the block into 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:1478-1489 — 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-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/commands/agent_discovery.rs:649 — desktop/src-tauri/src/commands/agent_discovery.rs:649-660 | desktop/src-tauri/src/commands/global_agent_config.rs:379-390 — 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: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/agents.rs:798 — desktop/src-tauri/src/commands/agents.rs:798-809 | desktop/src-tauri/src/commands/agents.rs:961-972 — both copies are in the same file, so extract the block into 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: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:519 — desktop/src-tauri/src/app_state.rs:519-530 | desktop/src-tauri/src/app_state.rs:603-616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/buzz-db/src/store/push.rs:1048 — crates/buzz-db/src/store/push.rs:1048-1059 | crates/buzz-db/src/store/push.rs:1075-1087 — both copies are in the same file, so extract the block into 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/operator.rs:347 — crates/buzz-relay/src/api/operator.rs:347-358 | crates/buzz-relay/src/api/operator.rs:481-492 — both copies are in the same file, so extract the block into 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:2038 — crates/buzz-agent/src/llm.rs:2038-2049 | crates/buzz-agent/src/llm.rs:2472-2483 — both copies are in the same file, so extract the block into 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) 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/banners.dart:66 — mobile/lib/features/channels/channel_detail_page/banners.dart:66-77 | mobile/lib/features/channels/channel_detail_page/banners.dart:162-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) mobile/lib/features/channels/channel_detail_page/message_list.dart:683 — mobile/lib/features/channels/channel_detail_page/message_list.dart:683-694 | mobile/lib/features/forum/forum_posts_view.dart:199-210 — 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:226 — mobile/lib/features/pairing/pairing_provider.dart:226-237 | mobile/lib/features/pairing/pairing_provider.dart:248-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×22
  • 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:5163 — crates/buzz-acp/src/lib.rs:5163-5175 | crates/buzz-acp/src/lib.rs:5404-5416 — both copies are in the same file, so extract the block into 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:1979 — crates/buzz-acp/src/relay.rs:1979-1991 | crates/buzz-acp/src/relay.rs:1999-2011 — both copies are in the same file, so extract the block into 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:4084 — crates/buzz-acp/src/relay.rs:4084-4096 | crates/buzz-acp/src/relay.rs:4162-4174 — both copies are in the same file, so extract the block into 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-admin/src/main.rs:734 — crates/buzz-admin/src/main.rs:734-746 | crates/buzz-relay/src/handlers/side_effects.rs:1259-1271 — 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-db/src/store/event.rs:659 — crates/buzz-db/src/store/event.rs:659-671 | crates/buzz-db/src/store/event.rs:909-921 — both copies are in the same file, so extract the block into 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:709 — crates/buzz-relay/src/api/admin/mod.rs:709-721 | crates/buzz-relay/src/api/admin/mod.rs:793-805 — both copies are in the same file, so extract the block into 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/bridge.rs:1315 — crates/buzz-relay/src/api/bridge.rs:1315-1327 | crates/buzz-relay/src/api/bridge.rs:1940-1952 — both copies are in the same file, so extract the block into 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/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/reaction.rs:184 — crates/buzz-db/src/store/reaction.rs:184-196 | crates/buzz-db/src/store/relay_invite.rs:232-246 — 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:1802 — crates/buzz-acp/src/lib.rs:1802-1814 | crates/buzz-acp/src/lib.rs:1894-1907 — both copies are in the same file, so extract the block into 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:2370 — REDACTED:2370-2382 | REDACTED:2437-2449 — both copies are in the same file, so extract the block into 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) crates/buzz-db/src/store/relay_members.rs:263 — crates/buzz-db/src/store/relay_members.rs:263-275 | crates/buzz-db/src/store/relay_members.rs:312-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/buzz-db/src/store/push.rs:1250 — crates/buzz-db/src/store/push.rs:1250-1262 | crates/buzz-db/src/store/push.rs:1301-1313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/buzz-db/src/store/push.rs:1226 — crates/buzz-db/src/store/push.rs:1226-1238 | crates/buzz-db/src/store/push.rs:1274-1286 — both copies are in the same file, so extract the block into 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:274 — mobile/lib/features/activity/activity_page.dart:274-286 | mobile/lib/features/activity/activity_page.dart:305-317 — both copies are in the same file, so extract the block into 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.dart:575 — mobile/lib/features/channels/channel_detail_page.dart:575-587 | mobile/lib/features/channels/thread_detail_page.dart:827-839 — 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) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:104 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:104-116 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:84-96 — 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 7 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:168 — mobile/lib/features/forum/forum_thread_page.dart:168-180 | mobile/lib/features/forum/forum_thread_page.dart:596-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.
D10 · Test Quality · No assertions · ×17
  • No assertions: ${row.name}: ${row.desc} desktop/src/features/admin-console/adminConsolePanel.test.mjs:1066 — 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: 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: 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: 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: 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: storage clear resets composed font size and keyboard zoom across windows desktop/tests/e2e/profile.spec.ts:2606 — 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: 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: switches the active community on click desktop/tests/e2e/community-rail.spec.ts:460 — 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: capture: add-community choices desktop/tests/e2e/add-community-screenshots.spec.ts:121 — 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:128 — 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:140 — 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.
D17 · Explicit Debt · TodoComment · ×17
  • 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.
  • 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-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-relay/src/main.rs:1562 — // 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 crates/buzz-relay/src/api/media.rs:306 — // 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-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-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 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-tauri/src/commands/global_agent_config.rs:305 — // 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/managed_agents/restore.rs:168 — // 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/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 mobile/lib/features/profile/presence_cache_provider.dart:43 — // TODO(presence): once the relay supports a `presence:true` filter — 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 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.
D31 · IaC & Container Security · Medium IaC · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×17
  • 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/channel.rs:676 — crates/buzz-db/src/store/channel.rs:676-689 | crates/buzz-db/src/store/channel.rs:719-732 — both copies are in the same file, so extract the block into 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) REDACTED:2553 — REDACTED:2553-2566 | REDACTED:2746-2760 — both copies are in the same file, so extract the block into 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/feed.rs:93 — crates/buzz-db/src/store/feed.rs:93-106 | crates/buzz-db/src/store/feed.rs:182-195 — both copies are in the same file, so extract the block into 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:2037 — crates/buzz-relay/src/api/bridge.rs:2037-2050 | crates/buzz-relay/src/handlers/count.rs:177-190 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/handlers/count.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 (14 lines × 2) crates/buzz-relay/src/main.rs:2056 — crates/buzz-relay/src/main.rs:2056-2069 | crates/buzz-relay/src/main.rs:2169-2182 — both copies are in the same file, so extract the block into 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) crates/buzz-relay/src/tunnel/directory.rs:308 — crates/buzz-relay/src/tunnel/directory.rs:308-321 | crates/buzz-relay/src/tunnel/directory.rs:353-366 — both copies are in the same file, so extract the block into 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/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/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) 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) crates/buzz-db/src/store/channel_members.rs:867 — crates/buzz-db/src/store/channel_members.rs:867-880 | crates/buzz-db/src/store/channel_members.rs:947-964 — both copies are in the same file, so extract the block into 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) REDACTED:145 — REDACTED:145-159 | REDACTED:248-261 — both copies are in the same file, so extract the block into 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:1199 — crates/buzz-db/src/store/event.rs:1199-1212 | crates/buzz-db/src/store/event.rs:1276-1289 — both copies are in the same file, so extract the block into 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.
D2 · Cognitive Complexity · buzz_agent · ×16
  • buzz_agent::llm::openrouter_post (cognitive 86) crates/buzz-agent/src/llm.rs:2258 — 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::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::llm::post (cognitive 58) crates/buzz-agent/src/llm.rs:1862 — 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::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:1011 — 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:2543 — 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:566 — 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:1368 — 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:862 — 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::llm::openai_body (cognitive 16) crates/buzz-agent/src/llm.rs:727 — 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:1456 — 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::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::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.
D1 · Cyclomatic Complexity · buzz_acp · ×14
  • buzz_acp::run_harness (cyclomatic 169) crates/buzz-acp/src/lib.rs:2575 — buzz_acp::run_harness has cyclomatic complexity 169 (threshold 15). To reduce it, separate the cases: extract each independent 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 71) crates/buzz-acp/src/pool.rs:2323 — buzz_acp::pool::run_prompt_task 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_acp::relay::run_background_task (cyclomatic 64) crates/buzz-acp/src/relay.rs:1736 — 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:2173 — 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 45) crates/buzz-acp/src/lib.rs:4655 — buzz_acp::handle_prompt_result 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_acp::queue::format_context_hints (cyclomatic 27) crates/buzz-acp/src/queue.rs:1606 — 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:1548 — 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:2669 — 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:4629 — 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:2973 — 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:3203 — 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.
  • buzz_acp::setup_mode::run_setup_listener (cyclomatic 16) crates/buzz-acp/src/setup_mode.rs:321 — buzz_acp::setup_mode::run_setup_listener 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×13
  • Duplicated block (15 lines × 2) crates/buzz-acp/src/pool.rs:3442 — crates/buzz-acp/src/pool.rs:3442-3456 | crates/buzz-acp/src/pool.rs:3471-3485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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:237 — crates/buzz-core/src/pairing/session.rs:237-251 | crates/buzz-core/src/pairing/session.rs:437-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:1464 — crates/buzz-relay/src/handlers/side_effects.rs:1464-1478 | crates/buzz-relay/src/handlers/side_effects.rs:2126-2140 — both copies are in the same file, so extract the block into 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:387 — crates/buzz-relay/src/push_runtime.rs:387-401 | crates/buzz-relay/src/push_runtime.rs:448-462 — both copies are in the same file, so extract the block into 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/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) 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/activity/activity_provider.dart:604 — mobile/lib/features/activity/activity_provider.dart:604-618 | mobile/lib/features/channels/channels_provider.dart:470-484 — 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/channel_detail_page/message_list.dart:561 — mobile/lib/features/channels/channel_detail_page/message_list.dart:561-575 | mobile/lib/features/channels/thread_detail_page.dart:787-801 — 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:844 — mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:844-858 | mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:929-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 (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.
D2 · Cognitive Complexity · buzz_db · ×12
  • buzz_db::store::event::query_events_on (cognitive 73) crates/buzz-db/src/store/event.rs:474 — buzz_db::store::event::query_events_on has cognitive complexity 73 (threshold 15). Drivers by points: if/else 37 (51 pts), loops 8 (20 pts), boolean chains 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_db::store::event::count_events_on (cognitive 59) crates/buzz-db/src/store/event.rs:782 — buzz_db::store::event::count_events_on has cognitive complexity 59 (threshold 15). Drivers by points: if/else 30 (42 pts), loops 6 (17 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::replaceable::replace_parameterized_event_in_transaction_impl (cognitive 39) crates/buzz-db/src/store/replaceable.rs:105 — buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 11, 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_db::store::channel_members::add_member (cognitive 30) crates/buzz-db/src/store/channel_members.rs:394 — buzz_db::store::channel_members::add_member has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 3 (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.
  • buzz_db::store::event::insert_event_with_thread_metadata_tx (cognitive 28) crates/buzz-db/src/store/event.rs:1381 — 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:3051 — 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:582 — 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:307 — 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 24) crates/buzz-db/src/store/push.rs:235 — buzz_db::store::push::accept_lease_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 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::update_channel (cognitive 21) crates/buzz-db/src/store/channel.rs:506 — buzz_db::store::channel::update_channel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 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.
  • buzz_db::store::push::enqueue_wakes (cognitive 17) crates/buzz-db/src/store/push.rs:664 — 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::relay_admin_actions::finalize_success (cognitive 17) crates/buzz-db/src/store/relay_admin_actions.rs:837 — buzz_db::store::relay_admin_actions::finalize_success has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/buzz-acp/src/relay.rs:1746 — crates/buzz-acp/src/relay.rs:1746-2166 | crates/buzz-acp/src/relay.rs:2183-2564 | crates/buzz-acp/src/relay.rs:2675-2785 | 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:151 — crates/buzz-db/src/store/api_token.rs:151-202 | crates/buzz-db/src/store/api_token.rs:215-269 | crates/buzz-db/src/store/api_token.rs:372-405 | crates/buzz-db/src/store/api_token.rs:528-559 — 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/api/bridge.rs:2660 — crates/buzz-relay/src/api/bridge.rs:2660-2723 | crates/buzz-relay/src/api/gifs.rs:127-177 | crates/buzz-relay/src/api/invites.rs:236-259 | crates/buzz-relay/src/api/workflows.rs:53-135 — 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:2258-3432 | crates/buzz-relay/src/handlers/moderation_commands.rs:96-134 | crates/buzz-relay/src/handlers/relay_admin.rs:227-484 — 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-92 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:28-96 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:31-100 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:28-92 — 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:371 — mobile/lib/shared/community/community_provider.dart:371-396 | mobile/lib/shared/community/community_provider.dart:461-498 | mobile/lib/shared/community/community_provider.dart:529-572 | mobile/lib/shared/community/community_provider.dart:574-589 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×12
  • Duplicated block (17 lines × 2) crates/buzz-acp/src/lib.rs:5627 — crates/buzz-acp/src/lib.rs:5627-5643 | crates/buzz-acp/src/lib.rs:5675-5691 — both copies are in the same file, so extract the block into 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) 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/channel_members.rs:950 — crates/buzz-db/src/store/channel_members.rs:950-966 | crates/buzz-db/src/store/channel_members.rs:980-1001 — both copies are in the same file, so extract the block into 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/community.rs:106 — crates/buzz-db/src/store/community.rs:106-124 | crates/buzz-db/src/store/community.rs:621-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) crates/buzz-db/src/store/relay_members.rs:503 — crates/buzz-db/src/store/relay_members.rs:503-519 | crates/buzz-db/src/store/relay_members.rs:715-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 (17 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:222 — crates/buzz-db/src/store/relay_admin_actions.rs:222-238 | crates/buzz-db/src/store/relay_admin_actions.rs:1210-1226 — both copies are in the same file, so extract the block into 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_detail_page/message_bubble.dart:149 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:149-165 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:144-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 7 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 (17 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:159 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:159-175 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:159-175 — `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 225 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×12
  • Duplicated block (16 lines × 2) crates/buzz-acp/src/config.rs:1397 — crates/buzz-acp/src/config.rs:1397-1412 | crates/buzz-acp/src/config.rs:1488-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 (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/handlers/event.rs:257 — crates/buzz-relay/src/handlers/event.rs:257-272 | crates/buzz-relay/src/handlers/event.rs:317-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 (16 lines × 2) crates/buzz-sdk/src/builders.rs:750 — crates/buzz-sdk/src/builders.rs:750-765 | 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:1680 — crates/buzz-sdk/src/builders.rs:1680-1695 | crates/buzz-sdk/src/builders.rs:1759-1774 — both copies are in the same file, so extract the block into 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:1085 — crates/buzz-db/src/store/event.rs:1085-1100 | crates/buzz-db/src/store/thread.rs:238-256 — 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_mutes/channel_mutes_manager.dart:120 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:120-135 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:120-135 — `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 225 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/channels_page/sections.dart:124 — mobile/lib/features/channels/channels_page/sections.dart:124-139 | mobile/lib/features/channels/channels_page/sections.dart:527-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×12
  • Duplicated block (6 lines × 3) crates/buzz-cli/src/client.rs:1437 — crates/buzz-cli/src/client.rs:1437-1443 | crates/buzz-cli/src/client.rs:1458-1464 | crates/buzz-cli/src/commands/channels.rs:639-644 — 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:872 — crates/buzz-relay/src/connection.rs:872-879 | crates/buzz-relay/src/connection.rs:907-912 | crates/buzz-relay/src/connection.rs:929-934 — 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:437 — crates/buzz-relay/src/handlers/command_executor.rs:437-442 | crates/buzz-relay/src/handlers/command_executor.rs:574-579 | crates/buzz-relay/src/handlers/command_executor.rs:647-652 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (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:2683-2688 | crates/buzz-relay/src/handlers/relay_admin.rs:235-240 — 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:1230 — crates/buzz-sdk/src/builders.rs:1230-1235 | crates/buzz-sdk/src/builders.rs:1683-1688 | crates/buzz-sdk/src/builders.rs:1762-1767 — 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:2483 — crates/buzz-acp/src/lib.rs:2483-2490 | crates/buzz-acp/src/lib.rs:2495-2500 | crates/buzz-acp/src/lib.rs:2505-2510 — 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/config.rs:701 — crates/buzz-relay/src/config.rs:701-707 | crates/buzz-relay/src/config.rs:898-904 | crates/buzz-relay/src/main.rs:619-624 — 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) 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:488 — crates/buzz-acp/src/relay.rs:488-493 | crates/buzz-acp/src/relay.rs:501-506 | crates/buzz-acp/src/relay.rs:559-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 (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.
D5 · Coupling · Off the main sequence · ×12
  • 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.
D3 · God Classes · TooManyMethods · ×11
  • TooManyMethods: Db crates/buzz-db/src/runtime/mod.rs:126 — TooManyMethods — 320 methods, declared across 33 files: store/workflow.rs (28), store/event.rs (27), runtime/mod.rs (26), store/relay_admin_actions.rs (23), +29 more file(s). The bar is 30 methods; this is 290 over it, 10.67× 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: RelaySessionNotifier mobile/lib/shared/relay/relay_session.dart:75 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: DeletionStore REDACTED:678 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× 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:24 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AcpClient crates/buzz-acp/src/acp.rs:144 — 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. 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: PairingNotifier mobile/lib/features/pairing/pairing_provider.dart:94 — 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:137 — 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: 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: MediaUploadService mobile/lib/shared/relay/media_upload.dart:237 — 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×11
  • Duplicated block (19 lines × 2) crates/buzz-acp/src/lib.rs:4921 — crates/buzz-acp/src/lib.rs:4921-4939 | crates/buzz-acp/src/lib.rs:4961-4979 — both copies are in the same file, so extract the block into 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-cli/src/commands/feed.rs:9 — crates/buzz-cli/src/commands/feed.rs:9-27 | crates/buzz-cli/src/commands/messages.rs:336-354 — 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 (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:453 — crates/buzz-relay/src/handlers/command_executor.rs:453-471 | crates/buzz-relay/src/handlers/command_executor.rs:583-601 — both copies are in the same file, so extract the block into 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:1189 — crates/buzz-relay/src/handlers/ingest.rs:1189-1207 | crates/buzz-relay/src/handlers/side_effects.rs:2532-2550 — 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) crates/buzz-relay/src/handlers/side_effects.rs:1548 — crates/buzz-relay/src/handlers/side_effects.rs:1548-1566 | crates/buzz-relay/src/handlers/side_effects.rs:2201-2219 — both copies are in the same file, so extract the block into 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) 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) crates/buzz-db/src/store/channel.rs:146 — crates/buzz-db/src/store/channel.rs:146-165 | crates/buzz-db/src/store/relay_admin_actions.rs:490-508 — 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 (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.
D2 · Cognitive Complexity · buzz_media · ×10
  • 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:750 — 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:518 — 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:301 — 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:879 — 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:424 — 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:675 — 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:608 — 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.
D2 · Cognitive Complexity · buzz_dev_mcp · ×10
  • 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::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::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::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.
D3 · God Classes · TooManyFields · ×10
  • TooManyFields: Config crates/buzz-relay/src/config.rs:118 — TooManyFields — 59 stored fields beside 1 method. The bar is 30 stored fields; this is 29 over it, 1.97× 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:739 — TooManyFields — 47 stored fields beside 20 methods. 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: CliArgs crates/buzz-acp/src/config.rs:246 — 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:541 — 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:226 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×10
  • 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) crates/buzz-db/src/store/event.rs:1863 — crates/buzz-db/src/store/event.rs:1863-1871 | crates/buzz-db/src/store/event.rs:1916-1922 | crates/buzz-db/src/store/event.rs:2227-2233 — 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) crates/buzz-db/src/store/event.rs:1863 — crates/buzz-db/src/store/event.rs:1863-1871 | crates/buzz-db/src/store/event.rs:1916-1922 | crates/buzz-db/src/store/event.rs:1974-1980 — 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/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) crates/buzz-relay/src/api/operator.rs:339 — crates/buzz-relay/src/api/operator.rs:339-345 | crates/buzz-relay/src/api/operator.rs:401-407 | crates/buzz-relay/src/api/operator.rs:473-479 — 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/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:61 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:61-67 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:87-93 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:161-170 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:61` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 3) mobile/lib/features/profile/profile_edit_page.dart:649 — mobile/lib/features/profile/profile_edit_page.dart:649-655 | mobile/lib/features/profile/profile_text_edit_sheet.dart:39-45 | mobile/lib/features/profile/profile_text_editor.dart:162-168 — 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 3 separate duplicated blocks between them, totalling at least 45 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×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:1238 — crates/buzz-sdk/src/builders.rs:1238-1242 | crates/buzz-sdk/src/builders.rs:1691-1695 | crates/buzz-sdk/src/builders.rs:1770-1774 — 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:542 — desktop/src-tauri/src/commands/admin/mod.rs:542-546 | desktop/src-tauri/src/commands/admin/mod.rs:569-573 | desktop/src-tauri/src/commands/admin/mod.rs:596-600 — 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:2072 — crates/buzz-relay/src/main.rs:2072-2076 | crates/buzz-relay/src/main.rs:2185-2189 | crates/buzz-relay/src/main.rs:2259-2265 — 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:1913 — crates/buzz-acp/src/pool.rs:1913-1917 | crates/buzz-acp/src/pool.rs:2001-2005 | crates/buzz-acp/src/pool.rs:2106-2110 — 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.
D1 · Cyclomatic Complexity · buzz_agent · ×9
  • buzz_agent::llm::openrouter_post (cyclomatic 36) crates/buzz-agent/src/llm.rs:2258 — 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::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::llm::post (cyclomatic 28) crates/buzz-agent/src/llm.rs:1862 — 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::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:1011 — 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:566 — 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.
D2 · Cognitive Complexity · buzz_cli · ×9
  • 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::messages::cmd_send_message (cognitive 19) crates/buzz-cli/src/commands/messages.rs:611 — 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_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::users::search_by_name (cognitive 18) crates/buzz-cli/src/commands/users.rs:287 — 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::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::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::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::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.
D2 · Cognitive Complexity · buzz_sdk · ×8
  • 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:1040 — 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::validate_project_envelope (cognitive 18) crates/buzz-sdk/src/builders.rs:2292 — 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:337 — 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:970 — 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:1553 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×8
  • 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) desktop/src-tauri/src/commands/agents.rs:223 — desktop/src-tauri/src/commands/agents.rs:223-231 | desktop/src-tauri/src/managed_agents/restore.rs:373-381 | 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:2399 — crates/buzz-acp/src/acp.rs:2399-2407 | crates/buzz-agent/src/mcp.rs:1038-1046 | 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:1006 — crates/buzz-relay/src/handlers/side_effects.rs:1006-1015 | crates/buzz-relay/src/handlers/side_effects.rs:3257-3265 | crates/buzz-relay/src/handlers/side_effects.rs:3710-3718 — 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) crates/buzz-relay/src/handlers/command_executor.rs:453 — crates/buzz-relay/src/handlers/command_executor.rs:453-461 | crates/buzz-relay/src/handlers/command_executor.rs:583-591 | crates/buzz-relay/src/handlers/command_executor.rs:661-669 — 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) 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:164-172 — 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.
D1 · Cyclomatic Complexity · buzz_db · ×7
  • buzz_db::store::event::query_events_on (cyclomatic 43) crates/buzz-db/src/store/event.rs:474 — buzz_db::store::event::query_events_on has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • buzz_db::store::event::count_events_on (cyclomatic 33) crates/buzz-db/src/store/event.rs:782 — buzz_db::store::event::count_events_on 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::replaceable::replace_parameterized_event_in_transaction_impl (cyclomatic 29) crates/buzz-db/src/store/replaceable.rs:105 — buzz_db::store::replaceable::replace_parameterized_event_in_transaction_impl 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_db::store::push::accept_lease_event (cyclomatic 18) crates/buzz-db/src/store/push.rs:235 — buzz_db::store::push::accept_lease_event 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_db::store::channel::update_channel (cyclomatic 17) crates/buzz-db/src/store/channel.rs:506 — buzz_db::store::channel::update_channel 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::thread::get_thread_replies_on (cyclomatic 16) crates/buzz-db/src/store/thread.rs:307 — 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.
  • buzz_db::store::channel_members::add_member (cyclomatic 16) crates/buzz-db/src/store/channel_members.rs:394 — buzz_db::store::channel_members::add_member 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.
D35 · Change Coupling · Change-coupling hub · ×7
  • 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 → tests.rs, 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: search_page.dart → activity_page.dart, channels_page.dart, thread_detail_page.dart mobile/lib/features/search/search_page.dart — `mobile/lib/features/search/search_page.dart` changes together with 3 other files — `mobile/lib/features/activity/activity_page.dart`, `mobile/lib/features/channels/channels_page.dart`, `mobile/lib/features/channels/thread_detail_page.dart` — 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: 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, 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 9 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/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 9 separate couplings, not 9 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 9.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×7
  • Duplicated block (20 lines × 2) crates/buzz-db/src/store/relay_admin_actions.rs:1468 — crates/buzz-db/src/store/relay_admin_actions.rs:1468-1487 | crates/buzz-db/src/store/relay_admin_actions.rs:1555-1574 — both copies are in the same file, so extract the block into 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:1088 — crates/buzz-relay/src/handlers/command_executor.rs:1088-1107 | crates/buzz-relay/src/handlers/command_executor.rs:1199-1218 — both copies are in the same file, so extract the block into 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) REDACTED:3244 — REDACTED:3244-3263 | REDACTED:3272-3291 — both copies are in the same file, so extract the block into 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/compose_bar/suggestions.dart:18 — mobile/lib/features/channels/compose_bar/suggestions.dart:18-37 | mobile/lib/features/channels/compose_bar/suggestions.dart:173-192 — both copies are in the same file, so extract the block into 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:173-192 — 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/shared/widgets/buzz_titled_sheet_layout.dart:37 — mobile/lib/shared/widgets/buzz_titled_sheet_layout.dart:37-56 | mobile/lib/shared/widgets/frosted_scaffold.dart:56-75 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×7
  • 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-db/src/store/relay_admin_actions.rs:167 — crates/buzz-db/src/store/relay_admin_actions.rs:167-184 | crates/buzz-db/src/store/relay_admin_actions.rs:303-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 (18 lines × 2) crates/buzz-relay/src/api/git/transport.rs:1382 — crates/buzz-relay/src/api/git/transport.rs:1382-1399 | crates/buzz-relay/src/api/git/transport.rs:1786-1803 — both copies are in the same file, so extract the block into 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:3201 — crates/buzz-relay/src/handlers/ingest.rs:3201-3218 | crates/buzz-relay/src/handlers/ingest.rs:3396-3413 — both copies are in the same file, so extract the block into 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:384 — desktop/src-tauri/src/managed_agents/discovery.rs:384-401 | 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:478 — crates/buzz-db/src/store/thread.rs:478-495 | crates/buzz-db/src/store/thread.rs:778-804 — both copies are in the same file, so extract the block into 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) mobile/lib/shared/widgets/buzz_sheet_header.dart:119 — mobile/lib/shared/widgets/buzz_sheet_header.dart:119-136 | mobile/lib/shared/widgets/modal_presentation.dart:155-172 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×7
  • Duplicated block (11 lines × 3) crates/buzz-relay/src/api/admin/mod.rs:488 — crates/buzz-relay/src/api/admin/mod.rs:488-498 | crates/buzz-relay/src/api/admin/mod.rs:696-706 | crates/buzz-relay/src/api/admin/mod.rs:780-790 — 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) crates/buzz-relay/src/api/bridge.rs:2663 — crates/buzz-relay/src/api/bridge.rs:2663-2673 | crates/buzz-relay/src/api/gifs.rs:130-140 | crates/buzz-relay/src/api/workflows.rs:56-66 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/api/workflows.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) crates/buzz-db/src/store/git_repo.rs:53 — crates/buzz-db/src/store/git_repo.rs:53-64 | crates/buzz-db/src/store/moderation.rs:574-590 | crates/buzz-db/src/store/user.rs:371-381 — 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 (11 lines × 3) crates/buzz-relay/src/api/admin/mod.rs:780 — crates/buzz-relay/src/api/admin/mod.rs:780-790 | crates/buzz-relay/src/api/admin/mod.rs:856-866 | crates/buzz-relay/src/api/admin/mod.rs:1001-1011 — 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/channels_page/body.dart:246 — mobile/lib/features/channels/channels_page/body.dart:246-256 | mobile/lib/features/channels/channels_page/body.dart:358-368 | mobile/lib/features/channels/channels_page/body.dart:373-383 — 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:290 — mobile/lib/features/forum/forum_post_card.dart:290-300 | mobile/lib/features/forum/forum_thread_page.dart:165-175 | mobile/lib/features/forum/forum_thread_page.dart:593-603 — 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 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:80 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:80-90 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:83-93 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:80-90 — `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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • 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) desktop/src-tauri/src/managed_agents/nest.rs:227 — desktop/src-tauri/src/managed_agents/nest.rs:227-234 | desktop/src-tauri/src/managed_agents/nest.rs:240-247 | desktop/src-tauri/src/managed_agents/nest.rs:267-274 — 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:5636 — crates/buzz-acp/src/lib.rs:5636-5643 | crates/buzz-acp/src/lib.rs:5684-5691 | crates/buzz-acp/src/lib.rs:5759-5766 — 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.
D1 · Cyclomatic Complexity · buzz_media · ×6
  • 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:518 — 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:750 — 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:675 — 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::validation::validate_video_file (cyclomatic 16) crates/buzz-media/src/validation.rs:301 — 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_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.
D2 · Cognitive Complexity · buzz_persona · ×6
  • 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.
D2 · Cognitive Complexity · buzz_core · ×6
  • buzz_core::filter::filter_match_one (cognitive 34) crates/buzz-core/src/filter.rs:35 — buzz_core::filter::filter_match_one has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (32 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.
  • 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::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::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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×6
  • Duplicated block (12–13 lines × 2) crates/buzz-relay/src/api/bridge.rs:2108 — crates/buzz-relay/src/api/bridge.rs:2108-2120 | crates/buzz-relay/src/handlers/count.rs:252-263 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/handlers/count.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 (12–13 lines × 2) crates/buzz-relay/src/connection.rs:906 — crates/buzz-relay/src/connection.rs:906-918 | crates/buzz-relay/src/connection.rs:929-940 — both copies are in the same file, so extract the block into 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:1312 — crates/buzz-relay/src/handlers/side_effects.rs:1312-1323 | crates/buzz-relay/src/handlers/side_effects.rs:1369-1381 — both copies are in the same file, so extract the block into 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:125-137 — 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:40 — mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:40-52 | 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.
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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×5
  • Duplicated block (12 lines × 3) crates/buzz-db/src/store/api_token.rs:172 — crates/buzz-db/src/store/api_token.rs:172-183 | crates/buzz-db/src/store/api_token.rs:234-245 | crates/buzz-db/src/store/api_token.rs:375-386 — 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-relay/src/audio/handler.rs:543 — crates/buzz-relay/src/audio/handler.rs:543-554 | crates/buzz-relay/src/audio/handler.rs:558-569 | crates/buzz-relay/src/audio/handler.rs:577-588 — 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/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:62 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:62-73 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPendingEnrollmentRecord.swift:54-65 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:81-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) mobile/lib/features/profile/profile_edit_page.dart:706 — mobile/lib/features/profile/profile_edit_page.dart:706-717 | mobile/lib/features/profile/profile_text_edit_sheet.dart:147-158 | mobile/lib/features/profile/profile_text_editor.dart:219-230 — 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 3 separate duplicated blocks between them, totalling at least 45 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×5
  • Duplicated block (10 lines × 3) crates/buzz-relay/src/api/bridge.rs:2661 — crates/buzz-relay/src/api/bridge.rs:2661-2670 | crates/buzz-relay/src/api/invites.rs:237-246 | crates/buzz-relay/src/api/workflows.rs:54-63 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/api/workflows.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) crates/buzz-relay/src/tunnel/directory.rs:249 — crates/buzz-relay/src/tunnel/directory.rs:249-258 | crates/buzz-relay/src/tunnel/directory.rs:304-313 | crates/buzz-relay/src/tunnel/directory.rs:349-358 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) 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:1433 — crates/buzz-relay/src/handlers/ingest.rs:1433-1442 | crates/buzz-relay/src/handlers/ingest.rs:1978-1990 | crates/buzz-relay/src/handlers/ingest.rs:1996-2005 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:30 — mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:30-39 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:30-39 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:30-39 — `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 45 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×5
  • Duplicated block (8–9 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–9 lines × 2) crates/buzz-db/src/store/event.rs:519 — crates/buzz-db/src/store/event.rs:519-527 | crates/buzz-db/src/store/event.rs:803-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 (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/auth.rs:170 — crates/buzz-relay/src/handlers/auth.rs:170-177 | crates/buzz-relay/src/handlers/auth.rs:192-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 (8–9 lines × 2) crates/buzz-relay/src/handlers/req.rs:418 — crates/buzz-relay/src/handlers/req.rs:418-425 | crates/buzz-relay/src/handlers/req.rs:745-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · buzz_core · ×4
  • 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::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::filter::filter_match_one (cyclomatic 18) crates/buzz-core/src/filter.rs:35 — buzz_core::filter::filter_match_one 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.
D1 · Cyclomatic Complexity · buzz_sdk · ×4
  • buzz_sdk::builders::build_repo_announcement (cyclomatic 23) crates/buzz-sdk/src/builders.rs:1040 — 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:337 — 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:1553 — 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.
D2 · Cognitive Complexity · RunCtx · ×4
  • 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.
D2 · Cognitive Complexity · git_sign_nostr · ×4
  • 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.
D2 · Cognitive Complexity · buzz_backend_kubernetes · ×4
  • 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::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::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::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.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×4
  • 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 (21 lines × 2) crates/buzz-db/src/store/channel.rs:262 — crates/buzz-db/src/store/channel.rs:262-283 | crates/buzz-db/src/store/dm.rs:200-220 — 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 (21 lines × 2) mobile/lib/features/forum/forum_post_card.dart:129 — mobile/lib/features/forum/forum_post_card.dart:129-149 | mobile/lib/features/forum/forum_thread_page.dart:376-396 — 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 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) mobile/lib/features/forum/forum_posts_view.dart:67 — mobile/lib/features/forum/forum_posts_view.dart:67-87 | mobile/lib/features/forum/forum_thread_page.dart:81-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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) crates/buzz-agent/src/llm.rs:1886 — crates/buzz-agent/src/llm.rs:1886-1901 | crates/buzz-agent/src/llm.rs:2281-2295 — both copies are in the same file, so extract the block into 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:98 — mobile/lib/features/channels/channels_page/channel_tile.dart:98-112 | mobile/lib/features/search/search_page.dart:680-695 — 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×4
  • Duplicated block (13–15 lines × 2) crates/buzz-pairing-cli/src/main.rs:561 — crates/buzz-pairing-cli/src/main.rs:561-575 | desktop/src-tauri/src/commands/pairing.rs:652-664 — 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 (13–15 lines × 2) mobile/lib/features/pulse/compose_note_page.dart:190 — mobile/lib/features/pulse/compose_note_page.dart:190-204 | mobile/lib/features/pulse/note_card.dart:70-82 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×4
  • 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) crates/buzz-db/src/store/channel_members.rs:1447 — crates/buzz-db/src/store/channel_members.rs:1447-1460 | crates/buzz-db/src/store/event.rs:1227-1242 | crates/buzz-db/src/store/git_repo.rs:94-112 — 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 (14 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:203 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:203-216 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:303-316 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:203-216 — `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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×4
  • Duplicated block (13–14 lines × 2) crates/buzz-acp/src/relay.rs:2265 — crates/buzz-acp/src/relay.rs:2265-2277 | crates/buzz-acp/src/relay.rs:2304-2317 — both copies are in the same file, so extract the block into 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:417 — crates/buzz-db/src/store/moderation.rs:417-430 | crates/buzz-db/src/store/moderation.rs:468-480 — both copies are in the same file, so extract the block into 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.
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.
D1 · Cyclomatic Complexity · Config · ×3
  • Config::from_env (cyclomatic 67) crates/buzz-relay/src/config.rs:605 — Config::from_env has cyclomatic complexity 67 (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:933 — 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.
D1 · Cyclomatic Complexity · AcpClient · ×3
  • AcpClient::read_until_response_with_idle_timeout (cyclomatic 46) crates/buzz-acp/src/acp.rs:1371 — 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 17) crates/buzz-acp/src/acp.rs:468 — AcpClient::spawn_with_env 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.
  • AcpClient::read_until_response (cyclomatic 16) crates/buzz-acp/src/acp.rs:1247 — 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.
D1 · Cyclomatic Complexity · buzz_voice · ×3
  • 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.
D1 · Cyclomatic Complexity · buzz_dev_mcp · ×3
  • 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.
D1 · Cyclomatic Complexity · buzz_cli · ×3
  • 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.
D2 · Cognitive Complexity · AcpClient · ×3
  • AcpClient::read_until_response_with_idle_timeout (cognitive 155) crates/buzz-acp/src/acp.rs:1371 — 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:1247 — 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 21) crates/buzz-acp/src/acp.rs:468 — AcpClient::spawn_with_env has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config · ×3
  • Config::from_env (cognitive 78) crates/buzz-relay/src/config.rs:605 — Config::from_env has cognitive complexity 78 (threshold 15). Drivers by points: if/else 26 (42 pts), boolean chains 20, match/switch 11 (13 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:933 — 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.
D2 · Cognitive Complexity · SubscriptionRegistry · ×3
  • 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.
D2 · Cognitive Complexity · buzz_voice · ×3
  • 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • 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-472 | desktop/src-tauri/src/commands/agents.rs:345-822 | desktop/src-tauri/src/commands/agents.rs:833-1008 — 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/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:54 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:54-75 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:79-102 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:106-128 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:132-152 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:156-176 — 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:106-316 | mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:31-95 | 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) crates/buzz-db/src/store/channel_members.rs:717 — crates/buzz-db/src/store/channel_members.rs:717-743 | crates/buzz-db/src/store/channel_members.rs:826-852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (27 lines × 2) crates/buzz-relay/src/api/bridge.rs:2255 — crates/buzz-relay/src/api/bridge.rs:2255-2281 | crates/buzz-relay/src/handlers/req.rs:649-675 — 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 48 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 (27 lines × 2) crates/buzz-relay/src/audio/room.rs:314 — crates/buzz-relay/src/audio/room.rs:314-340 | crates/buzz-relay/src/audio/room.rs:375-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) crates/buzz-relay/src/api/admin/mod.rs:1319 — crates/buzz-relay/src/api/admin/mod.rs:1319-1340 | crates/buzz-relay/src/api/admin/mod.rs:1367-1388 — both copies are in the same file, so extract the block into 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-relay/src/handlers/ingest.rs:894 — crates/buzz-relay/src/handlers/ingest.rs:894-915 | crates/buzz-relay/src/handlers/ingest.rs:1091-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.
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) crates/buzz-relay/src/api/bridge.rs:897 — crates/buzz-relay/src/api/bridge.rs:897-909 | crates/buzz-relay/src/api/bridge.rs:1224-1236 | crates/buzz-relay/src/api/bridge.rs:1851-1863 — 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) REDACTED:110 — REDACTED:110-124 | REDACTED:181-193 | REDACTED:216-228 — 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) crates/buzz-pair-relay/src/lib.rs:390 — crates/buzz-pair-relay/src/lib.rs:390-399 | crates/buzz-relay/src/handlers/ingest.rs:1922-1932 — 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 (10–11 lines × 2) mobile/lib/features/channels/channel_detail_page.dart:504 — mobile/lib/features/channels/channel_detail_page.dart:504-514 | mobile/lib/features/channels/channels_page.dart:276-285 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) crates/buzz-relay/src/handlers/command_executor.rs:336 — crates/buzz-relay/src/handlers/command_executor.rs:336-345 | crates/buzz-relay/src/handlers/command_executor.rs:498-507 | crates/buzz-relay/src/handlers/command_executor.rs:604-613 | crates/buzz-relay/src/handlers/command_executor.rs:741-750 — 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:142 — mobile/lib/shared/theme/app_theme.dart:142-151 | mobile/lib/shared/theme/app_theme.dart:155-164 | mobile/lib/shared/theme/app_theme.dart:170-179 | mobile/lib/shared/theme/app_theme.dart:183-192 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×3
  • 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:470-475 | 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 (6 lines × 4) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:62 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:62-67 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:88-93 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:138-146 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:162-170 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:62` 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×3
  • 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:2683-2687 | crates/buzz-relay/src/handlers/moderation_commands.rs:112-116 | crates/buzz-relay/src/handlers/relay_admin.rs:235-239 — 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:375 — mobile/lib/shared/community/community_provider.dart:375-380 | mobile/lib/shared/community/community_provider.dart:464-469 | mobile/lib/shared/community/community_provider.dart:536-540 | mobile/lib/shared/community/community_provider.dart:576-580 — 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.
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.
R11 · Import Boundaries · Boundary violation [package · ×3
  • 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.
D1 · Cyclomatic Complexity · buzz_pair_relay · ×2
  • buzz_pair_relay::handle_conn (cyclomatic 41) crates/buzz-pair-relay/src/lib.rs:620 — 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:343 — 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.
D1 · Cyclomatic Complexity · RunCtx · ×2
  • 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.
D1 · Cyclomatic Complexity · _ProfileTextEditSheet.build (cyclomatic 16) · ×2
  • _ProfileTextEditSheet.build (cyclomatic 16) mobile/lib/features/profile/profile_edit_page.dart:649 — _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.
  • _ProfileTextEditSheet.build (cyclomatic 16) mobile/lib/features/profile/profile_text_editor.dart:162 — _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.
D1 · Cyclomatic Complexity · encryptedBackup.encryptedBackupReducer (cyclomatic 16) · ×2
  • 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.
D2 · Cognitive Complexity · buzz_pair_relay · ×2
  • buzz_pair_relay::handle_conn (cognitive 106) crates/buzz-pair-relay/src/lib.rs:620 — 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:343 — 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.
D2 · Cognitive Complexity · WorkflowEngine · ×2
  • WorkflowEngine::run (cognitive 60) crates/buzz-workflow/src/lib.rs:489 — 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:320 — 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.
D2 · Cognitive Complexity · PkceOAuthTokenSource · ×2
  • 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.
D2 · Cognitive Complexity · installNativeRig · ×2
  • 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.
  • 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.
D2 · Cognitive Complexity · buzz_deletion · ×2
  • buzz_deletion::enumerate_tenant_prefixes (cognitive 27) crates/buzz-deletion/src/lib.rs:744 — 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::execute_stage (cognitive 24) crates/buzz-deletion/src/lib.rs:1193 — buzz_deletion::execute_stage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (7 pts), loops 2 (4 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.
D2 · Cognitive Complexity · McpRegistry · ×2
  • McpRegistry::call_hooks (cognitive 26) crates/buzz-agent/src/mcp.rs:343 — 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:200 — 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.
D2 · Cognitive Complexity · buzz_auth · ×2
  • buzz_auth::nip_fi::startup::validate_nip_fi_config (cognitive 19) crates/buzz-auth/src/nip_fi/startup/mod.rs:66 — 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.
D2 · Cognitive Complexity · _ProfileTextEditSheet.build (cognitive 18) · ×2
  • _ProfileTextEditSheet.build (cognitive 18) mobile/lib/features/profile/profile_edit_page.dart:649 — _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.
  • _ProfileTextEditSheet.build (cognitive 18) mobile/lib/features/profile/profile_text_editor.dart:162 — _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.
D2 · Cognitive Complexity · buzz_pairing_cli · ×2
  • buzz_pairing_cli::cmd_target (cognitive 16) crates/buzz-pairing-cli/src/main.rs:203 — 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:529 — 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.
D3 · God Classes · TooManyFunctions · ×2
  • 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.
D4 · Code Duplication · Near-duplicate member pair (25 shared lines) · ×2
  • 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 · Duplicated block (36 lines × 2) · ×2
  • Duplicated block (36 lines × 2) crates/buzz-db/src/store/event.rs:397 — crates/buzz-db/src/store/event.rs:397-432 | crates/buzz-db/src/store/event.rs:1388-1423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (36 lines × 2) mobile/lib/features/profile/profile_edit_page.dart:651 — mobile/lib/features/profile/profile_edit_page.dart:651-686 | mobile/lib/features/profile/profile_text_editor.dart:164-199 — before extracting anything, compare `mobile/lib/features/profile/profile_edit_page.dart` and `mobile/lib/features/profile/profile_text_editor.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 81 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) crates/buzz-acp/src/acp.rs:1313 — crates/buzz-acp/src/acp.rs:1313-1338 | crates/buzz-acp/src/acp.rs:1761-1786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (26 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:77 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:77-102 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:57-82 — 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 7 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • 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:80 — mobile/lib/features/activity/activity_page.dart:80-103 | mobile/lib/features/channels/channels_page.dart:215-238 — 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) crates/buzz-acp/src/relay.rs:3773 — crates/buzz-acp/src/relay.rs:3773-3795 | 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×2
  • Duplicated block (19–20 lines × 2) crates/buzz-acp/src/lib.rs:3406 — crates/buzz-acp/src/lib.rs:3406-3425 | crates/buzz-acp/src/lib.rs:3459-3477 — both copies are in the same file, so extract the block into 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/handlers/side_effects.rs:1945 — crates/buzz-relay/src/handlers/side_effects.rs:1945-1964 | crates/buzz-relay/src/handlers/side_effects.rs:1967-1985 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×2
  • Duplicated block (16–20 lines × 2) desktop/src-tauri/src/commands/admin/mod.rs:174 — desktop/src-tauri/src/commands/admin/mod.rs:174-193 | desktop/src-tauri/src/commands/admin/mod.rs:222-237 — both copies are in the same file, so extract the block into 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:911 — mobile/ios/Runner/AppDelegate.swift:911-930 | 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:911` 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.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×2
  • Duplicated block (17–19 lines × 2) crates/buzz-db/src/store/relay_invite.rs:336 — crates/buzz-db/src/store/relay_invite.rs:336-354 | crates/buzz-db/src/store/relay_members.rs:190-206 — 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:129 — crates/buzz-pairing-cli/src/main.rs:129-145 | crates/buzz-pairing-cli/src/main.rs:231-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) crates/buzz-acp/src/pool.rs:3190 — crates/buzz-acp/src/pool.rs:3190-3207 | crates/buzz-acp/src/pool.rs:3496-3512 — both copies are in the same file, so extract the block into 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:2752 — crates/buzz-relay/src/api/bridge.rs:2752-2769 | crates/buzz-relay/src/api/bridge.rs:2792-2808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×2
  • Duplicated block (16–17 lines × 3) crates/buzz-acp/src/pool.rs:3356 — crates/buzz-acp/src/pool.rs:3356-3371 | crates/buzz-acp/src/pool.rs:3415-3431 | crates/buzz-acp/src/pool.rs:3469-3485 — 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) crates/buzz-cli/src/commands/channels.rs:682 — crates/buzz-cli/src/commands/channels.rs:682-694 | crates/buzz-cli/src/commands/channels.rs:1458-1468 — both copies are in the same file, so extract the block into 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–13 lines × 2) crates/buzz-relay/src/handlers/side_effects.rs:1859 — crates/buzz-relay/src/handlers/side_effects.rs:1859-1871 | crates/buzz-relay/src/handlers/side_effects.rs:2399-2409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) crates/buzz-pairing-cli/src/main.rs:159 — crates/buzz-pairing-cli/src/main.rs:159-170 | crates/buzz-pairing-cli/src/main.rs:290-299 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×2
  • Duplicated block (8–10 lines × 2) crates/buzz-relay/src/api/invites.rs:451 — crates/buzz-relay/src/api/invites.rs:451-458 | crates/buzz-relay/src/api/invites.rs:529-538 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) crates/buzz-relay/src/handlers/event.rs:937 — crates/buzz-relay/src/handlers/event.rs:937-946 | crates/buzz-relay/src/handlers/event.rs:1130-1138 — both copies are in the same file, so extract the block into 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) crates/buzz-db/src/store/operator_listener.rs:68 — crates/buzz-db/src/store/operator_listener.rs:68-74 | desktop/src-tauri/src/huddle/relay_api.rs:631-636 — 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:774 — crates/buzz-db/src/store/push.rs:774-779 | crates/buzz-db/src/store/push.rs:797-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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) crates/buzz-db/src/store/moderation.rs:409 — crates/buzz-db/src/store/moderation.rs:409-426 | crates/buzz-db/src/store/moderation.rs:461-476 | crates/buzz-db/src/store/relay_admin_actions.rs:323-338 — 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:162 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:162-177 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:189-204 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:162-177 — `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.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×2
  • 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 (5 lines × 5) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:63 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:63-67 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:89-93 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:114-121 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:139-146 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:163-170 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushTranscript.swift:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×2
  • Duplicated block (22–23 lines × 2) mobile/ios/Runner/AppDelegate.swift:659 — mobile/ios/Runner/AppDelegate.swift:659-681 | mobile/ios/Runner/AppDelegate.swift:704-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. Read the line range as the matched WINDOW rather than a finished unit: at `mobile/ios/Runner/AppDelegate.swift:659` 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • 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:235 — mobile/lib/shared/push/push_bootstrap.dart:235-248 | mobile/lib/shared/push/push_bootstrap.dart:307-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.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×2
  • Duplicated block (39 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:336 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:336-374 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:336-374 — `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 225 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 (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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:240 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:240-264 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:240-264 — `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 225 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/channels/channels_page/sheets.dart:69 — mobile/lib/features/channels/channels_page/sheets.dart:69-93 | mobile/lib/features/channels/channels_page/sheets.dart:507-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.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×2
  • Duplicated block (21 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:353 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:353-373 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:478-498 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:353-373 — `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 (21 lines × 3) mobile/lib/features/forum/forum_post_card.dart:242 — mobile/lib/features/forum/forum_post_card.dart:242-262 | mobile/lib/features/forum/forum_thread_page.dart:118-138 | mobile/lib/features/forum/forum_thread_page.dart:545-565 — 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 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) mobile/lib/features/channels/channel_actions_sheet.dart:217 — mobile/lib/features/channels/channel_actions_sheet.dart:217-228 | mobile/lib/features/channels/channel_details_page.dart:200-210 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11–12 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:120 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:120-130 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:130-141 — 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 7 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • 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:125-133 | mobile/lib/shared/widgets/ios_glass_theme_pagination.dart:48-56 | 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:98 — mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:98-105 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:116-123 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:109-116 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:98-105 — `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 45 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 (83 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (83 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:45 — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:45 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:84 — the two spans are one implementation copied and then locally edited — 579 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 (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 (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.
R7 · Dead Code · Dead file (~98 LoC) · ×2
  • Dead file (~98 LoC) desktop/src/features/channels/ui/QuickBotBar.tsx — no import path from any entry point (87 application, 32 tooling, 911 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 (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~56 LoC) · ×2
  • Dead file (~56 LoC) desktop/src/features/sidebar/data/sidebarData.ts — no import path from any entry point (87 application, 32 tooling, 911 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 (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~45 LoC) · ×2
  • Dead file (~45 LoC) desktop/src/features/channels/ui/AddChannelBotReuseGuard.tsx — no import path from any entry point (87 application, 32 tooling, 911 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 (87 application, 32 tooling, 911 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
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 739 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.
D1 · Cyclomatic Complexity · AgentConfigFields.AgentConfigFields (cyclomatic 170) · ×1
  • AgentConfigFields.AgentConfigFields (cyclomatic 170) desktop/src/features/agents/ui/AgentConfigFields.tsx:212 — AgentConfigFields.AgentConfigFields has cyclomatic complexity 170 (threshold 15). Of this number, 124 points are the body's own statements and 46 belong to 14 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.
D1 · Cyclomatic Complexity · AnimatedAvatarCapture.AnimatedAvatarCapture (cyclomatic 162) · ×1
  • 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.
D1 · Cyclomatic Complexity · _MessageList.build (cyclomatic 161) · ×1
  • _MessageList.build (cyclomatic 161) mobile/lib/features/channels/channel_detail_page/message_list.dart:42 — _MessageList.build has cyclomatic complexity 161 (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.
D1 · Cyclomatic Complexity · ProfileAvatarEditor.ProfileAvatarEditor (cyclomatic 148) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePanel.UserProfilePanel (cyclomatic 147) · ×1
  • UserProfilePanel.UserProfilePanel (cyclomatic 147) desktop/src/features/profile/ui/UserProfilePanel.tsx:104 — UserProfilePanel.UserProfilePanel has cyclomatic complexity 147 (threshold 15). Of this number, 93 points are the body's own statements and 54 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.
D1 · Cyclomatic Complexity · ThreadDetailPage.build (cyclomatic 138) · ×1
  • ThreadDetailPage.build (cyclomatic 138) mobile/lib/features/channels/thread_detail_page.dart:93 — ThreadDetailPage.build has cyclomatic complexity 138 (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.
D1 · Cyclomatic Complexity · AgentCreationPreview.AgentCreationPreview (cyclomatic 138) · ×1
  • AgentCreationPreview.AgentCreationPreview (cyclomatic 138) desktop/src/features/agents/ui/AgentCreationPreview.tsx:47 — AgentCreationPreview.AgentCreationPreview has cyclomatic complexity 138 (threshold 15). Of this number, 91 points are the body's own statements and 47 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.
D1 · Cyclomatic Complexity · useMentionSendFlow.useMentionSendFlow (cyclomatic 138) · ×1
  • useMentionSendFlow.useMentionSendFlow (cyclomatic 138) desktop/src/features/messages/ui/useMentionSendFlow.ts:51 — useMentionSendFlow.useMentionSendFlow has cyclomatic complexity 138 (threshold 15). Most of this is not in the body itself: 9 of the 138 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 284, 726, 530, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ChannelPane.ChannelPane (cyclomatic 128) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · AgentDefinitionDialog.AgentDefinitionDialog (cyclomatic 124) · ×1
  • AgentDefinitionDialog.AgentDefinitionDialog (cyclomatic 124) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:124 — AgentDefinitionDialog.AgentDefinitionDialog has cyclomatic complexity 124 (threshold 15). Of this number, 86 points are the body's own statements and 38 belong to 9 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TerminalSubstrate.TerminalSubstrate (cyclomatic 123) · ×1
  • 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 literals inside it that branch (lines 398, 685, 190, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useAnchoredScroll.useAnchoredScroll (cyclomatic 118) · ×1
  • useAnchoredScroll.useAnchoredScroll (cyclomatic 118) desktop/src/features/messages/ui/useAnchoredScroll.ts:150 — useAnchoredScroll.useAnchoredScroll has cyclomatic complexity 118 (threshold 15). Most of this is not in the body itself: 2 of the 118 points are its own statements and the rest belongs to 27 function literals inside it that branch (lines 607, 432, 880, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ImageAvatarCapture.build (cyclomatic 114) · ×1
  • 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.
D1 · Cyclomatic Complexity · ForumComposer.ForumComposerVisit (cyclomatic 112) · ×1
  • 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.
D1 · Cyclomatic Complexity · markdown.ImageZoomOverlay (cyclomatic 112) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageComposer.MessageComposerImpl (cyclomatic 109) · ×1
  • 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.
D1 · Cyclomatic Complexity · AgentInstanceEditDialog.AgentInstanceEditDialog (cyclomatic 108) · ×1
  • AgentInstanceEditDialog.AgentInstanceEditDialog (cyclomatic 108) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:100 — AgentInstanceEditDialog.AgentInstanceEditDialog has cyclomatic complexity 108 (threshold 15). Of this number, 80 points are the body's own statements and 28 belong to 11 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useUnreadChannels.useUnreadChannels (cyclomatic 107) · ×1
  • useUnreadChannels.useUnreadChannels (cyclomatic 107) desktop/src/features/channels/useUnreadChannels.ts:126 — useUnreadChannels.useUnreadChannels has cyclomatic complexity 107 (threshold 15). Most of this is not in the body itself: 3 of the 107 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 670, 791, 426, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MessageTimeline.MessageTimelineBase (cyclomatic 106) · ×1
  • MessageTimeline.MessageTimelineBase (cyclomatic 106) desktop/src/features/messages/ui/MessageTimeline.tsx:162 — MessageTimeline.MessageTimelineBase has cyclomatic complexity 106 (threshold 15). Of this number, 75 points are the body's own statements and 31 belong to 11 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.
D1 · Cyclomatic Complexity · huddlePresenceRuntime.startHuddlePresenceRuntime (cyclomatic 105) · ×1
  • huddlePresenceRuntime.startHuddlePresenceRuntime (cyclomatic 105) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:64 — huddlePresenceRuntime.startHuddlePresenceRuntime has cyclomatic complexity 105 (threshold 15). Of this number, 21 points are the body's own statements and 84 belong to 14 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.
D1 · Cyclomatic Complexity · HostedCommunityOnboarding.HostedCommunityOnboarding (cyclomatic 103) · ×1
  • HostedCommunityOnboarding.HostedCommunityOnboarding (cyclomatic 103) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:77 — 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 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.
D1 · Cyclomatic Complexity · NostrKeyImportForm.NostrKeyImportForm (cyclomatic 100) · ×1
  • 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.
D1 · Cyclomatic Complexity · ComposeBar.build (cyclomatic 99) · ×1
  • ComposeBar.build (cyclomatic 99) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:33 — ComposeBar.build has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HuddleBar.HuddleBar (cyclomatic 99) · ×1
  • HuddleBar.HuddleBar (cyclomatic 99) desktop/src/features/huddle/components/HuddleBar.tsx:149 — HuddleBar.HuddleBar has cyclomatic complexity 99 (threshold 15). Of this number, 42 points are the body's own statements and 57 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.
D1 · Cyclomatic Complexity · WorkflowDialog.WorkflowDialog (cyclomatic 96) · ×1
  • WorkflowDialog.WorkflowDialog (cyclomatic 96) desktop/src/features/workflows/ui/WorkflowDialog.tsx:216 — WorkflowDialog.WorkflowDialog has cyclomatic complexity 96 (threshold 15). Of this number, 59 points are the body's own statements and 37 belong to 17 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MembersSidebar.MembersSidebar (cyclomatic 95) · ×1
  • MembersSidebar.MembersSidebar (cyclomatic 95) desktop/src/features/channels/ui/MembersSidebar.tsx:138 — MembersSidebar.MembersSidebar has cyclomatic complexity 95 (threshold 15). Of this number, 56 points are the body's own statements and 39 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.
D1 · Cyclomatic Complexity · CommunityOnboardingFlow.CommunityOnboardingFlow (cyclomatic 93) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · MessageThreadPanel.MessageThreadPanel (cyclomatic 91) · ×1
  • 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.
D1 · Cyclomatic Complexity · HuddleContext.HuddleProvider (cyclomatic 89) · ×1
  • 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.
D1 · Cyclomatic Complexity · useMentions.useMentions (cyclomatic 88) · ×1
  • useMentions.useMentions (cyclomatic 88) desktop/src/features/messages/lib/useMentions.ts:76 — useMentions.useMentions has cyclomatic complexity 88 (threshold 15). Most of this is not in the body itself: 9 of the 88 points are its own statements and the rest belongs to 23 function literals inside it that branch (lines 828, 492, 601, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · HomeView.HomeView (cyclomatic 87) · ×1
  • 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.
D1 · Cyclomatic Complexity · InviteRedeemForm.InviteRedeemForm (cyclomatic 87) · ×1
  • 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.
D1 · Cyclomatic Complexity · VideoPlayer.VideoReviewDialog (cyclomatic 87) · ×1
  • 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.
D1 · Cyclomatic Complexity · AnimatedAvatarCapture.build (cyclomatic 86) · ×1
  • AnimatedAvatarCapture.build (cyclomatic 86) mobile/lib/features/profile/animated_avatar_capture.dart:64 — 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.
D1 · Cyclomatic Complexity · useObservedUnreadPersistence.useObservedUnreadPersistence (cyclomatic 86) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectDetailScreen.ProjectDetailScreen (cyclomatic 86) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · ChannelDetailPage.build (cyclomatic 85) · ×1
  • ChannelDetailPage.build (cyclomatic 85) mobile/lib/features/channels/channel_detail_page.dart:268 — ChannelDetailPage.build has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MessageRow.MessageRow (cyclomatic 85) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · ProfileSettingsCard.ProfileSettingsCard (cyclomatic 85) · ×1
  • 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.
D1 · Cyclomatic Complexity · NostrBindConsentDialog.NostrBindConsentDialog (cyclomatic 84) · ×1
  • 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.
D1 · Cyclomatic Complexity · HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cyclomatic 84) · ×1
  • HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cyclomatic 84) desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:69 — HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard has cyclomatic complexity 84 (threshold 15). Of this number, 38 points are the body's own statements and 46 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.
D1 · Cyclomatic Complexity · UserProfilePanelSections.ProfileSummaryView (cyclomatic 83) · ×1
  • 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.
D1 · Cyclomatic Complexity · WorkflowFormBuilder.WorkflowFormBuilder (cyclomatic 83) · ×1
  • 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.
D1 · Cyclomatic Complexity · CommunityCatalogDialog.CommunityCatalogDialog (cyclomatic 81) · ×1
  • CommunityCatalogDialog.CommunityCatalogDialog (cyclomatic 81) desktop/src/features/agents/ui/CommunityCatalogDialog.tsx:101 — CommunityCatalogDialog.CommunityCatalogDialog has cyclomatic complexity 81 (threshold 15). Of this number, 50 points are the body's own statements and 31 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.
D1 · Cyclomatic Complexity · TopbarSearch.TopbarSearch (cyclomatic 81) · ×1
  • TopbarSearch.TopbarSearch (cyclomatic 81) desktop/src/features/search/ui/TopbarSearch.tsx:376 — TopbarSearch.TopbarSearch has cyclomatic complexity 81 (threshold 15). Of this number, 37 points are the body's own statements and 44 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.
D1 · Cyclomatic Complexity · EncryptedBackupCreator.EncryptedBackupCreator (cyclomatic 80) · ×1
  • 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.
D1 · Cyclomatic Complexity · AgentsView.AgentsView (cyclomatic 79) · ×1
  • AgentsView.AgentsView (cyclomatic 79) desktop/src/features/agents/ui/AgentsView.tsx:40 — AgentsView.AgentsView has cyclomatic complexity 79 (threshold 15). Of this number, 50 points are the body's own statements and 29 belong to 25 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.
D1 · Cyclomatic Complexity · useRichTextEditor.useRichTextEditor (cyclomatic 77) · ×1
  • useRichTextEditor.useRichTextEditor (cyclomatic 77) desktop/src/features/messages/lib/useRichTextEditor.ts:145 — useRichTextEditor.useRichTextEditor has cyclomatic complexity 77 (threshold 15). Most of this is not in the body itself: 1 of the 77 points is its own statement and the rest belongs to 21 function literals inside it that branch (lines 424, 227, 739, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ChannelBrowserDialog.ChannelBrowserDialog (cyclomatic 74) · ×1
  • ChannelBrowserDialog.ChannelBrowserDialog (cyclomatic 74) desktop/src/features/channels/ui/ChannelBrowserDialog.tsx:102 — ChannelBrowserDialog.ChannelBrowserDialog has cyclomatic complexity 74 (threshold 15). Of this number, 30 points are the body's own statements and 44 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.
D1 · Cyclomatic Complexity · AudioMessageAttachment.AudioMessageAttachment (cyclomatic 74) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProfileEditPage.build (cyclomatic 73) · ×1
  • 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.
D1 · Cyclomatic Complexity · useMediaUpload.useMediaUpload (cyclomatic 72) · ×1
  • 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.
D1 · Cyclomatic Complexity · WorkflowMessagePicker.WorkflowMessagePicker (cyclomatic 72) · ×1
  • 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.
D1 · Cyclomatic Complexity · InboxDetailPane.InboxMessageDetailPane (cyclomatic 71) · ×1
  • 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.
D1 · Cyclomatic Complexity · NewMessageScreen.NewMessageScreen (cyclomatic 71) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelDetailsPage.build (cyclomatic 70) · ×1
  • ChannelDetailsPage.build (cyclomatic 70) mobile/lib/features/channels/channel_details_page.dart:41 — ChannelDetailsPage.build 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.
D1 · Cyclomatic Complexity · ChannelScreen.ChannelScreen (cyclomatic 66) · ×1
  • 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.
D1 · Cyclomatic Complexity · HostedCommunityCreateFlow.HostedCommunityCreateFlow (cyclomatic 66) · ×1
  • HostedCommunityCreateFlow.HostedCommunityCreateFlow (cyclomatic 66) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:41 — 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 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.
D1 · Cyclomatic Complexity · agentSessionTranscript.processTranscriptEvent (cyclomatic 65) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePopover.UserProfilePopoverBody (cyclomatic 64) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectsView.ProjectsView (cyclomatic 64) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelManagementSheet.ChannelManagementSheet (cyclomatic 62) · ×1
  • ChannelManagementSheet.ChannelManagementSheet (cyclomatic 62) desktop/src/features/channels/ui/ChannelManagementSheet.tsx:99 — ChannelManagementSheet.ChannelManagementSheet has cyclomatic complexity 62 (threshold 15). Of this number, 58 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.
D1 · Cyclomatic Complexity · MentionAutocomplete.MentionAutocomplete (cyclomatic 62) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectRepositoryActionsPanel.ProjectRepositoryActionsPanel (cyclomatic 62) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProfileAvatarEditor.build (cyclomatic 61) · ×1
  • ProfileAvatarEditor.build (cyclomatic 61) mobile/lib/features/profile/profile_avatar_editor.dart:124 — ProfileAvatarEditor.build has cyclomatic complexity 61 (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.
D1 · Cyclomatic Complexity · ProjectWorkspaceTabs.WorkspaceTabs (cyclomatic 61) · ×1
  • 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.
D1 · Cyclomatic Complexity · useSearchResults.useSearchResults (cyclomatic 61) · ×1
  • useSearchResults.useSearchResults (cyclomatic 61) desktop/src/features/search/useSearchResults.ts:102 — useSearchResults.useSearchResults has cyclomatic complexity 61 (threshold 15). Of this number, 25 points are the body's own statements and 36 belong to 13 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.
D1 · Cyclomatic Complexity · AppSidebar.AppSidebar (cyclomatic 61) · ×1
  • 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.
D1 · Cyclomatic Complexity · useManagedAgentActions.useManagedAgentActions (cyclomatic 60) · ×1
  • useManagedAgentActions.useManagedAgentActions (cyclomatic 60) desktop/src/features/agents/ui/useManagedAgentActions.ts:41 — useManagedAgentActions.useManagedAgentActions has cyclomatic complexity 60 (threshold 15). Of this number, 43 points are the body's own statements and 17 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.
D1 · Cyclomatic Complexity · HuddlePresenceTracker.apply (cyclomatic 60) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflowFormTypes.yamlToFormState (cyclomatic 59) · ×1
  • 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.
D1 · Cyclomatic Complexity · MachineOnboardingFlow.MachineOnboardingFlow (cyclomatic 58) · ×1
  • 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.
D1 · Cyclomatic Complexity · useAgentAddressLockPicker.useAgentAddressLockPicker (cyclomatic 56) · ×1
  • useAgentAddressLockPicker.useAgentAddressLockPicker (cyclomatic 56) desktop/src/features/messages/ui/useAgentAddressLockPicker.ts:17 — useAgentAddressLockPicker.useAgentAddressLockPicker has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 3 of the 56 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 194, 295, 346, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · VideoPlayer.VideoPlayer (cyclomatic 56) · ×1
  • 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.
D1 · Cyclomatic Complexity · BeeRefreshIndicator.build (cyclomatic 55) · ×1
  • 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.
D1 · Cyclomatic Complexity · usePersonaActions.usePersonaActions (cyclomatic 55) · ×1
  • usePersonaActions.usePersonaActions (cyclomatic 55) desktop/src/features/agents/ui/usePersonaActions.ts:69 — usePersonaActions.usePersonaActions has cyclomatic complexity 55 (threshold 15). Of this number, 52 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.
D1 · Cyclomatic Complexity · formatTimelineMessages.formatTimelineMessages (cyclomatic 54) · ×1
  • formatTimelineMessages.formatTimelineMessages (cyclomatic 54) desktop/src/features/messages/lib/formatTimelineMessages.ts:217 — formatTimelineMessages.formatTimelineMessages has cyclomatic complexity 54 (threshold 15). Of this number, 41 points are the body's own statements and 13 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.
D1 · Cyclomatic Complexity · useHuddlePresentation.useHuddlePresentation (cyclomatic 53) · ×1
  • useHuddlePresentation.useHuddlePresentation (cyclomatic 53) desktop/src/app/useHuddlePresentation.ts:31 — useHuddlePresentation.useHuddlePresentation 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 26 function literals inside it that branch (lines 395, 189, 109, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · welcomeKickoff.useWelcomeKickoff (cyclomatic 53) · ×1
  • 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.
D1 · Cyclomatic Complexity · InboxListPane.InboxListPane (cyclomatic 52) · ×1
  • InboxListPane.InboxListPane (cyclomatic 52) desktop/src/features/home/ui/InboxListPane.tsx:243 — InboxListPane.InboxListPane has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 13 of the 52 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 309, 713, 301, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ProjectPullRequestsPanel.ProjectPullRequestDetail (cyclomatic 52) · ×1
  • 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.
D1 · Cyclomatic Complexity · MediaImageViewerPage.build (cyclomatic 51) · ×1
  • MediaImageViewerPage.build (cyclomatic 51) mobile/lib/features/channels/media_viewer_page.dart:195 — MediaImageViewerPage.build has cyclomatic complexity 51 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · modelCapabilities.generateDatabricksLabel (cyclomatic 51) · ×1
  • modelCapabilities.generateDatabricksLabel (cyclomatic 51) desktop/src/features/agents/ui/modelCapabilities.ts:514 — modelCapabilities.generateDatabricksLabel has cyclomatic complexity 51 (threshold 15). Of this number, 48 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.
D1 · Cyclomatic Complexity · TerminalBootstrap.TerminalBootstrap (cyclomatic 51) · ×1
  • 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.
D1 · Cyclomatic Complexity · ActivityPage.build (cyclomatic 50) · ×1
  • ActivityPage.build (cyclomatic 50) mobile/lib/features/activity/activity_page.dart:72 — ActivityPage.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.
D1 · Cyclomatic Complexity · useLiveChannelUpdates.useLiveChannelUpdates (cyclomatic 50) · ×1
  • 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.
D1 · Cyclomatic Complexity · BackupStep.BackupStep (cyclomatic 50) · ×1
  • 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.
D1 · Cyclomatic Complexity · WorkflowTriggerConditions.WorkflowTriggerConditions (cyclomatic 50) · ×1
  • 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 literals inside it that branch (lines 275, 177, 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.
D1 · Cyclomatic Complexity · markdown.createMarkdownComponents (cyclomatic 50) · ×1
  • markdown.createMarkdownComponents (cyclomatic 50) desktop/src/shared/ui/markdown.tsx:1212 — markdown.createMarkdownComponents has cyclomatic complexity 50 (threshold 15). Of this number, 19 points are the body's own statements and 31 belong to 10 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HuddleIndicator.HuddleIndicator (cyclomatic 49) · ×1
  • 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: 15 of the 49 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 61, 219, 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.
D1 · Cyclomatic Complexity · TimelineMessageList.VirtualizedTimelineRows (cyclomatic 49) · ×1
  • TimelineMessageList.VirtualizedTimelineRows (cyclomatic 49) desktop/src/features/messages/ui/TimelineMessageList.tsx:423 — 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 497, 630, 713, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ProjectConversationPanel.ProjectConversationPanel (cyclomatic 48) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelsNotifier._fetchChannels (cyclomatic 47) · ×1
  • ChannelsNotifier._fetchChannels (cyclomatic 47) mobile/lib/features/channels/channels_provider.dart:175 — ChannelsNotifier._fetchChannels 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.
D1 · Cyclomatic Complexity · App.CommunityApp (cyclomatic 47) · ×1
  • App.CommunityApp (cyclomatic 47) desktop/src/app/App.tsx:360 — 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.
D1 · Cyclomatic Complexity · plainTextProjection.buildPlainTextProjection (cyclomatic 47) · ×1
  • plainTextProjection.buildPlainTextProjection (cyclomatic 47) desktop/src/features/messages/lib/plainTextProjection.ts:91 — plainTextProjection.buildPlainTextProjection has cyclomatic complexity 47 (threshold 15). Of this number, 35 points are the body's own statements and 12 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.
D1 · Cyclomatic Complexity · PullRequestReviewersRow.PullRequestReviewersRow (cyclomatic 47) · ×1
  • 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.
D1 · Cyclomatic Complexity · AppShell.AppShell (cyclomatic 45) · ×1
  • AppShell.AppShell (cyclomatic 45) desktop/src/app/AppShell.tsx:110 — AppShell.AppShell has cyclomatic complexity 45 (threshold 15). Of this number, 25 points are the body's own statements and 20 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.
D1 · Cyclomatic Complexity · useInboxSelectionAnchor.useInboxSelectionAnchor (cyclomatic 45) · ×1
  • useInboxSelectionAnchor.useInboxSelectionAnchor (cyclomatic 45) desktop/src/features/home/useInboxSelectionAnchor.ts:66 — useInboxSelectionAnchor.useInboxSelectionAnchor has cyclomatic complexity 45 (threshold 15). Of this number, 20 points are the body's own statements and 25 belong to 11 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useInboxThreadContext.useInboxThreadContext (cyclomatic 45) · ×1
  • useInboxThreadContext.useInboxThreadContext (cyclomatic 45) desktop/src/features/home/useInboxThreadContext.ts:49 — useInboxThreadContext.useInboxThreadContext has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 6 of the 45 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 81, 110, 279, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useVoiceNoteRecorder.useVoiceNoteRecorder (cyclomatic 45) · ×1
  • useVoiceNoteRecorder.useVoiceNoteRecorder (cyclomatic 45) desktop/src/features/messages/lib/useVoiceNoteRecorder.ts:42 — useVoiceNoteRecorder.useVoiceNoteRecorder has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 68, 125, 184, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useComposerLinkPreviews.useComposerLinkPreviews (cyclomatic 45) · ×1
  • useComposerLinkPreviews.useComposerLinkPreviews (cyclomatic 45) desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:273 — useComposerLinkPreviews.useComposerLinkPreviews has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 13 of the 45 points are its own statements and the rest belongs to 17 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.
D1 · Cyclomatic Complexity · SetStatusDialog.SetStatusDialog (cyclomatic 45) · ×1
  • SetStatusDialog.SetStatusDialog (cyclomatic 45) desktop/src/features/user-status/ui/SetStatusDialog.tsx:184 — SetStatusDialog.SetStatusDialog has cyclomatic complexity 45 (threshold 15). Of this number, 32 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AgentDefaultsEditor.AgentDefaultsEditor (cyclomatic 44) · ×1
  • AgentDefaultsEditor.AgentDefaultsEditor (cyclomatic 44) desktop/src/features/agents/ui/AgentDefaultsEditor.tsx:69 — AgentDefaultsEditor.AgentDefaultsEditor has cyclomatic complexity 44 (threshold 15). Of this number, 39 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChannelManagementSheet.ChannelManagementPanelContent (cyclomatic 44) · ×1
  • 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.
D1 · Cyclomatic Complexity · PersonaShareDialog.SnapshotShareDialog (cyclomatic 43) · ×1
  • PersonaShareDialog.SnapshotShareDialog (cyclomatic 43) desktop/src/features/agents/ui/PersonaShareDialog.tsx:228 — PersonaShareDialog.SnapshotShareDialog has cyclomatic complexity 43 (threshold 15). Of this number, 37 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.
D1 · Cyclomatic Complexity · OnboardingFlow.OnboardingFlow (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · IssueAssigneesRow.IssueAssigneesRow (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · PullRequestReviewCard.PullRequestReviewCard (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · HuddleTransport._handleJoined (cyclomatic 42) · ×1
  • HuddleTransport._handleJoined (cyclomatic 42) mobile/lib/shared/huddle/huddle_transport.dart:437 — 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.
D1 · Cyclomatic Complexity · AdminConsoleSettingsCard.AdminConsoleSettingsSession (cyclomatic 42) · ×1
  • AdminConsoleSettingsCard.AdminConsoleSettingsSession (cyclomatic 42) desktop/src/features/admin-console/AdminConsoleSettingsCard.tsx:239 — AdminConsoleSettingsCard.AdminConsoleSettingsSession has cyclomatic complexity 42 (threshold 15). Of this number, 23 points are the body's own statements and 19 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.
D1 · Cyclomatic Complexity · useCommunityJoinAlerts.useCommunityJoinAlerts (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · useTtsSubscription.useTtsSubscription (cyclomatic 42) · ×1
  • 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 15 function literals inside it that branch (lines 129, 40, 104, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MobilePairingCard.MobilePairingCard (cyclomatic 42) · ×1
  • MobilePairingCard.MobilePairingCard (cyclomatic 42) desktop/src/features/settings/ui/MobilePairingCard.tsx:251 — MobilePairingCard.MobilePairingCard has cyclomatic complexity 42 (threshold 15). Of this number, 23 points are the body's own statements and 19 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.
D1 · Cyclomatic Complexity · WorkflowAuthorPicker.WorkflowAuthorPicker (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · InvitePage.InvitePage (cyclomatic 42) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · CommunityEditForm.CommunityEditForm (cyclomatic 41) · ×1
  • 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.
D1 · Cyclomatic Complexity · MeshComputeSettingsCard.MeshComputeSettingsCard (cyclomatic 41) · ×1
  • MeshComputeSettingsCard.MeshComputeSettingsCard (cyclomatic 41) desktop/src/features/mesh-compute/ui/MeshComputeSettingsCard.tsx:87 — MeshComputeSettingsCard.MeshComputeSettingsCard has cyclomatic complexity 41 (threshold 15). Of this number, 31 points are the body's own statements and 10 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.
D1 · Cyclomatic Complexity · WorkflowDetailPanel.WorkflowDetailPanel (cyclomatic 41) · ×1
  • WorkflowDetailPanel.WorkflowDetailPanel (cyclomatic 41) desktop/src/features/workflows/ui/WorkflowDetailPanel.tsx:29 — WorkflowDetailPanel.WorkflowDetailPanel has cyclomatic complexity 41 (threshold 15). Of this number, 30 points are the body's own statements and 11 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.
D1 · Cyclomatic Complexity · AdminConsoleStaffingTab.RestrictionsSection (cyclomatic 40) · ×1
  • AdminConsoleStaffingTab.RestrictionsSection (cyclomatic 40) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:161 — AdminConsoleStaffingTab.RestrictionsSection has cyclomatic complexity 40 (threshold 15). Of this number, 24 points are the body's own statements and 16 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.
D1 · Cyclomatic Complexity · IdentityRecoveryPairing.IdentityRecoveryPairing (cyclomatic 40) · ×1
  • IdentityRecoveryPairing.IdentityRecoveryPairing (cyclomatic 40) desktop/src/features/onboarding/ui/IdentityRecoveryPairing.tsx:39 — IdentityRecoveryPairing.IdentityRecoveryPairing has cyclomatic complexity 40 (threshold 15). Of this number, 23 points are the body's own statements and 17 belong to 11 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.
D1 · Cyclomatic Complexity · buildMentionCandidates.buildMentionCandidates (cyclomatic 39) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · ComposerImageEditor.ComposerImageEditor (cyclomatic 39) · ×1
  • 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 219, 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.
D1 · Cyclomatic Complexity · ComposerAttachments.MediaAttachmentItem (cyclomatic 39) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelContextMenu.ChannelContextMenuItems (cyclomatic 39) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelCombobox.ChannelCombobox (cyclomatic 39) · ×1
  • ChannelCombobox.ChannelCombobox (cyclomatic 39) desktop/src/features/workflows/ui/ChannelCombobox.tsx:52 — ChannelCombobox.ChannelCombobox has cyclomatic complexity 39 (threshold 15). Of this number, 27 points are the body's own statements and 12 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.
D1 · Cyclomatic Complexity · agentConfigControls.AgentModelField (cyclomatic 38) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · AgentSessionThreadPanel.AgentSessionThreadPanel (cyclomatic 38) · ×1
  • AgentSessionThreadPanel.AgentSessionThreadPanel (cyclomatic 38) desktop/src/features/channels/ui/AgentSessionThreadPanel.tsx:90 — AgentSessionThreadPanel.AgentSessionThreadPanel has cyclomatic complexity 38 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MaskedAvatarBadgeFrame.MaskedAvatarBadgeFrame (cyclomatic 38) · ×1
  • 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.
D1 · Cyclomatic Complexity · AgentRuntimeAvatarControl.AgentRuntimeAvatarControl (cyclomatic 37) · ×1
  • 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.
D1 · Cyclomatic Complexity · useObserverEvents.useLoadArchivedObserverEvents (cyclomatic 37) · ×1
  • useObserverEvents.useLoadArchivedObserverEvents (cyclomatic 37) desktop/src/features/agents/ui/useObserverEvents.ts:115 — useObserverEvents.useLoadArchivedObserverEvents has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 2 of the 37 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 272, 210, 381, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useAgentManagement.useAgentManagement (cyclomatic 37) · ×1
  • useAgentManagement.useAgentManagement (cyclomatic 37) desktop/src/features/agents/useAgentManagement.ts:37 — useAgentManagement.useAgentManagement has cyclomatic complexity 37 (threshold 15). Of this number, 20 points are the body's own statements and 17 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.
D1 · Cyclomatic Complexity · AddMemberDialog.DirectAddMemberForm (cyclomatic 37) · ×1
  • AddMemberDialog.DirectAddMemberForm (cyclomatic 37) desktop/src/features/community-members/ui/AddMemberDialog.tsx:57 — AddMemberDialog.DirectAddMemberForm has cyclomatic complexity 37 (threshold 15). Of this number, 25 points are the body's own statements and 12 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.
D1 · Cyclomatic Complexity · MicControls.MicControls (cyclomatic 37) · ×1
  • 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.
D1 · Cyclomatic Complexity · SystemMessageRow.SystemMessageRow (cyclomatic 37) · ×1
  • 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.
D1 · Cyclomatic Complexity · machineOnboarding.useMachineOnboardingState (cyclomatic 37) · ×1
  • machineOnboarding.useMachineOnboardingState (cyclomatic 37) desktop/src/features/onboarding/machineOnboarding.ts:99 — machineOnboarding.useMachineOnboardingState has cyclomatic complexity 37 (threshold 15). Of this number, 23 points are the body's own statements and 14 belong to 7 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.
D1 · Cyclomatic Complexity · SettingsPanels.ThemeSettingsCard (cyclomatic 37) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · workflowTriggerDescription.workflowTriggerDescription (cyclomatic 37) · ×1
  • 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.
D1 · Cyclomatic Complexity · UsageTracker · ×1
  • 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.
D1 · Cyclomatic Complexity · _HuddleCallAvatar.build (cyclomatic 36) · ×1
  • _HuddleCallAvatar.build (cyclomatic 36) mobile/lib/features/channels/channel_detail_page/huddle_call_avatar.dart:28 — _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.
D1 · Cyclomatic Complexity · CommunitySwitcher.CommunitySwitcher (cyclomatic 36) · ×1
  • CommunitySwitcher.CommunitySwitcher (cyclomatic 36) desktop/src/features/communities/ui/CommunitySwitcher.tsx:101 — CommunitySwitcher.CommunitySwitcher has cyclomatic complexity 36 (threshold 15). Of this number, 27 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.
D1 · Cyclomatic Complexity · DeviceVoiceNotePlayerController._loadPendingRemote (cyclomatic 35) · ×1
  • DeviceVoiceNotePlayerController._loadPendingRemote (cyclomatic 35) mobile/lib/features/channels/voice_note_recording.dart:591 — 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.
D1 · Cyclomatic Complexity · TeamDialog.TeamDialog (cyclomatic 35) · ×1
  • TeamDialog.TeamDialog (cyclomatic 35) desktop/src/features/agents/ui/TeamDialog.tsx:44 — TeamDialog.TeamDialog has cyclomatic complexity 35 (threshold 15). Of this number, 22 points are the body's own statements and 13 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useCommunityInit.useCommunityInit (cyclomatic 35) · ×1
  • useCommunityInit.useCommunityInit (cyclomatic 35) desktop/src/features/communities/useCommunityInit.ts:128 — 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 180). 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.
D1 · Cyclomatic Complexity · CustomEmojiSettingsCard.CustomEmojiSettingsCard (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · useNewMessageRecipients.useNewMessageRecipients (cyclomatic 35) · ×1
  • useNewMessageRecipients.useNewMessageRecipients (cyclomatic 35) desktop/src/features/messages/ui/useNewMessageRecipients.ts:63 — useNewMessageRecipients.useNewMessageRecipients has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 10 of the 35 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 122, 101, 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.
D1 · Cyclomatic Complexity · PulseView.PulseView (cyclomatic 35) · ×1
  • PulseView.PulseView (cyclomatic 35) desktop/src/features/pulse/ui/PulseView.tsx:75 — PulseView.PulseView has cyclomatic complexity 35 (threshold 15). Of this number, 21 points are the body's own statements and 14 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminalBanner.buildTerminalBanner (cyclomatic 35) · ×1
  • terminalBanner.buildTerminalBanner (cyclomatic 35) desktop/src/features/terminal/terminalBanner.ts:121 — terminalBanner.buildTerminalBanner has cyclomatic complexity 35 (threshold 15). Of this number, 27 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.
D1 · Cyclomatic Complexity · HuddleControlAcceptor · ×1
  • HuddleControlAcceptor::serve_control_loop (cyclomatic 34) crates/buzz-relay/src/audio/join.rs:1156 — HuddleControlAcceptor::serve_control_loop 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.
D1 · Cyclomatic Complexity · BuzzPushPresentationCacheStore.updateChannels (cyclomatic 34) · ×1
  • BuzzPushPresentationCacheStore.updateChannels (cyclomatic 34) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:271 — BuzzPushPresentationCacheStore.updateChannels 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.
D1 · Cyclomatic Complexity · _NewDirectMessageSheet.build (cyclomatic 34) · ×1
  • _NewDirectMessageSheet.build (cyclomatic 34) mobile/lib/features/channels/channels_page/sheets.dart:441 — _NewDirectMessageSheet.build has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MessageContent._buildLink (cyclomatic 34) · ×1
  • MessageContent._buildLink (cyclomatic 34) mobile/lib/features/channels/message_content.dart:400 — 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.
D1 · Cyclomatic Complexity · observedUnreadNativeRig.installNativeRig (cyclomatic 34) · ×1
  • observedUnreadNativeRig.installNativeRig (cyclomatic 34) desktop/src/features/channels/observedUnreadNativeRig.mjs:153 — observedUnreadNativeRig.installNativeRig has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 217, 186, 323, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · VoiceSettingsCard.VoiceSettingsCard (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · BestiePopover.BestiePopover (cyclomatic 34) · ×1
  • 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 literals inside it that branch (lines 467, 354, 357, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · mentionBoundaries.maskMarkdownCode (cyclomatic 34) · ×1
  • 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 literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · entityLink.parseEntityLink (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelActionsSheet.build (cyclomatic 33) · ×1
  • ChannelActionsSheet.build (cyclomatic 33) mobile/lib/features/channels/channel_actions_sheet.dart:78 — 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.
D1 · Cyclomatic Complexity · AdminConsoleStaffingTab.StaffingTab (cyclomatic 33) · ×1
  • AdminConsoleStaffingTab.StaffingTab (cyclomatic 33) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:471 — AdminConsoleStaffingTab.StaffingTab has cyclomatic complexity 33 (threshold 15). Of this number, 19 points are the body's own statements and 14 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.
D1 · Cyclomatic Complexity · ComposerAttachments.ComposerAttachments (cyclomatic 33) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectRepositoryManagement.ProjectRepositoryManagement (cyclomatic 33) · ×1
  • 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.
D1 · Cyclomatic Complexity · localStorageSweep.sweepChunked (cyclomatic 33) · ×1
  • localStorageSweep.sweepChunked (cyclomatic 33) desktop/src/shared/lib/localStorageSweep.ts:152 — localStorageSweep.sweepChunked 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 one function literal inside it that branches (line 215). 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.
D1 · Cyclomatic Complexity · _SystemMessageRow.build (cyclomatic 32) · ×1
  • _SystemMessageRow.build (cyclomatic 32) mobile/lib/features/channels/channel_detail_page/system_rows.dart:22 — _SystemMessageRow.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.
D1 · Cyclomatic Complexity · _SliverChannelsList.build (cyclomatic 32) · ×1
  • _SliverChannelsList.build (cyclomatic 32) mobile/lib/features/channels/channels_page/body.dart:102 — _SliverChannelsList.build has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaVideoViewerPage.build (cyclomatic 32) · ×1
  • MediaVideoViewerPage.build (cyclomatic 32) mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19 — MediaVideoViewerPage.build has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddTeamToChannelDialog.AddTeamToChannelDialog (cyclomatic 32) · ×1
  • AddTeamToChannelDialog.AddTeamToChannelDialog (cyclomatic 32) desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx:47 — AddTeamToChannelDialog.AddTeamToChannelDialog has cyclomatic complexity 32 (threshold 15). Of this number, 27 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.
D1 · Cyclomatic Complexity · ModelPicker.ModelPicker (cyclomatic 32) · ×1
  • 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 literals inside it that branch (lines 175, 80, 66, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · HuddleAttachment.HuddleAttachment (cyclomatic 32) · ×1
  • HuddleAttachment.HuddleAttachment (cyclomatic 32) desktop/src/features/huddle/components/HuddleAttachment.tsx:116 — HuddleAttachment.HuddleAttachment has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useResolvedLinkPreviews.createMetadataLoader (cyclomatic 32) · ×1
  • useResolvedLinkPreviews.createMetadataLoader (cyclomatic 32) desktop/src/shared/lib/useResolvedLinkPreviews.ts:182 — useResolvedLinkPreviews.createMetadataLoader 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 8 function literals inside it that branch (lines 253, 198, 216, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · nostr-client.queryEvents (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · BuzzDevPushEnrollmentDriver.enroll (cyclomatic 31) · ×1
  • BuzzDevPushEnrollmentDriver.enroll (cyclomatic 31) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:406 — BuzzDevPushEnrollmentDriver.enroll has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _IOSInlinePhotoPicker.build (cyclomatic 31) · ×1
  • _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.
D1 · Cyclomatic Complexity · useChannelUnreadState.useChannelUnreadState (cyclomatic 31) · ×1
  • useChannelUnreadState.useChannelUnreadState (cyclomatic 31) desktop/src/features/channels/ui/useChannelUnreadState.ts:62 — useChannelUnreadState.useChannelUnreadState 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 14 function literals inside it that branch (lines 454, 238, 275, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · DownloadKeyStep.DownloadKeyStep (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · useAddProjectRepository.addProjectRepository (cyclomatic 31) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · relayReconnectReplay.replayLiveSubscriptions (cyclomatic 31) · ×1
  • 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 literals inside it that branch (lines 231, 352, 308, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · _InboxRow.build (cyclomatic 30) · ×1
  • _InboxRow.build (cyclomatic 30) mobile/lib/features/activity/activity_page/inbox_row.dart:68 — _InboxRow.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.
D1 · Cyclomatic Complexity · VoiceNoteComposerRecorder.build (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProfileAvatarCropPage.build (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentSessionTranscriptHelpers.parseSystemPromptSections (cyclomatic 30) · ×1
  • agentSessionTranscriptHelpers.parseSystemPromptSections (cyclomatic 30) REDACTED:138 — agentSessionTranscriptHelpers.parseSystemPromptSections 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.
D1 · Cyclomatic Complexity · UserMessageBubble.UserMessageBubble (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · InviteLinkSection.InviteLinkSection (cyclomatic 30) · ×1
  • InviteLinkSection.InviteLinkSection (cyclomatic 30) desktop/src/features/community-members/ui/InviteLinkSection.tsx:47 — InviteLinkSection.InviteLinkSection has cyclomatic complexity 30 (threshold 15). Of this number, 21 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useDrafts.draftStatesEqual (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageActionBar.MessageActionBar (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · hooks.useAppOnboardingState (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · CreatePullRequestDialog.CreatePullRequestDialog (cyclomatic 30) · ×1
  • CreatePullRequestDialog.CreatePullRequestDialog (cyclomatic 30) desktop/src/features/projects/ui/CreatePullRequestDialog.tsx:21 — CreatePullRequestDialog.CreatePullRequestDialog has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProjectEntityListRow.ProjectEntityListRow (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · MergePullRequestButton.MergePullRequestButton (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectRepositoryPanel.RepositoryFilesPanel (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectHomeWorkspaceSheet.ProjectHomeWorkspaceSheet (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · BestieGlobalOverlay.BestieGlobalOverlay (cyclomatic 30) · ×1
  • 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 literals inside it that branch (lines 94, 140, 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.
D1 · Cyclomatic Complexity · VideoPlayer.VideoScrubber (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · VoiceNoteAttachment.build (cyclomatic 29) · ×1
  • VoiceNoteAttachment.build (cyclomatic 29) mobile/lib/features/channels/voice_note_attachment.dart:43 — VoiceNoteAttachment.build 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.
D1 · Cyclomatic Complexity · IosGlassNavigationButton.build (cyclomatic 29) · ×1
  • IosGlassNavigationButton.build (cyclomatic 29) mobile/lib/shared/widgets/ios_glass_navigation_button.dart:106 — IosGlassNavigationButton.build 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.
D1 · Cyclomatic Complexity · PersonaShareRecipients.PersonaShareRecipients (cyclomatic 29) · ×1
  • 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: 13 of the 29 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 187, 72, 236, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useForumMentionPreparation.useForumMentionPreparation (cyclomatic 29) · ×1
  • useForumMentionPreparation.useForumMentionPreparation (cyclomatic 29) desktop/src/features/forum/ui/useForumMentionPreparation.ts:18 — useForumMentionPreparation.useForumMentionPreparation has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 121, 60, 63, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · hooks.useChannelSubscription (cyclomatic 29) · ×1
  • hooks.useChannelSubscription (cyclomatic 29) desktop/src/features/messages/hooks.ts:318 — hooks.useChannelSubscription has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 327, 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.
D1 · Cyclomatic Complexity · useLinkEditor.useLinkEditor (cyclomatic 29) · ×1
  • useLinkEditor.useLinkEditor (cyclomatic 29) desktop/src/features/messages/lib/useLinkEditor.tsx:70 — useLinkEditor.useLinkEditor 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 16 function literals inside it that branch (lines 80, 179, 243, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · FormattingToolbar.FormattingToolbar (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · SetupStep.SetupStepContent (cyclomatic 29) · ×1
  • SetupStep.SetupStepContent (cyclomatic 29) desktop/src/features/onboarding/ui/SetupStep.tsx:963 — SetupStep.SetupStepContent has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProfileAvatar.ProfileAvatar (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectsAgentPromptPage.ProjectsAgentPromptPage (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectAgentChatPanel.ProjectAgentChatPanel (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · LaneReconciler.runAttempt (cyclomatic 29) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · SidebarSection.ChannelMenuButton (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · CodeBlock.SyntaxHighlightedCode (cyclomatic 29) · ×1
  • 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 4 function literals inside it that branch (lines 150, 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.
D1 · Cyclomatic Complexity · AddChannelMembersSheet.build (cyclomatic 28) · ×1
  • AddChannelMembersSheet.build (cyclomatic 28) mobile/lib/features/channels/add_members_sheet.dart:24 — AddChannelMembersSheet.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.
D1 · Cyclomatic Complexity · _HuddleJoinSurface.build (cyclomatic 28) · ×1
  • _HuddleJoinSurface.build (cyclomatic 28) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:258 — _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.
D1 · Cyclomatic Complexity · ManageChannelSheet.build (cyclomatic 28) · ×1
  • ManageChannelSheet.build (cyclomatic 28) mobile/lib/features/channels/manage_channel_sheet.dart:22 — ManageChannelSheet.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.
D1 · Cyclomatic Complexity · PairingNotifier._continueAfterSas (cyclomatic 28) · ×1
  • PairingNotifier._continueAfterSas (cyclomatic 28) mobile/lib/features/pairing/pairing_provider.dart:194 — 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.
D1 · Cyclomatic Complexity · ChannelRouteScreen.ChannelRouteScreen (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · AddAgentToChannelDialog.AddAgentToChannelDialog (cyclomatic 28) · ×1
  • AddAgentToChannelDialog.AddAgentToChannelDialog (cyclomatic 28) desktop/src/features/agents/ui/AddAgentToChannelDialog.tsx:27 — AddAgentToChannelDialog.AddAgentToChannelDialog has cyclomatic complexity 28 (threshold 15). Of this number, 22 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.
D1 · Cyclomatic Complexity · useTeamActions.useTeamActions (cyclomatic 28) · ×1
  • useTeamActions.useTeamActions (cyclomatic 28) desktop/src/features/agents/ui/useTeamActions.ts:63 — useTeamActions.useTeamActions 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.
D1 · Cyclomatic Complexity · ChannelMemberInviteCard.ChannelMemberInviteCard (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · MembersSidebarMemberCard.MembersSidebarMemberCard (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · InboxMessageRow.InboxMessageRow (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageActionBar.MoreActionsMenu (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · SetupStep.RuntimeCard (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · useProfileInteractionActions.useProfileInteractionActions (cyclomatic 28) · ×1
  • useProfileInteractionActions.useProfileInteractionActions (cyclomatic 28) desktop/src/features/profile/ui/useProfileInteractionActions.ts:71 — useProfileInteractionActions.useProfileInteractionActions has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 117, 195, 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.
D1 · Cyclomatic Complexity · useProjectSidebarMembership.useProjectSidebarMembership (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectChannelHome.ProjectChannelHome (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · HarnessRow.HarnessRow (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · GitStore · ×1
  • 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.
D1 · Cyclomatic Complexity · BuzzPushNotificationResolver.refreshPresentation (cyclomatic 27) · ×1
  • BuzzPushNotificationResolver.refreshPresentation (cyclomatic 27) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:305 — BuzzPushNotificationResolver.refreshPresentation 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.
D1 · Cyclomatic Complexity · _MessageBubble.build (cyclomatic 27) · ×1
  • _MessageBubble.build (cyclomatic 27) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:30 — _MessageBubble.build has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _RecentPhotoGalleryPicker.build (cyclomatic 27) · ×1
  • _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.
D1 · Cyclomatic Complexity · useAppShellKeyboardShortcuts.useAppShellKeyboardShortcuts (cyclomatic 27) · ×1
  • 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 one function literal inside it that branches (line 32). 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.
D1 · Cyclomatic Complexity · modelCapabilities.resolveModelCapabilities (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · usePersonaModelDiscovery.usePersonaModelDiscovery (cyclomatic 27) · ×1
  • usePersonaModelDiscovery.usePersonaModelDiscovery (cyclomatic 27) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:171 — usePersonaModelDiscovery.usePersonaModelDiscovery has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 248, 229, 304, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · CompactMessageSummary.CompactMessageSummary (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · useMembersSidebarActions.useMembersSidebarActions (cyclomatic 27) · ×1
  • useMembersSidebarActions.useMembersSidebarActions (cyclomatic 27) desktop/src/features/channels/ui/useMembersSidebarActions.ts:55 — useMembersSidebarActions.useMembersSidebarActions has cyclomatic complexity 27 (threshold 15). Of this number, 24 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.
D1 · Cyclomatic Complexity · AnimatedAvatarControls.AvatarFramingSlider (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePanelTabs.ProfileRuntimeTabContent (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cyclomatic 27) · ×1
  • useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cyclomatic 27) desktop/src/features/sidebar/ui/useSidebarRelayConnectionCard.ts:63 — useSidebarRelayConnectionCard.useSidebarRelayConnectionCard has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 5 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.
D1 · Cyclomatic Complexity · CommunityThemeController.CommunityThemeController (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · SubscriptionRegistry · ×1
  • 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.
D1 · Cyclomatic Complexity · _InlineCameraPreview.build (cyclomatic 26) · ×1
  • _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.
D1 · Cyclomatic Complexity · _ThreadMessage.build (cyclomatic 26) · ×1
  • _ThreadMessage.build (cyclomatic 26) mobile/lib/features/channels/thread_detail_page/thread_message.dart:35 — _ThreadMessage.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.
D1 · Cyclomatic Complexity · PersonaModelCombobox.PersonaModelCombobox (cyclomatic 26) · ×1
  • PersonaModelCombobox.PersonaModelCombobox (cyclomatic 26) desktop/src/features/agents/ui/PersonaModelCombobox.tsx:21 — PersonaModelCombobox.PersonaModelCombobox has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 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.
D1 · Cyclomatic Complexity · MembersSidebarMemberCard.MemberActionsMenu (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · WelcomeSetup.WelcomeSetup (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · homePaneLayout.getHomePaneLayout (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · ParticipantList.HuddleParticipantsControl (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · hooks.useSendMessageMutation (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentSnapshotClipboard.parseSnapshotClipboardHtml (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · HarnessCatalogDialog.HarnessCatalogDialog (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelTemplatesSettingsCard.TemplateFormDialog (cyclomatic 26) · ×1
  • ChannelTemplatesSettingsCard.TemplateFormDialog (cyclomatic 26) desktop/src/features/settings/ui/ChannelTemplatesSettingsCard.tsx:291 — ChannelTemplatesSettingsCard.TemplateFormDialog has cyclomatic complexity 26 (threshold 15). Of this number, 14 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.
D1 · Cyclomatic Complexity · useChannelMutes.useChannelMutes (cyclomatic 26) · ×1
  • useChannelMutes.useChannelMutes (cyclomatic 26) desktop/src/features/sidebar/lib/useChannelMutes.ts:19 — useChannelMutes.useChannelMutes has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 77, 142, 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.
D1 · Cyclomatic Complexity · useChannelStars.useChannelStars (cyclomatic 26) · ×1
  • useChannelStars.useChannelStars (cyclomatic 26) desktop/src/features/sidebar/lib/useChannelStars.ts:19 — useChannelStars.useChannelStars has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 77, 142, 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.
D1 · Cyclomatic Complexity · workflowFormTypes.actionFieldsForStep (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · RelayClient.handleWsMessage (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · useResolvedLinkPreviews.useResolvedLinkPreviews (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · RepoBlobViewer.RepoBlobPage (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · eventToProjectPullRequest (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · desktop_release.validate (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · ActivityNotifier._fetch (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · FrostedAppBar.build (cyclomatic 25) · ×1
  • FrostedAppBar.build (cyclomatic 25) mobile/lib/shared/widgets/frosted_app_bar.dart:172 — FrostedAppBar.build 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.
D1 · Cyclomatic Complexity · useAppNavigation.useAppNavigation (cyclomatic 25) · ×1
  • useAppNavigation.useAppNavigation (cyclomatic 25) desktop/src/app/navigation/useAppNavigation.ts:24 — useAppNavigation.useAppNavigation has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 131, 264, 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.
D1 · Cyclomatic Complexity · agentManagement.parseAgentManagementRequest (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · EnvVarsEditor.EnvVarsEditor (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentConfigControls.AgentDropdownSelect (cyclomatic 25) · ×1
  • agentConfigControls.AgentDropdownSelect (cyclomatic 25) desktop/src/features/agents/ui/agentConfigControls.tsx:112 — agentConfigControls.AgentDropdownSelect has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 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.
D1 · Cyclomatic Complexity · AddChannelBotDialog.AddChannelBotDialog (cyclomatic 25) · ×1
  • AddChannelBotDialog.AddChannelBotDialog (cyclomatic 25) desktop/src/features/channels/ui/AddChannelBotDialog.tsx:55 — AddChannelBotDialog.AddChannelBotDialog has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CanvasHistoryPanel.CanvasHistoryPanel (cyclomatic 25) · ×1
  • CanvasHistoryPanel.CanvasHistoryPanel (cyclomatic 25) desktop/src/features/channels/ui/CanvasHistoryPanel.tsx:51 — CanvasHistoryPanel.CanvasHistoryPanel has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 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.
D1 · Cyclomatic Complexity · ChannelScreenHeader.ChannelScreenHeader (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · useRoutedMessageEdit.useRoutedMessageEdit (cyclomatic 25) · ×1
  • useRoutedMessageEdit.useRoutedMessageEdit (cyclomatic 25) desktop/src/features/channels/ui/useRoutedMessageEdit.ts:21 — useRoutedMessageEdit.useRoutedMessageEdit has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 71, 58, 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.
D1 · Cyclomatic Complexity · useEmojiAutocomplete.useEmojiAutocomplete (cyclomatic 25) · ×1
  • useEmojiAutocomplete.useEmojiAutocomplete (cyclomatic 25) desktop/src/features/messages/lib/useEmojiAutocomplete.ts:50 — useEmojiAutocomplete.useEmojiAutocomplete has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 218, 156, 68, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · hooks.useFirstRunOnboardingGate (cyclomatic 25) · ×1
  • hooks.useFirstRunOnboardingGate (cyclomatic 25) desktop/src/features/onboarding/hooks.ts:282 — hooks.useFirstRunOnboardingGate has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 5 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.
D1 · Cyclomatic Complexity · projectChannelRequest.parseProjectChannelRequest (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectPullRequestFilesChangedPanel.DiffPreview (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectReadmePanel.ReadmePanel (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · SendFeedbackDialog.SendFeedbackDialog (cyclomatic 25) · ×1
  • SendFeedbackDialog.SendFeedbackDialog (cyclomatic 25) desktop/src/features/settings/ui/SendFeedbackDialog.tsx:65 — SendFeedbackDialog.SendFeedbackDialog has cyclomatic complexity 25 (threshold 15). Of this number, 21 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.
D1 · Cyclomatic Complexity · SidebarProjectsSection.SidebarProjectsSectionContent (cyclomatic 25) · ×1
  • 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 literals inside it that branch (lines 226, 299, 211, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · inviteHelpers.parseInviteInput (cyclomatic 25) · ×1
  • inviteHelpers.parseInviteInput (cyclomatic 25) desktop/src/shared/api/inviteHelpers.ts: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.
D1 · Cyclomatic Complexity · linkPreviewSnapshot.parseLinkPreviewSnapshots (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelsNotifier._catchUpUnreadEvents (cyclomatic 24) · ×1
  • ChannelsNotifier._catchUpUnreadEvents (cyclomatic 24) mobile/lib/features/channels/channels_provider.dart:535 — ChannelsNotifier._catchUpUnreadEvents 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.
D1 · Cyclomatic Complexity · RelaySessionNotifier._handleClosed (cyclomatic 24) · ×1
  • RelaySessionNotifier._handleClosed (cyclomatic 24) mobile/lib/shared/relay/relay_session.dart:710 — RelaySessionNotifier._handleClosed 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.
D1 · Cyclomatic Complexity · CommunityThemeNotifier.build (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentSessionToolCatalog.getBuzzToolInfo (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · ManagedAgentLogPanel.ManagedAgentLogPanel (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · BotActivityBar.BotActivityComposerAction (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · AddAgentDialog.AddAgentDialog (cyclomatic 24) · ×1
  • AddAgentDialog.AddAgentDialog (cyclomatic 24) desktop/src/features/huddle/components/AddAgentDialog.tsx:31 — AddAgentDialog.AddAgentDialog has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · useAutoPinMentionedAgents.useAutoPinMentionedAgents (cyclomatic 24) · ×1
  • useAutoPinMentionedAgents.useAutoPinMentionedAgents (cyclomatic 24) desktop/src/features/messages/ui/useAutoPinMentionedAgents.ts:35 — useAutoPinMentionedAgents.useAutoPinMentionedAgents 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 7 function literals inside it that branch (lines 138, 92, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · use-feed-desktop-notifications.useFeedDesktopNotifications (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · SetupStep.RuntimeProvidersSection (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePanelFields.buildOwnerFields (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectRepositoryPanel.fileIconVisual (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectsChannelsList.ProjectsChannelsList (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · useProjectChannelRequests.useProjectChannelRequests (cyclomatic 24) · ×1
  • useProjectChannelRequests.useProjectChannelRequests (cyclomatic 24) desktop/src/features/projects/useProjectChannelRequests.ts:21 — useProjectChannelRequests.useProjectChannelRequests has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EncryptedBackupProvider.EncryptedBackupProvider (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · use-updater.useUpdater (cyclomatic 24) · ×1
  • use-updater.useUpdater (cyclomatic 24) desktop/src/features/settings/hooks/use-updater.ts:54 — use-updater.useUpdater 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 125, 68, 79, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WorkflowMessageTextConditionEditor.WorkflowMessageTextCondition (cyclomatic 24) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · ThemeProvider.ThemeProvider (cyclomatic 24) · ×1
  • ThemeProvider.ThemeProvider (cyclomatic 24) desktop/src/shared/theme/ThemeProvider.tsx:480 — 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 678, 537, 555, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MessageLinkPill.MessageLinkPillContents (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · RepoDetailPage.RepoDetailPage (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · desktop_release.previous_release (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · DeviceVoiceNotePlayerController._toggle (cyclomatic 23) · ×1
  • DeviceVoiceNotePlayerController._toggle (cyclomatic 23) mobile/lib/features/channels/voice_note_recording.dart:807 — 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.
D1 · Cyclomatic Complexity · AgentCardMintDialog.AgentCardMintDialog (cyclomatic 23) · ×1
  • AgentCardMintDialog.AgentCardMintDialog (cyclomatic 23) desktop/src/features/agents/ui/AgentCardMintDialog.tsx:106 — AgentCardMintDialog.AgentCardMintDialog 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.
D1 · Cyclomatic Complexity · RespondToField.AllowlistPicker (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelMembersBar.ChannelMembersBar (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · useChannelPaneHandlers.useChannelPaneHandlers (cyclomatic 23) · ×1
  • useChannelPaneHandlers.useChannelPaneHandlers (cyclomatic 23) desktop/src/features/channels/useChannelPaneHandlers.ts:24 — useChannelPaneHandlers.useChannelPaneHandlers 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 11 function literals inside it that branch (lines 346, 174, 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.
D1 · Cyclomatic Complexity · CommunityMembersSettingsCard.RelayMemberRow (cyclomatic 23) · ×1
  • CommunityMembersSettingsCard.RelayMemberRow (cyclomatic 23) desktop/src/features/community-members/ui/CommunityMembersSettingsCard.tsx:91 — CommunityMembersSettingsCard.RelayMemberRow 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.
D1 · Cyclomatic Complexity · useHomeInboxReadState.useHomeInboxReadState (cyclomatic 23) · ×1
  • useHomeInboxReadState.useHomeInboxReadState (cyclomatic 23) desktop/src/features/home/useHomeInboxReadState.ts:147 — useHomeInboxReadState.useHomeInboxReadState 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 3 function literals inside it that branch (lines 211, 171, 276). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · sendToChannelSemantics.getSendToChannelSemantics (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · useDrafts.isValidDraftState (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · ComposerUploadProgressPill.ComposerUploadProgressPill (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · useNonMemberInvite.useNonMemberInvite (cyclomatic 23) · ×1
  • useNonMemberInvite.useNonMemberInvite (cyclomatic 23) desktop/src/features/messages/ui/useNonMemberInvite.ts:15 — useNonMemberInvite.useNonMemberInvite has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 94, 60, 79, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · SetupStep.RuntimeStatus (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · hooks.usePresenceSession (cyclomatic 23) · ×1
  • hooks.usePresenceSession (cyclomatic 23) desktop/src/features/presence/hooks.ts:224 — hooks.usePresenceSession has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 362, 265, 298, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AvatarCustomColorPanel.AvatarCustomColorPanel (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfileAgentActions.UserProfileAgentSettingsMenu (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectPullRequestFilesChangedPanel.changedFileIconVisual (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectDetailFeedPanels.ContributorsPanel (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflowDefinition.getActionCardClause (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · BloomMenu.Container (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · markdown.ImageBlock (cyclomatic 23) · ×1
  • 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 literals inside it that branch (lines 1089, 1008, 1057, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ClientMessage · ×1
  • ClientMessage::parse (cyclomatic 22) crates/buzz-relay/src/protocol.rs:43 — 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.
D1 · Cyclomatic Complexity · WorkflowEngine · ×1
  • WorkflowEngine::run (cyclomatic 22) crates/buzz-workflow/src/lib.rs:489 — 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.
D1 · Cyclomatic Complexity · AppDelegate.handleMediaUploadMethodCall (cyclomatic 22) · ×1
  • AppDelegate.handleMediaUploadMethodCall (cyclomatic 22) mobile/ios/Runner/AppDelegate.swift:649 — 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.
D1 · Cyclomatic Complexity · NativeEmojiCategoryTracker.selectedSectionID (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfileSheet.build (cyclomatic 22) · ×1
  • UserProfileSheet.build (cyclomatic 22) mobile/lib/features/profile/user_profile_sheet.dart:47 — UserProfileSheet.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.
D1 · Cyclomatic Complexity · SearchPage.build (cyclomatic 22) · ×1
  • SearchPage.build (cyclomatic 22) mobile/lib/features/search/search_page.dart:105 — SearchPage.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.
D1 · Cyclomatic Complexity · BuzzPushBootstrap.build (cyclomatic 22) · ×1
  • BuzzPushBootstrap.build (cyclomatic 22) mobile/lib/shared/push/push_bootstrap.dart:160 — BuzzPushBootstrap.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.
D1 · Cyclomatic Complexity · CommunityThemeSyncManager.flush (cyclomatic 22) · ×1
  • CommunityThemeSyncManager.flush (cyclomatic 22) mobile/lib/shared/theme/community_theme_sync.dart:232 — 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.
D1 · Cyclomatic Complexity · AdminConsoleReportsTab.ResolveReportForm (cyclomatic 22) · ×1
  • AdminConsoleReportsTab.ResolveReportForm (cyclomatic 22) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:362 — AdminConsoleReportsTab.ResolveReportForm has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ChannelCanvas.ChannelCanvas (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · useCommunities.resolveCommunityUpdateResult (cyclomatic 22) · ×1
  • useCommunities.resolveCommunityUpdateResult (cyclomatic 22) desktop/src/features/communities/useCommunities.tsx:42 — 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.
D1 · Cyclomatic Complexity · DefaultConfigStep.AgentDefaultsSection (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · avatarProfileSync.createAvatarProfileSync (cyclomatic 22) · ×1
  • avatarProfileSync.createAvatarProfileSync (cyclomatic 22) desktop/src/features/profile/avatarProfileSync.ts:48 — avatarProfileSync.createAvatarProfileSync has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 76, 89, 101, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · RemindersPanel.ReminderRow (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · NotificationSettingsCard.NotificationSettingsCard (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · WorkflowsView.WorkflowsView (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ReadOnlyRelayClient.handleWsMessage (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · buzz_deletion · ×1
  • buzz_deletion::execute_stage (cyclomatic 21) crates/buzz-deletion/src/lib.rs:1193 — buzz_deletion::execute_stage 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.
D1 · Cyclomatic Complexity · acceptance.explore (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · MediaSanitizer.scrubJpeg (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · _MobileHuddleCallPage.build (cyclomatic 21) · ×1
  • _MobileHuddleCallPage.build (cyclomatic 21) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:539 — _MobileHuddleCallPage.build 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.
D1 · Cyclomatic Complexity · ChannelMessagesNotifier._handleLiveEvent (cyclomatic 21) · ×1
  • ChannelMessagesNotifier._handleLiveEvent (cyclomatic 21) mobile/lib/features/channels/channel_messages_provider.dart:285 — 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.
D1 · Cyclomatic Complexity · ChannelsPage.build (cyclomatic 21) · ×1
  • ChannelsPage.build (cyclomatic 21) mobile/lib/features/channels/channels_page.dart:178 — ChannelsPage.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.
D1 · Cyclomatic Complexity · PairingPage.build (cyclomatic 21) · ×1
  • PairingPage.build (cyclomatic 21) mobile/lib/features/pairing/pairing_page.dart:40 — PairingPage.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.
D1 · Cyclomatic Complexity · ProfileTextEditSheet.build (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · _SetStatusSheet.build (cyclomatic 21) · ×1
  • _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.
D1 · Cyclomatic Complexity · useApplyTemplate.useApplyTemplate (cyclomatic 21) · ×1
  • useApplyTemplate.useApplyTemplate (cyclomatic 21) desktop/src/features/channel-templates/useApplyTemplate.ts:29 — useApplyTemplate.useApplyTemplate 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.
D1 · Cyclomatic Complexity · ReadStateManager.mergeEvents (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · resolveLinkAt.resolveLinkAt (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · useChannelLinks.useChannelLinks (cyclomatic 21) · ×1
  • useChannelLinks.useChannelLinks (cyclomatic 21) desktop/src/features/messages/lib/useChannelLinks.ts:47 — useChannelLinks.useChannelLinks 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 9 function literals inside it that branch (lines 157, 80, 87, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useComposerVoiceNote.useComposerVoiceNote (cyclomatic 21) · ×1
  • useComposerVoiceNote.useComposerVoiceNote (cyclomatic 21) desktop/src/features/messages/ui/useComposerVoiceNote.tsx:13 — useComposerVoiceNote.useComposerVoiceNote 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 7 function literals inside it that branch (lines 71, 110, 57, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · SelectionFormattingTray.SelectionFormattingTray (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · useChannelTyping.useChannelTyping (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · hooks.useNotificationSettings (cyclomatic 21) · ×1
  • hooks.useNotificationSettings (cyclomatic 21) desktop/src/features/notifications/hooks.ts:182 — hooks.useNotificationSettings 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 5 function literals inside it that branch (lines 315, 245, 236, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · selfProfileStorage.trimSelfProfileCaches (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePanelTabs.ProfileLiveActivityEmbed (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePrimaryActions.ProfilePrimaryActions (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · projectActivity.summarizeProjectActivityEvents (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectsActivityFeed.buildActivityItems (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectsActivityFeed.ActivityCard (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · CronExpressionInput.CronExpressionInput (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · useWebviewScrollBoundaryLock.useWebviewScrollBoundaryLock (cyclomatic 21) · ×1
  • 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 one function literal inside it that branches (line 85). 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.
D1 · Cyclomatic Complexity · compact-link-preview-attachment.CompactLinkPreviewAttachment (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · useInlineTooltipPosition.useInlineTooltipPosition (cyclomatic 21) · ×1
  • useInlineTooltipPosition.useInlineTooltipPosition (cyclomatic 21) desktop/src/shared/ui/markdown/useInlineTooltipPosition.ts:12 — useInlineTooltipPosition.useInlineTooltipPosition 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 9 function literals inside it that branch (lines 19, 41, 95, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PkceOAuthTokenSource · ×1
  • 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.
D1 · Cyclomatic Complexity · buzz_persona · ×1
  • 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.
D1 · Cyclomatic Complexity · WorkflowDef · ×1
  • 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.
D1 · Cyclomatic Complexity · HuddleAudioEngine.runCapture (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · NativeEmojiPickerDataLoader.parse (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelQuickActionsLauncher.build (cyclomatic 20) · ×1
  • ChannelQuickActionsLauncher.build (cyclomatic 20) mobile/lib/features/channels/channels_page/quick_actions_launcher.dart:42 — ChannelQuickActionsLauncher.build 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.
D1 · Cyclomatic Complexity · _ThreadStickyDateIndex.resolve (cyclomatic 20) · ×1
  • _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.
D1 · Cyclomatic Complexity · PairingNotifier._handlePairingEvent (cyclomatic 20) · ×1
  • PairingNotifier._handlePairingEvent (cyclomatic 20) mobile/lib/features/pairing/pairing_provider.dart:513 — PairingNotifier._handlePairingEvent 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.
D1 · Cyclomatic Complexity · _ThemePreviewExperience.build (cyclomatic 20) · ×1
  • _ThemePreviewExperience.build (cyclomatic 20) mobile/lib/features/settings/theme_picker_page/theme_preview_sheet.dart:11 — _ThemePreviewExperience.build 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.
D1 · Cyclomatic Complexity · HuddleSessionNotifier._wireMediaAndTransport (cyclomatic 20) · ×1
  • HuddleSessionNotifier._wireMediaAndTransport (cyclomatic 20) mobile/lib/shared/huddle/huddle_session.dart:400 — 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.
D1 · Cyclomatic Complexity · BuzzPushLeaseDescriptor.fromRelayInformation (cyclomatic 20) · ×1
  • BuzzPushLeaseDescriptor.fromRelayInformation (cyclomatic 20) mobile/lib/shared/push/dev_push_lease.dart:44 — BuzzPushLeaseDescriptor.fromRelayInformation 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.
D1 · Cyclomatic Complexity · useAppShellDesktopNotifications.useAppShellDesktopNotifications (cyclomatic 20) · ×1
  • useAppShellDesktopNotifications.useAppShellDesktopNotifications (cyclomatic 20) desktop/src/app/useAppShellDesktopNotifications.ts:27 — useAppShellDesktopNotifications.useAppShellDesktopNotifications has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 71, 106, 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.
D1 · Cyclomatic Complexity · ToolDetailBlocks.ToolDetailBlocks (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · AgentSessionTranscriptList.AgentSessionTranscriptList (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · EditCommunityDialog.EditCommunityDialog (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · useHuddleParticipantRoster.reconstructHuddleParticipantRoster (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · LocalArchiveSettingsCard.LocalArchiveSettingsCard (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · MeshComputeSettingsCard.StatusLine (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · mentionHighlightExtension.selectionAfterMentionTrailingSpace (cyclomatic 20) · ×1
  • mentionHighlightExtension.selectionAfterMentionTrailingSpace (cyclomatic 20) desktop/src/features/messages/lib/mentionHighlightExtension.ts: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.
D1 · Cyclomatic Complexity · useVirtualizedBottomSettle.useVirtualizedBottomSettle (cyclomatic 20) · ×1
  • useVirtualizedBottomSettle.useVirtualizedBottomSettle (cyclomatic 20) desktop/src/features/messages/ui/useVirtualizedBottomSettle.ts:22 — useVirtualizedBottomSettle.useVirtualizedBottomSettle has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 74, 42, 101, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NsecMaskedDisplay.NsecMaskedDisplay (cyclomatic 20) · ×1
  • NsecMaskedDisplay.NsecMaskedDisplay (cyclomatic 20) desktop/src/features/onboarding/ui/NsecMaskedDisplay.tsx:48 — NsecMaskedDisplay.NsecMaskedDisplay has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProfileStep.ProfileStep (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePanelTabs.ProfileInfoTabContent (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · HarnessCatalogDialog.CatalogDetail (cyclomatic 20) · ×1
  • HarnessCatalogDialog.CatalogDetail (cyclomatic 20) desktop/src/features/settings/ui/HarnessCatalogDialog.tsx:451 — HarnessCatalogDialog.CatalogDetail has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · workflowStepDescription.configuredStepDetail (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · WorkflowTemplateTextarea.WorkflowTemplateTextarea (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · RelayClient.sendRawWithReconnectRetry (cyclomatic 20) · ×1
  • 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 literals inside it that branch (lines 786, 762, 753, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · entityLinks.EntityMetadataTooltip (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · segmented-control.SegmentedControl (cyclomatic 20) · ×1
  • 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 literals inside it that branch (lines 121, 83, 105, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · installNativeRig · ×1
  • 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.
D1 · Cyclomatic Complexity · NavigationGlassButtonPlatformView.applyContent (cyclomatic 19) · ×1
  • NavigationGlassButtonPlatformView.applyContent (cyclomatic 19) mobile/ios/Runner/JumpToLatestGlassButton.swift:393 — NavigationGlassButtonPlatformView.applyContent 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.
D1 · Cyclomatic Complexity · BuzzPushPresentationCacheStore.updateProfiles (cyclomatic 19) · ×1
  • BuzzPushPresentationCacheStore.updateProfiles (cyclomatic 19) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:196 — BuzzPushPresentationCacheStore.updateProfiles 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.
D1 · Cyclomatic Complexity · _HuddleButton.build (cyclomatic 19) · ×1
  • _HuddleButton.build (cyclomatic 19) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:159 — _HuddleButton.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.
D1 · Cyclomatic Complexity · _AttachmentSurfacePanel.build (cyclomatic 19) · ×1
  • _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.
D1 · Cyclomatic Complexity · AgentCardViewerDialog.AgentCardViewerContent (cyclomatic 19) · ×1
  • AgentCardViewerDialog.AgentCardViewerContent (cyclomatic 19) desktop/src/features/agents/ui/AgentCardViewerDialog.tsx:90 — AgentCardViewerDialog.AgentCardViewerContent has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · agentDefinitionSubmitPayload.buildRuntimeModelProviderPayload (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentSessionTranscriptGrouping.splitIntoSessionRuns (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · ForumView.ForumView (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · useHuddleParticipantRoster.compareLifecycleEvents (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageReactions.MessageReactions (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · SystemMessageRow.describeSystemEvent (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · AddProjectRepositoryDialog.AddProjectRepositoryDialog (cyclomatic 19) · ×1
  • AddProjectRepositoryDialog.AddProjectRepositoryDialog (cyclomatic 19) desktop/src/features/projects/ui/AddProjectRepositoryDialog.tsx:17 — AddProjectRepositoryDialog.AddProjectRepositoryDialog has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProjectConversationPanelContext.ProjectConversationPanelController (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectPullRequestFilesChangedPanel.ProjectDiffFilesPanel (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · CustomHarnessForm.CustomHarnessForm (cyclomatic 19) · ×1
  • CustomHarnessForm.CustomHarnessForm (cyclomatic 19) desktop/src/features/settings/ui/CustomHarnessForm.tsx:206 — CustomHarnessForm.CustomHarnessForm has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SidebarSection.SidebarSection (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · CommunityThemeSyncManager.doPublish (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · SpoilerParticles.mountSpoilerParticleCanvas (cyclomatic 19) · ×1
  • 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 literals inside it that branch (lines 91, 138, 116, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AgentSnapshotCard.AgentSnapshotCard (cyclomatic 19) · ×1
  • AgentSnapshotCard.AgentSnapshotCard (cyclomatic 19) desktop/src/shared/ui/markdown/AgentSnapshotCard.tsx:59 — AgentSnapshotCard.AgentSnapshotCard 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.
D1 · Cyclomatic Complexity · buzz_push_gateway · ×1
  • buzz_push_gateway::http::deliver (cyclomatic 18) crates/buzz-push-gateway/src/http.rs:654 — buzz_push_gateway::http::deliver 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.
D1 · Cyclomatic Complexity · ThemePaginationControl.updateDots (cyclomatic 18) · ×1
  • ThemePaginationControl.updateDots (cyclomatic 18) mobile/ios/Runner/ThemePaginationGlassControl.swift:164 — ThemePaginationControl.updateDots 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.
D1 · Cyclomatic Complexity · BuzzDevPushEnrollmentDriver.completeEnrollment (cyclomatic 18) · ×1
  • BuzzDevPushEnrollmentDriver.completeEnrollment (cyclomatic 18) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:609 — BuzzDevPushEnrollmentDriver.completeEnrollment 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.
D1 · Cyclomatic Complexity · _DmAppBarTitle.build (cyclomatic 18) · ×1
  • _DmAppBarTitle.build (cyclomatic 18) mobile/lib/features/channels/channel_detail_page/app_bar.dart:201 — _DmAppBarTitle.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.
D1 · Cyclomatic Complexity · MessageContent.build (cyclomatic 18) · ×1
  • MessageContent.build (cyclomatic 18) mobile/lib/features/channels/message_content.dart:159 — MessageContent.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.
D1 · Cyclomatic Complexity · MobileHuddleController.end (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · InviteJoinSheet.build (cyclomatic 18) · ×1
  • InviteJoinSheet.build (cyclomatic 18) mobile/lib/features/invites/invite_join_sheet.dart:39 — 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.
D1 · Cyclomatic Complexity · SettingsProfileHeader.build (cyclomatic 18) · ×1
  • SettingsProfileHeader.build (cyclomatic 18) mobile/lib/features/profile/settings_profile_header.dart:31 — SettingsProfileHeader.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.
D1 · Cyclomatic Complexity · MethodChannelHuddleMedia._handleNativeCall (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · AdminConsoleFeedbackTab.AttachmentViewer (cyclomatic 18) · ×1
  • AdminConsoleFeedbackTab.AttachmentViewer (cyclomatic 18) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx:170 — 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 216, 277, 206, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MemorySection.MemoryGraphView (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · usePersonaSync.startPersonaSync (cyclomatic 18) · ×1
  • 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 literals inside it that branch (lines 377, 337, 343, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AgentConfigPanel.AgentConfigSurfaceRows (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · useManagedAgentRuntimeReconciliation.useManagedAgentRuntimeReconciliation (cyclomatic 18) · ×1
  • 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, 118, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useHuddleParticipantRoster.useHuddleParticipantRoster (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · ComposerAddressControls.ComposerMentionButton (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageReactions.ReactionPill (cyclomatic 18) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · MessageModerationMenuItems.MessageModerationMenuItems (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · AvatarStep.AvatarStep (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentReadiness.resolveAgentReadiness (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · AnimatedAvatarCameraControls.AnimatedAvatarCameraControls (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · projectDetailAgentContext.projectDetailAgentContextBlock (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectRepositorySource.RepoSourceDropdown (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · SignOutSection.SignOutSection (cyclomatic 18) · ×1
  • SignOutSection.SignOutSection (cyclomatic 18) desktop/src/features/settings/ui/SignOutSection.tsx:43 — SignOutSection.SignOutSection 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · markdownFileCard.resolveSnapshotCard (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · sidebar-action-card.SidebarCompactActionCard (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · buzz-download.normalizeOperatingSystem (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · assignmentStateForIssue (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · buzz_admin · ×1
  • buzz_admin::reconcile_channels (cyclomatic 17) crates/buzz-admin/src/main.rs:623 — buzz_admin::reconcile_channels 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.
D1 · Cyclomatic Complexity · git_sign_nostr · ×1
  • 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.
D1 · Cyclomatic Complexity · _MobileHuddleDrawer.build (cyclomatic 17) · ×1
  • _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.
D1 · Cyclomatic Complexity · _HuddleParticipantCluster.build (cyclomatic 17) · ×1
  • _HuddleParticipantCluster.build (cyclomatic 17) mobile/lib/features/channels/channel_detail_page/huddle_participant_cluster.dart:63 — _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.
D1 · Cyclomatic Complexity · _ComposeBarLayout._buildBar (cyclomatic 17) · ×1
  • _ComposeBarLayout._buildBar (cyclomatic 17) mobile/lib/features/channels/compose_bar/layout.dart:84 — _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.
D1 · Cyclomatic Complexity · _DeepLinkDispatcherState._maybeDispatchInvite (cyclomatic 17) · ×1
  • _DeepLinkDispatcherState._maybeDispatchInvite (cyclomatic 17) mobile/lib/features/channels/deep_link_dispatcher.dart:160 — _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.
D1 · Cyclomatic Complexity · _PersonInviteSection.build (cyclomatic 17) · ×1
  • _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.
D1 · Cyclomatic Complexity · InviteJoinNotifier.confirmJoin (cyclomatic 17) · ×1
  • InviteJoinNotifier.confirmJoin (cyclomatic 17) mobile/lib/features/invites/invite_join_provider.dart:159 — 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.
D1 · Cyclomatic Complexity · _SearchBody.build (cyclomatic 17) · ×1
  • _SearchBody.build (cyclomatic 17) mobile/lib/features/search/search_page.dart:439 — _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.
D1 · Cyclomatic Complexity · HuddleSessionNotifier.join (cyclomatic 17) · ×1
  • HuddleSessionNotifier.join (cyclomatic 17) mobile/lib/shared/huddle/huddle_session.dart:214 — 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.
D1 · Cyclomatic Complexity · HuddleTransport._handleRoster (cyclomatic 17) · ×1
  • HuddleTransport._handleRoster (cyclomatic 17) mobile/lib/shared/huddle/huddle_transport.dart:628 — 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.
D1 · Cyclomatic Complexity · BuzzPushLeaseSubscriptionState.fromJson (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · channelAgents.provisionChannelManagedAgent (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentConfigOptions.computeLocalModeGate (cyclomatic 17) · ×1
  • agentConfigOptions.computeLocalModeGate (cyclomatic 17) REDACTED:653 — 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.
D1 · Cyclomatic Complexity · EditAgentAdvancedFields.EditAgentAdvancedFields (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · LifecycleActivity.LifecycleActivity (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentSessionTranscriptGrouping.buildBlocksForRun (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · communityUnreadObserver.fetchCommunityUnread (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · CommunityMembersCard.MemberRow (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · useForumDraftRecovery.useForumDraftRecovery (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · channelLink.parseChannelLink (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · timelineItems.buildTimelineItems (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · useLoadMissingAncestors.useLoadMissingAncestors (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · AnimatedAvatarControls.AvatarFilmstripPicker (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · UserProfilePanelUtils.personaManagedAgentUpdate (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · CreateProjectWorkItemDialog.CreateProjectWorkItemDialog (cyclomatic 17) · ×1
  • CreateProjectWorkItemDialog.CreateProjectWorkItemDialog (cyclomatic 17) desktop/src/features/projects/ui/CreateProjectWorkItemDialog.tsx:25 — CreateProjectWorkItemDialog.CreateProjectWorkItemDialog has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateProjectFormSettings.CreateProjectFormSettings (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectsAgentPromptPage.ConversationThread (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectHomeContextPanel.ProjectHomeContextPanel (cyclomatic 17) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · NoteCard.NoteCard (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · PrivateKeyBackupRow.PrivateKeyBackupRow (cyclomatic 17) · ×1
  • PrivateKeyBackupRow.PrivateKeyBackupRow (cyclomatic 17) desktop/src/features/settings/ui/PrivateKeyBackupRow.tsx:60 — PrivateKeyBackupRow.PrivateKeyBackupRow 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.
D1 · Cyclomatic Complexity · useCreateChannelForm.useCreateChannelForm (cyclomatic 17) · ×1
  • useCreateChannelForm.useCreateChannelForm (cyclomatic 17) desktop/src/features/sidebar/lib/useCreateChannelForm.ts:60 — useCreateChannelForm.useCreateChannelForm 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 6 function literals inside it that branch (lines 156, 102, 128, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · SidebarDnd.SidebarDndContext (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · workflowConditionExpression.splitTopLevel (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · RelayClient.resetConnection (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · RelayReconnectController.start (cyclomatic 17) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · emojiOnly.readGrapheme (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · EmojiBurstProvider.EmojiBurstProvider (cyclomatic 17) · ×1
  • 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 6 function literals inside it that branch (lines 567, 671, 686, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · parseImeta.parseImetaTags (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · sidebar.SidebarRail (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · buzz_backend_kubernetes · ×1
  • 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.
D1 · Cyclomatic Complexity · BuzzClient · ×1
  • 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.
D1 · Cyclomatic Complexity · Db · ×1
  • Db::route_read (cyclomatic 16) crates/buzz-db/src/runtime/mod.rs:1273 — 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.
D1 · Cyclomatic Complexity · AndroidMediaSanitizer.scrubJpeg (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · exhaustive.test_cross_device_compaction_suppression (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · AppDelegate.didInitializeImplicitFlutterEngine (cyclomatic 16) · ×1
  • AppDelegate.didInitializeImplicitFlutterEngine (cyclomatic 16) mobile/ios/Runner/AppDelegate.swift:56 — AppDelegate.didInitializeImplicitFlutterEngine 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.
D1 · Cyclomatic Complexity · ActivityNotifier._resurfaceHiddenDm (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelMessagesNotifier.cachedThreadReplyIds (cyclomatic 16) · ×1
  • ChannelMessagesNotifier.cachedThreadReplyIds (cyclomatic 16) mobile/lib/features/channels/channel_messages_provider.dart:536 — 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.
D1 · Cyclomatic Complexity · _MorphingQuickActionsButton.build (cyclomatic 16) · ×1
  • _MorphingQuickActionsButton.build (cyclomatic 16) mobile/lib/features/channels/channels_page/quick_actions.dart:31 — _MorphingQuickActionsButton.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.
D1 · Cyclomatic Complexity · _MentionSuggestionInfo.build (cyclomatic 16) · ×1
  • _MentionSuggestionInfo.build (cyclomatic 16) mobile/lib/features/channels/compose_bar/suggestions.dart:82 — _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.
D1 · Cyclomatic Complexity · _MessageLongPressRegion.build (cyclomatic 16) · ×1
  • _MessageLongPressRegion.build (cyclomatic 16) mobile/lib/features/channels/message_long_press_region.dart:111 — _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.
D1 · Cyclomatic Complexity · backForwardChords.matchBackForwardChord (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · MemorySection.MemoryEntryAccordion (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · agentAutocompleteEligibility.getMentionableAgentPubkeys (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · observerRelayStore.appendAgentEvents (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · PersonaAdvancedFields.PersonaAdvancedFields (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · observedUnreadStorage.readObservedUnreadFromStorage (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · useCommunityUnread.useCommunityUnread (cyclomatic 16) · ×1
  • useCommunityUnread.useCommunityUnread (cyclomatic 16) desktop/src/features/communities/useCommunityUnread.ts:50 — useCommunityUnread.useCommunityUnread has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 113, 164, 73, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · CommunityMembersSettingsCard.CommunityMembersSettingsCard (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · useEnsureAgentMentionsReady.useEnsureAgentMentionsReady (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · useDraftPersistSnapshot.useDraftPersistLifecycle (cyclomatic 16) · ×1
  • useDraftPersistSnapshot.useDraftPersistLifecycle (cyclomatic 16) desktop/src/features/messages/ui/useDraftPersistSnapshot.ts:107 — useDraftPersistSnapshot.useDraftPersistLifecycle 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 5 function literals inside it that branch (lines 184, 229, 257, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MessageComposerToolbar.MessageComposerToolbar (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · desktop.listenForDesktopNotificationActions (cyclomatic 16) · ×1
  • desktop.listenForDesktopNotificationActions (cyclomatic 16) desktop/src/features/notifications/lib/desktop.ts:194 — 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 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.
D1 · Cyclomatic Complexity · AnimatedAvatarBackdropPanel.AnimatedAvatarBackdropPanel (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · projectModels.validateProjectEventEnvelope (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectBranchDialogs.CreateProjectBranchDialog (cyclomatic 16) · ×1
  • ProjectBranchDialogs.CreateProjectBranchDialog (cyclomatic 16) desktop/src/features/projects/ui/ProjectBranchDialogs.tsx:29 — ProjectBranchDialogs.CreateProjectBranchDialog has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProjectDetailFeedPanels.ActivityPanel (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectWorkItemContextActions.ProjectWorkItemContextActions (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProjectsSectionSearch.ProjectsSectionSearch (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · useSearchMenuKeyboardNavigation.useSearchMenuKeyboardNavigation (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · HarnessRow.RuntimeOverflowMenu (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · SettingsView.SettingsView (cyclomatic 16) · ×1
  • 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, 187, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · channelSectionsStorage.parseChannelSectionPayload (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ChannelActivityPopover.ChannelActivityPopover (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · SidebarRelayConnectionCard.SidebarRelayConnectionCompactCard (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · rich-link-preview-attachment.RichLinkPreviewAttachment (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ReposPage.ReposPage (cyclomatic 16) · ×1
  • 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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment crates/buzz-search/tests/postgres_fts_integration.rs:270 — // 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.
D17 · Explicit Debt · FixmeComment · ×1
  • 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.
D2 · Cognitive Complexity · ProfileAvatarEditor.ProfileAvatarEditor (cognitive 250) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelPane.ChannelPane (cognitive 232) · ×1
  • 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 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.
D2 · Cognitive Complexity · AgentCreationPreview.AgentCreationPreview (cognitive 231) · ×1
  • 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, 173 points are the body's own statements and 58 belong to 15 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.
D2 · Cognitive Complexity · AgentConfigFields.AgentConfigFields (cognitive 195) · ×1
  • 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, 144 points are the body's own statements and 51 belong to 14 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.
D2 · Cognitive Complexity · AnimatedAvatarCapture.AnimatedAvatarCapture (cognitive 183) · ×1
  • 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.
D2 · Cognitive Complexity · _MessageList.build (cognitive 178) · ×1
  • _MessageList.build (cognitive 178) mobile/lib/features/channels/channel_detail_page/message_list.dart:42 — _MessageList.build has cognitive complexity 178 (threshold 15). Drivers by points: if/else 66 (81 pts), boolean chains 73, ternaries 18 (20 pts), loops 3, match/switch 1 (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.
D2 · Cognitive Complexity · ImageAvatarCapture.build (cognitive 158) · ×1
  • 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.
D2 · Cognitive Complexity · NostrKeyImportForm.NostrKeyImportForm (cognitive 158) · ×1
  • 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.
D2 · Cognitive Complexity · MachineOnboardingFlow.MachineOnboardingFlow (cognitive 158) · ×1
  • 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.
D2 · Cognitive Complexity · HostedCommunityOnboarding.HostedCommunityOnboarding (cognitive 156) · ×1
  • HostedCommunityOnboarding.HostedCommunityOnboarding (cognitive 156) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:77 — 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 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.
D2 · Cognitive Complexity · ComposeBar.build (cognitive 149) · ×1
  • ComposeBar.build (cognitive 149) mobile/lib/features/channels/compose_bar/compose_bar_widget.dart:33 — ComposeBar.build has cognitive complexity 149 (threshold 15). Drivers by points: if/else 57 (100 pts), boolean chains 25, loops 6 (11 pts), ternaries 7, error handling 4 (5 pts), match/switch 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserProfilePanel.UserProfilePanel (cognitive 147) · ×1
  • UserProfilePanel.UserProfilePanel (cognitive 147) desktop/src/features/profile/ui/UserProfilePanel.tsx:104 — UserProfilePanel.UserProfilePanel has cognitive complexity 147 (threshold 15). Drivers by points: ternaries 45 (61 pts), boolean chains 43, if/else 33 (35 pts), error handling 5 (6 pts), loops 2 (nesting depth added 19). Of this number, 84 points are the body's own statements and 63 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.
D2 · Cognitive Complexity · ThreadDetailPage.build (cognitive 144) · ×1
  • ThreadDetailPage.build (cognitive 144) mobile/lib/features/channels/thread_detail_page.dart:93 — ThreadDetailPage.build has cognitive complexity 144 (threshold 15). Drivers by points: boolean chains 63, if/else 57 (61 pts), ternaries 15 (16 pts), loops 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · useAnchoredScroll.useAnchoredScroll (cognitive 143) · ×1
  • useAnchoredScroll.useAnchoredScroll (cognitive 143) desktop/src/features/messages/ui/useAnchoredScroll.ts:150 — useAnchoredScroll.useAnchoredScroll has cognitive complexity 143 (threshold 15). Drivers by points: if/else 89 (116 pts), boolean chains 21, ternaries 5 (6 pts) (nesting depth added 28). Most of this is not in the body itself: 1 of the 143 points is its own statement and the rest belongs to 27 function literals inside it that branch (lines 607, 432, 551, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useMentionSendFlow.useMentionSendFlow (cognitive 141) · ×1
  • useMentionSendFlow.useMentionSendFlow (cognitive 141) desktop/src/features/messages/ui/useMentionSendFlow.ts:51 — useMentionSendFlow.useMentionSendFlow has cognitive complexity 141 (threshold 15). Drivers by points: if/else 63 (80 pts), boolean chains 31, ternaries 10 (15 pts), error handling 6 (10 pts), loops 4 (5 pts) (nesting depth added 27). Most of this is not in the body itself: 2 of the 141 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 284, 726, 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.
D2 · Cognitive Complexity · agentSessionTranscript.processTranscriptEvent (cognitive 138) · ×1
  • 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.
D2 · Cognitive Complexity · huddlePresenceRuntime.startHuddlePresenceRuntime (cognitive 137) · ×1
  • huddlePresenceRuntime.startHuddlePresenceRuntime (cognitive 137) desktop/src/features/huddle/lib/huddlePresenceRuntime.ts:64 — huddlePresenceRuntime.startHuddlePresenceRuntime has cognitive complexity 137 (threshold 15). Drivers by points: if/else 61 (98 pts), boolean chains 18, loops 12 (14 pts), error handling 5 (6 pts), ternaries 1 (nesting depth added 40). Of this number, 31 points are the body's own statements and 106 belong to 14 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.
D2 · Cognitive Complexity · WorkflowFormBuilder.WorkflowFormBuilder (cognitive 135) · ×1
  • 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.
D2 · Cognitive Complexity · useUnreadChannels.useUnreadChannels (cognitive 131) · ×1
  • useUnreadChannels.useUnreadChannels (cognitive 131) desktop/src/features/channels/useUnreadChannels.ts:126 — useUnreadChannels.useUnreadChannels has cognitive complexity 131 (threshold 15). Drivers by points: if/else 59 (84 pts), loops 13 (17 pts), boolean chains 15, ternaries 9 (15 pts) (nesting depth added 35). Most of this is not in the body itself: 2 of the 131 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 670, 791, 426, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NostrBindConsentDialog.NostrBindConsentDialog (cognitive 129) · ×1
  • 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.
D2 · Cognitive Complexity · TopbarSearch.TopbarSearch (cognitive 129) · ×1
  • TopbarSearch.TopbarSearch (cognitive 129) desktop/src/features/search/ui/TopbarSearch.tsx:376 — TopbarSearch.TopbarSearch has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 51 (102 pts), if/else 15 (16 pts), boolean chains 11 (nesting depth added 52). Of this number, 63 points are the body's own statements and 66 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.
D2 · Cognitive Complexity · CommunityOnboardingFlow.CommunityOnboardingFlow (cognitive 127) · ×1
  • 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 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.
D2 · Cognitive Complexity · WorkflowTriggerConditions.WorkflowTriggerConditions (cognitive 127) · ×1
  • 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 literals inside it that branch (lines 275, 177, 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.
D2 · Cognitive Complexity · markdown.ImageZoomOverlay (cognitive 127) · ×1
  • 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.
D2 · Cognitive Complexity · TerminalSubstrate.TerminalSubstrate (cognitive 126) · ×1
  • 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 literals inside it that branch (lines 190, 398, 685, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · WorkflowDetailPanel.WorkflowDetailPanel (cognitive 124) · ×1
  • 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, 56 points are the body's own statements and 68 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AnimatedAvatarCapture.build (cognitive 121) · ×1
  • AnimatedAvatarCapture.build (cognitive 121) mobile/lib/features/profile/animated_avatar_capture.dart:64 — 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.
D2 · Cognitive Complexity · HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cognitive 119) · ×1
  • HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard (cognitive 119) desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:69 — HostedCommunitiesSettingsCard.HostedCommunitiesSettingsCard has cognitive complexity 119 (threshold 15). Drivers by points: ternaries 21 (64 pts), if/else 26 (33 pts), boolean chains 20, error handling 2 (nesting depth added 50). Of this number, 69 points are the body's own statements and 50 belong to 19 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.
D2 · Cognitive Complexity · AgentInstanceEditDialog.AgentInstanceEditDialog (cognitive 116) · ×1
  • AgentInstanceEditDialog.AgentInstanceEditDialog (cognitive 116) desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:100 — AgentInstanceEditDialog.AgentInstanceEditDialog has cognitive complexity 116 (threshold 15). Drivers by points: ternaries 48 (64 pts), boolean chains 29, if/else 21, error handling 2 (nesting depth added 16). Of this number, 89 points are the body's own statements and 27 belong to 11 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · HuddleContext.HuddleProvider (cognitive 114) · ×1
  • 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.
D2 · Cognitive Complexity · AgentsView.AgentsView (cognitive 113) · ×1
  • 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, 56 points are the body's own statements and 57 belong to 25 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.
D2 · Cognitive Complexity · ProjectRepositoryActionsPanel.ProjectRepositoryActionsPanel (cognitive 113) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelManagementSheet.ChannelManagementPanelContent (cognitive 112) · ×1
  • 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.
D2 · Cognitive Complexity · HomeView.HomeView (cognitive 110) · ×1
  • 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.
D2 · Cognitive Complexity · MessageTimeline.MessageTimelineBase (cognitive 109) · ×1
  • MessageTimeline.MessageTimelineBase (cognitive 109) desktop/src/features/messages/ui/MessageTimeline.tsx:162 — MessageTimeline.MessageTimelineBase has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 32 (52 pts), boolean chains 34, if/else 21 (23 pts) (nesting depth added 22). Of this number, 77 points are the body's own statements and 32 belong to 11 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.
D2 · Cognitive Complexity · ForumComposer.ForumComposerVisit (cognitive 107) · ×1
  • 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.
D2 · Cognitive Complexity · WorkflowDialog.WorkflowDialog (cognitive 106) · ×1
  • 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, 65 points are the body's own statements and 41 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.
D2 · Cognitive Complexity · VideoPlayer.VideoReviewDialog (cognitive 106) · ×1
  • 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.
D2 · Cognitive Complexity · InviteRedeemForm.InviteRedeemForm (cognitive 105) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelDetailPage.build (cognitive 104) · ×1
  • ChannelDetailPage.build (cognitive 104) mobile/lib/features/channels/channel_detail_page.dart:268 — ChannelDetailPage.build has cognitive complexity 104 (threshold 15). Drivers by points: boolean chains 40, if/else 25 (36 pts), ternaries 15 (20 pts), loops 4 (7 pts), 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.
D2 · Cognitive Complexity · CommunityCatalogDialog.CommunityCatalogDialog (cognitive 102) · ×1
  • 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, 65 points are the body's own statements and 37 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.
D2 · Cognitive Complexity · MessageRow.MessageRow (cognitive 102) · ×1
  • 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 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.
D2 · Cognitive Complexity · AgentDefinitionDialog.AgentDefinitionDialog (cognitive 101) · ×1
  • AgentDefinitionDialog.AgentDefinitionDialog (cognitive 101) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:124 — AgentDefinitionDialog.AgentDefinitionDialog has cognitive complexity 101 (threshold 15). Drivers by points: boolean chains 51, ternaries 32 (37 pts), if/else 13 (nesting depth added 5). Of this number, 79 points are the body's own statements and 22 belong to 9 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · HuddleBar.HuddleBar (cognitive 100) · ×1
  • HuddleBar.HuddleBar (cognitive 100) desktop/src/features/huddle/components/HuddleBar.tsx:149 — HuddleBar.HuddleBar has cognitive complexity 100 (threshold 15). Drivers by points: if/else 38 (44 pts), boolean chains 27, ternaries 14 (19 pts), error handling 9 (10 pts) (nesting depth added 12). Of this number, 35 points are the body's own statements and 65 belong to 22 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MembersSidebar.MembersSidebar (cognitive 99) · ×1
  • 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, 60 points are the body's own statements and 39 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.
D2 · Cognitive Complexity · MessageThreadPanel.MessageThreadPanel (cognitive 99) · ×1
  • 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.
D2 · Cognitive Complexity · UserProfilePanelSections.ProfileSummaryView (cognitive 97) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelDetailsPage.build (cognitive 96) · ×1
  • ChannelDetailsPage.build (cognitive 96) mobile/lib/features/channels/channel_details_page.dart:41 — ChannelDetailsPage.build has cognitive complexity 96 (threshold 15). Drivers by points: if/else 24 (41 pts), boolean chains 30, ternaries 16 (20 pts), loops 2 (4 pts), 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.
D2 · Cognitive Complexity · ChannelBrowserDialog.ChannelBrowserDialog (cognitive 95) · ×1
  • 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, 43 points are the body's own statements and 52 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.
D2 · Cognitive Complexity · useMentions.useMentions (cognitive 95) · ×1
  • useMentions.useMentions (cognitive 95) desktop/src/features/messages/lib/useMentions.ts:76 — useMentions.useMentions has cognitive complexity 95 (threshold 15). Drivers by points: if/else 38 (53 pts), boolean chains 20, ternaries 10 (14 pts), loops 8 (nesting depth added 19). Most of this is not in the body itself: 9 of the 95 points are its own statements and the rest belongs to 23 function literals inside it that branch (lines 828, 492, 211, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · workflowFormTypes.yamlToFormState (cognitive 95) · ×1
  • 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.
D2 · Cognitive Complexity · ProfileSettingsCard.ProfileSettingsCard (cognitive 94) · ×1
  • 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.
D2 · Cognitive Complexity · ProfileEditPage.build (cognitive 91) · ×1
  • 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.
D2 · Cognitive Complexity · MessageComposer.MessageComposerImpl (cognitive 91) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectPullRequestsPanel.ProjectPullRequestDetail (cognitive 87) · ×1
  • 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.
D2 · Cognitive Complexity · plainTextProjection.buildPlainTextProjection (cognitive 86) · ×1
  • plainTextProjection.buildPlainTextProjection (cognitive 86) desktop/src/features/messages/lib/plainTextProjection.ts:91 — plainTextProjection.buildPlainTextProjection has cognitive complexity 86 (threshold 15). Drivers by points: if/else 37 (72 pts), ternaries 4 (9 pts), boolean chains 3, loops 2 (nesting depth added 40). Of this number, 70 points are the body's own statements and 16 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.
D2 · Cognitive Complexity · AudioMessageAttachment.AudioMessageAttachment (cognitive 84) · ×1
  • 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.
D2 · Cognitive Complexity · MentionAutocomplete.MentionAutocomplete (cognitive 84) · ×1
  • 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.
D2 · Cognitive Complexity · useMediaUpload.useMediaUpload (cognitive 83) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectDetailScreen.ProjectDetailScreen (cognitive 83) · ×1
  • 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 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.
D2 · Cognitive Complexity · PullRequestReviewersRow.PullRequestReviewersRow (cognitive 81) · ×1
  • 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.
D2 · Cognitive Complexity · InboxDetailPane.InboxMessageDetailPane (cognitive 80) · ×1
  • 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.
D2 · Cognitive Complexity · InboxListPane.InboxListPane (cognitive 80) · ×1
  • InboxListPane.InboxListPane (cognitive 80) desktop/src/features/home/ui/InboxListPane.tsx:243 — InboxListPane.InboxListPane has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 34 (61 pts), boolean chains 9, if/else 5 (9 pts), loops 1 (nesting depth added 31). Of this number, 26 points are the body's own statements and 54 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.
D2 · Cognitive Complexity · ProjectWorkspaceTabs.WorkspaceTabs (cognitive 80) · ×1
  • 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.
D2 · Cognitive Complexity · NewMessageScreen.NewMessageScreen (cognitive 79) · ×1
  • 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.
D2 · Cognitive Complexity · EncryptedBackupCreator.EncryptedBackupCreator (cognitive 79) · ×1
  • 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.
D2 · Cognitive Complexity · useObservedUnreadPersistence.useObservedUnreadPersistence (cognitive 78) · ×1
  • 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). Most of this is not in the body itself: 0 of the 78 points are its own statements 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.
D2 · Cognitive Complexity · UserProfilePopover.UserProfilePopoverBody (cognitive 78) · ×1
  • 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.
D2 · Cognitive Complexity · WorkflowMessagePicker.WorkflowMessagePicker (cognitive 78) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectsView.ProjectsView (cognitive 77) · ×1
  • 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.
D2 · Cognitive Complexity · usePersonaActions.usePersonaActions (cognitive 76) · ×1
  • usePersonaActions.usePersonaActions (cognitive 76) desktop/src/features/agents/ui/usePersonaActions.ts:69 — usePersonaActions.usePersonaActions has cognitive complexity 76 (threshold 15). Drivers by points: if/else 27 (39 pts), ternaries 14 (26 pts), error handling 7 (8 pts), boolean chains 3 (nesting depth added 25). Of this number, 73 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.
D2 · Cognitive Complexity · BackupStep.BackupStep (cognitive 76) · ×1
  • 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.
D2 · Cognitive Complexity · MobilePairingCard.MobilePairingCard (cognitive 76) · ×1
  • MobilePairingCard.MobilePairingCard (cognitive 76) desktop/src/features/settings/ui/MobilePairingCard.tsx:251 — MobilePairingCard.MobilePairingCard has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 14 (45 pts), if/else 18 (19 pts), boolean chains 10, error handling 1, loops 1 (nesting depth added 32). Of this number, 52 points are the body's own statements and 24 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.
D2 · Cognitive Complexity · HostedCommunityCreateFlow.HostedCommunityCreateFlow (cognitive 75) · ×1
  • HostedCommunityCreateFlow.HostedCommunityCreateFlow (cognitive 75) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:41 — 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 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.
D2 · Cognitive Complexity · ChannelScreen.ChannelScreen (cognitive 74) · ×1
  • 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.
D2 · Cognitive Complexity · HuddlePresenceTracker.apply (cognitive 73) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelsNotifier._fetchChannels (cognitive 72) · ×1
  • ChannelsNotifier._fetchChannels (cognitive 72) mobile/lib/features/channels/channels_provider.dart:175 — ChannelsNotifier._fetchChannels has cognitive complexity 72 (threshold 15). Drivers by points: if/else 22 (44 pts), loops 9 (13 pts), boolean chains 12, ternaries 3 (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.
D2 · Cognitive Complexity · BeeRefreshIndicator.build (cognitive 72) · ×1
  • 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.
D2 · Cognitive Complexity · useRichTextEditor.useRichTextEditor (cognitive 72) · ×1
  • useRichTextEditor.useRichTextEditor (cognitive 72) desktop/src/features/messages/lib/useRichTextEditor.ts:145 — useRichTextEditor.useRichTextEditor has cognitive complexity 72 (threshold 15). Drivers by points: if/else 51 (58 pts), boolean chains 8, ternaries 4 (5 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 0 of the 72 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 424, 227, 739, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · exhaustive.test_cross_device_compaction_suppression (cognitive 70) · ×1
  • 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.
D2 · Cognitive Complexity · ActivityPage.build (cognitive 70) · ×1
  • ActivityPage.build (cognitive 70) mobile/lib/features/activity/activity_page.dart:72 — ActivityPage.build has cognitive complexity 70 (threshold 15). Drivers by points: if/else 31 (48 pts), boolean chains 9, ternaries 4 (6 pts), loops 5, error handling 1 (2 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.
D2 · Cognitive Complexity · useManagedAgentActions.useManagedAgentActions (cognitive 70) · ×1
  • useManagedAgentActions.useManagedAgentActions (cognitive 70) desktop/src/features/agents/ui/useManagedAgentActions.ts:41 — useManagedAgentActions.useManagedAgentActions has cognitive complexity 70 (threshold 15). Drivers by points: if/else 30 (37 pts), ternaries 11 (18 pts), error handling 6, loops 4 (5 pts), boolean chains 4 (nesting depth added 15). Of this number, 46 points are the body's own statements and 24 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.
D2 · Cognitive Complexity · AppSidebar.AppSidebar (cognitive 70) · ×1
  • 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.
D2 · Cognitive Complexity · OnboardingFlow.OnboardingFlow (cognitive 69) · ×1
  • 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.
D2 · Cognitive Complexity · useCommunityInit.useCommunityInit (cognitive 68) · ×1
  • useCommunityInit.useCommunityInit (cognitive 68) desktop/src/features/communities/useCommunityInit.ts:128 — 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). Most of this is not in the body itself: 0 of the 68 points are its own statements and the rest belongs to one function literal inside it that branches (line 180). 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.
D2 · Cognitive Complexity · formatTimelineMessages.formatTimelineMessages (cognitive 67) · ×1
  • 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, 54 points are the body's own statements and 13 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.
D2 · Cognitive Complexity · HuddleControlAcceptor · ×1
  • HuddleControlAcceptor::serve_control_loop (cognitive 66) crates/buzz-relay/src/audio/join.rs:1156 — HuddleControlAcceptor::serve_control_loop has cognitive complexity 66 (threshold 15). Drivers by points: if/else 12 (35 pts), match/switch 11 (28 pts), loops 2 (3 pts) (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.
D2 · Cognitive Complexity · modelCapabilities.generateDatabricksLabel (cognitive 66) · ×1
  • modelCapabilities.generateDatabricksLabel (cognitive 66) desktop/src/features/agents/ui/modelCapabilities.ts:514 — modelCapabilities.generateDatabricksLabel has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (26 pts), ternaries 10 (22 pts), boolean chains 15, loops 2 (3 pts) (nesting depth added 21). Of this number, 65 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.
D2 · Cognitive Complexity · HuddleIndicator.HuddleIndicator (cognitive 65) · ×1
  • 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). Of this number, 16 points are the body's own statements and 49 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.
D2 · Cognitive Complexity · ProfileAvatarEditor.build (cognitive 63) · ×1
  • ProfileAvatarEditor.build (cognitive 63) mobile/lib/features/profile/profile_avatar_editor.dart:124 — 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.
D2 · Cognitive Complexity · VideoPlayer.VideoPlayer (cognitive 63) · ×1
  • 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.
D2 · Cognitive Complexity · UsageTracker · ×1
  • 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.
D2 · Cognitive Complexity · useAgentAddressLockPicker.useAgentAddressLockPicker (cognitive 62) · ×1
  • useAgentAddressLockPicker.useAgentAddressLockPicker (cognitive 62) desktop/src/features/messages/ui/useAgentAddressLockPicker.ts:17 — useAgentAddressLockPicker.useAgentAddressLockPicker has cognitive complexity 62 (threshold 15). Drivers by points: if/else 31 (41 pts), boolean chains 16, loops 3, ternaries 2 (nesting depth added 10). Most of this is not in the body itself: 2 of the 62 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 194, 295, 346, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · agentSessionTranscriptHelpers.parseSystemPromptSections (cognitive 61) · ×1
  • agentSessionTranscriptHelpers.parseSystemPromptSections (cognitive 61) REDACTED:138 — agentSessionTranscriptHelpers.parseSystemPromptSections has cognitive complexity 61 (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.
D2 · Cognitive Complexity · ChannelManagementSheet.ChannelManagementSheet (cognitive 61) · ×1
  • 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, 57 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.
D2 · Cognitive Complexity · DeviceVoiceNotePlayerController._loadPendingRemote (cognitive 60) · ×1
  • DeviceVoiceNotePlayerController._loadPendingRemote (cognitive 60) mobile/lib/features/channels/voice_note_recording.dart:591 — 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.
D2 · Cognitive Complexity · observedUnreadNativeRig.installNativeRig (cognitive 58) · ×1
  • observedUnreadNativeRig.installNativeRig (cognitive 58) desktop/src/features/channels/observedUnreadNativeRig.mjs:153 — observedUnreadNativeRig.installNativeRig has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 10 (19 pts), boolean chains 6 (nesting depth added 22). Most of this is not in the body itself: 1 of the 58 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 186, 217, 323, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AgentSessionThreadPanel.AgentSessionThreadPanel (cognitive 58) · ×1
  • 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, 57 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.
D2 · Cognitive Complexity · WelcomeSetup.WelcomeSetup (cognitive 58) · ×1
  • 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.
D2 · Cognitive Complexity · IdentityRecoveryPairing.IdentityRecoveryPairing (cognitive 58) · ×1
  • 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, 40 points are the body's own statements and 18 belong to 11 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.
D2 · Cognitive Complexity · exhaustive.test_compaction_register_exhaustive (cognitive 57) · ×1
  • 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.
D2 · Cognitive Complexity · IssueAssigneesRow.IssueAssigneesRow (cognitive 56) · ×1
  • 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.
D2 · Cognitive Complexity · useAddProjectRepository.addProjectRepository (cognitive 55) · ×1
  • 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 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.
D2 · Cognitive Complexity · useSearchResults.useSearchResults (cognitive 55) · ×1
  • useSearchResults.useSearchResults (cognitive 55) desktop/src/features/search/useSearchResults.ts:102 — useSearchResults.useSearchResults has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 24, if/else 14 (16 pts), loops 9, ternaries 6 (nesting depth added 2). Of this number, 18 points are the body's own statements and 37 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.
D2 · Cognitive Complexity · SettingsPanels.ThemeSettingsCard (cognitive 55) · ×1
  • SettingsPanels.ThemeSettingsCard (cognitive 55) desktop/src/features/settings/ui/SettingsPanels.tsx:421 — SettingsPanels.ThemeSettingsCard has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 19 (29 pts), if/else 9 (16 pts), boolean chains 10 (nesting depth added 17). Of this number, 30 points are the body's own statements and 25 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.
D2 · Cognitive Complexity · MediaImageViewerPage.build (cognitive 54) · ×1
  • MediaImageViewerPage.build (cognitive 54) mobile/lib/features/channels/media_viewer_page.dart:195 — MediaImageViewerPage.build has cognitive complexity 54 (threshold 15). Drivers by points: if/else 30 (33 pts), boolean chains 13, 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.
D2 · Cognitive Complexity · ChannelActionsSheet.build (cognitive 53) · ×1
  • ChannelActionsSheet.build (cognitive 53) mobile/lib/features/channels/channel_actions_sheet.dart:78 — 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.
D2 · Cognitive Complexity · AgentRuntimeAvatarControl.AgentRuntimeAvatarControl (cognitive 53) · ×1
  • 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.
D2 · Cognitive Complexity · welcomeKickoff.useWelcomeKickoff (cognitive 53) · ×1
  • 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.
D2 · Cognitive Complexity · markdown.createMarkdownComponents (cognitive 53) · ×1
  • markdown.createMarkdownComponents (cognitive 53) desktop/src/shared/ui/markdown.tsx:1212 — markdown.createMarkdownComponents has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (30 pts), ternaries 11 (12 pts), boolean chains 11 (nesting depth added 7). Of this number, 23 points are the body's own statements and 30 belong to 10 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.
D2 · Cognitive Complexity · useLiveChannelUpdates.useLiveChannelUpdates (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · WorkflowAuthorPicker.WorkflowAuthorPicker (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · CommunitySwitcher.CommunitySwitcher (cognitive 51) · ×1
  • CommunitySwitcher.CommunitySwitcher (cognitive 51) desktop/src/features/communities/ui/CommunitySwitcher.tsx:101 — CommunitySwitcher.CommunitySwitcher has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 22 (39 pts), if/else 9, boolean chains 2, error handling 1 (nesting depth added 17). Of this number, 41 points are the body's own statements and 10 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.
D2 · Cognitive Complexity · ComposerUploadProgressPill.ComposerUploadProgressPill (cognitive 50) · ×1
  • 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.
D2 · Cognitive Complexity · exhaustive.test_deep_history_compaction (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · ModelPicker.ModelPicker (cognitive 49) · ×1
  • ModelPicker.ModelPicker (cognitive 49) desktop/src/features/agents/ui/ModelPicker.tsx:34 — ModelPicker.ModelPicker has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 13 (28 pts), if/else 9 (14 pts), boolean chains 5, error handling 2 (nesting depth added 20). Of this number, 26 points are the body's own statements and 23 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.
D2 · Cognitive Complexity · MediaVideoViewerPage.build (cognitive 48) · ×1
  • MediaVideoViewerPage.build (cognitive 48) mobile/lib/features/channels/media_viewer_page/video_viewer.dart:19 — MediaVideoViewerPage.build has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (38 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.
D2 · Cognitive Complexity · useHuddlePresentation.useHuddlePresentation (cognitive 48) · ×1
  • useHuddlePresentation.useHuddlePresentation (cognitive 48) desktop/src/app/useHuddlePresentation.ts:31 — useHuddlePresentation.useHuddlePresentation has cognitive complexity 48 (threshold 15). Drivers by points: if/else 35, boolean chains 12, error handling 1. Most of this is not in the body itself: 3 of the 48 points are its own statements and the rest belongs to 26 function literals inside it that branch (lines 395, 189, 246, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AdminConsoleSettingsCard.AdminConsoleSettingsSession (cognitive 48) · ×1
  • 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). Of this number, 21 points are the body's own statements and 27 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.
D2 · Cognitive Complexity · AgentDefaultsEditor.AgentDefaultsEditor (cognitive 48) · ×1
  • 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, 43 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · PersonaShareDialog.SnapshotShareDialog (cognitive 48) · ×1
  • 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, 42 points are the body's own statements and 6 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.
D2 · Cognitive Complexity · ProjectRepositoryManagement.ProjectRepositoryManagement (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectsActivityFeed.buildActivityItems (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · modelCapabilities.resolveModelCapabilities (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · MeshComputeSettingsCard.MeshComputeSettingsCard (cognitive 47) · ×1
  • 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, 39 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.
D2 · Cognitive Complexity · ComposerAttachments.MediaAttachmentItem (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · useComposerLinkPreviews.useComposerLinkPreviews (cognitive 47) · ×1
  • useComposerLinkPreviews.useComposerLinkPreviews (cognitive 47) desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:273 — useComposerLinkPreviews.useComposerLinkPreviews has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 13, ternaries 8 (10 pts), loops 4 (nesting depth added 11). Most of this is not in the body itself: 12 of the 47 points are its own statements and the rest belongs to 17 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.
D2 · Cognitive Complexity · acceptance.explore (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · _SliverChannelsList.build (cognitive 46) · ×1
  • _SliverChannelsList.build (cognitive 46) mobile/lib/features/channels/channels_page/body.dart:102 — _SliverChannelsList.build has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 8 (9 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.
D2 · Cognitive Complexity · HuddleTransport._handleJoined (cognitive 46) · ×1
  • HuddleTransport._handleJoined (cognitive 46) mobile/lib/shared/huddle/huddle_transport.dart:437 — 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.
D2 · Cognitive Complexity · App.CommunityApp (cognitive 46) · ×1
  • App.CommunityApp (cognitive 46) desktop/src/app/App.tsx:360 — 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.
D2 · Cognitive Complexity · ManagedAgentLogPanel.ManagedAgentLogPanel (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · TimelineMessageList.VirtualizedTimelineRows (cognitive 46) · ×1
  • TimelineMessageList.VirtualizedTimelineRows (cognitive 46) desktop/src/features/messages/ui/TimelineMessageList.tsx:423 — 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 497, 630, 713, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TerminalBootstrap.TerminalBootstrap (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · localStorageSweep.sweepChunked (cognitive 46) · ×1
  • localStorageSweep.sweepChunked (cognitive 46) desktop/src/shared/lib/localStorageSweep.ts:152 — localStorageSweep.sweepChunked has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (33 pts), error handling 5 (7 pts), boolean chains 3, loops 3 (nesting depth added 15). Most of this is not in the body itself: 13 of the 46 points are its own statements and the rest belongs to one function literal inside it that branches (line 215). 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.
D2 · Cognitive Complexity · AppShell.AppShell (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · PulseView.PulseView (cognitive 45) · ×1
  • 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, 28 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.
D2 · Cognitive Complexity · mentionBoundaries.maskMarkdownCode (cognitive 45) · ×1
  • 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 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.
D2 · Cognitive Complexity · nostr-client.queryEvents (cognitive 45) · ×1
  • 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). Most of this is not in the body itself: 0 of the 45 points are its own statements 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.
D2 · Cognitive Complexity · BuzzClient · ×1
  • 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.
D2 · Cognitive Complexity · BuzzPushPresentationCacheStore.updateChannels (cognitive 44) · ×1
  • BuzzPushPresentationCacheStore.updateChannels (cognitive 44) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:271 — BuzzPushPresentationCacheStore.updateChannels has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 20, if/else 7 (12 pts), ternaries 5 (10 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommunityEditForm.CommunityEditForm (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · useInboxSelectionAnchor.useInboxSelectionAnchor (cognitive 44) · ×1
  • useInboxSelectionAnchor.useInboxSelectionAnchor (cognitive 44) desktop/src/features/home/useInboxSelectionAnchor.ts:66 — useInboxSelectionAnchor.useInboxSelectionAnchor has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 14, ternaries 6 (8 pts) (nesting depth added 5). Of this number, 16 points are the body's own statements and 28 belong to 11 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useInboxThreadContext.useInboxThreadContext (cognitive 44) · ×1
  • useInboxThreadContext.useInboxThreadContext (cognitive 44) desktop/src/features/home/useInboxThreadContext.ts:49 — useInboxThreadContext.useInboxThreadContext has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 13, ternaries 8, error handling 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 44 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 81, 110, 279, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useVoiceNoteRecorder.useVoiceNoteRecorder (cognitive 44) · ×1
  • useVoiceNoteRecorder.useVoiceNoteRecorder (cognitive 44) desktop/src/features/messages/lib/useVoiceNoteRecorder.ts:42 — useVoiceNoteRecorder.useVoiceNoteRecorder has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 14, error handling 2 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 0 of the 44 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 68, 125, 52, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DownloadKeyStep.DownloadKeyStep (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectReadmePanel.ReadmePanel (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · useResolvedLinkPreviews.useResolvedLinkPreviews (cognitive 44) · ×1
  • 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). Most of this is not in the body itself: 0 of the 44 points are its own statements 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.
D2 · Cognitive Complexity · AgentCardMintDialog.AgentCardMintDialog (cognitive 43) · ×1
  • 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, 42 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RespondToField.AllowlistPicker (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · useTtsSubscription.useTtsSubscription (cognitive 43) · ×1
  • 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). Most of this is not in the body itself: 0 of the 43 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 129, 40, 290, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PullRequestReviewCard.PullRequestReviewCard (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · useHuddleParticipantRoster.reconstructHuddleParticipantRoster (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · MaskedAvatarBadgeFrame.MaskedAvatarBadgeFrame (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · relayReconnectReplay.replayLiveSubscriptions (cognitive 42) · ×1
  • 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 literals inside it that branch (lines 352, 231, 308, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · exhaustive.test_tombstone_stale_merge_direct (cognitive 41) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelsNotifier._catchUpUnreadEvents (cognitive 41) · ×1
  • ChannelsNotifier._catchUpUnreadEvents (cognitive 41) mobile/lib/features/channels/channels_provider.dart:535 — ChannelsNotifier._catchUpUnreadEvents has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 6 (8 pts), boolean chains 3, error handling 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useTeamActions.useTeamActions (cognitive 41) · ×1
  • useTeamActions.useTeamActions (cognitive 41) desktop/src/features/agents/ui/useTeamActions.ts:63 — useTeamActions.useTeamActions has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 13 (23 pts), if/else 9, error handling 7 (8 pts), loops 1 (nesting depth added 11). Of this number, 38 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.
D2 · Cognitive Complexity · ChannelCombobox.ChannelCombobox (cognitive 41) · ×1
  • 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, 28 points are the body's own statements and 13 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.
D2 · Cognitive Complexity · _NewDirectMessageSheet.build (cognitive 40) · ×1
  • _NewDirectMessageSheet.build (cognitive 40) mobile/lib/features/channels/channels_page/sheets.dart:441 — _NewDirectMessageSheet.build has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 9 (10 pts), boolean chains 8, loops 2 (3 pts), 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, 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.
D2 · Cognitive Complexity · DeviceVoiceNotePlayerController._toggle (cognitive 40) · ×1
  • DeviceVoiceNotePlayerController._toggle (cognitive 40) mobile/lib/features/channels/voice_note_recording.dart:807 — 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.
D2 · Cognitive Complexity · AdminConsoleStaffingTab.RestrictionsSection (cognitive 40) · ×1
  • AdminConsoleStaffingTab.RestrictionsSection (cognitive 40) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:161 — AdminConsoleStaffingTab.RestrictionsSection has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (14 pts), ternaries 8 (9 pts), error handling 3 (nesting depth added 4). Of this number, 21 points are the body's own statements and 19 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · useAgentManagement.useAgentManagement (cognitive 40) · ×1
  • useAgentManagement.useAgentManagement (cognitive 40) desktop/src/features/agents/useAgentManagement.ts:37 — useAgentManagement.useAgentManagement has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 6 (9 pts), boolean chains 8, error handling 2, loops 1 (2 pts) (nesting depth added 6). Of this number, 21 points are the body's own statements and 19 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.
D2 · Cognitive Complexity · CustomEmojiSettingsCard.CustomEmojiSettingsCard (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · ProfileAvatar.ProfileAvatar (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · HarnessCatalogDialog.HarnessCatalogDialog (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · terminalBanner.buildTerminalBanner (cognitive 40) · ×1
  • terminalBanner.buildTerminalBanner (cognitive 40) desktop/src/features/terminal/terminalBanner.ts:121 — terminalBanner.buildTerminalBanner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 10 (13 pts), boolean chains 5, ternaries 4 (5 pts) (nesting depth added 10). 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.
D2 · Cognitive Complexity · workflowTriggerDescription.workflowTriggerDescription (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · VoiceNoteComposerRecorder.build (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · ReadStateManager.mergeEvents (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · AddMemberDialog.DirectAddMemberForm (cognitive 39) · ×1
  • AddMemberDialog.DirectAddMemberForm (cognitive 39) desktop/src/features/community-members/ui/AddMemberDialog.tsx:57 — 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, 30 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.
D2 · Cognitive Complexity · SystemMessageRow.SystemMessageRow (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · CreatePullRequestDialog.CreatePullRequestDialog (cognitive 39) · ×1
  • 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, 30 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · entityLink.parseEntityLink (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · HuddleAudioEngine.runCapture (cognitive 38) · ×1
  • HuddleAudioEngine.runCapture (cognitive 38) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/HuddleAudioEngine.kt:305 — HuddleAudioEngine.runCapture has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (28 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.
D2 · Cognitive Complexity · AddChannelMembersSheet.build (cognitive 38) · ×1
  • AddChannelMembersSheet.build (cognitive 38) mobile/lib/features/channels/add_members_sheet.dart:24 — AddChannelMembersSheet.build has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 11 (13 pts), loops 4 (7 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · CommunityThemeNotifier.build (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · ComposerImageEditor.ComposerImageEditor (cognitive 38) · ×1
  • 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 219, 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.
D2 · Cognitive Complexity · SetupStep.RuntimeCard (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · VoiceSettingsCard.VoiceSettingsCard (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · InvitePage.InvitePage (cognitive 38) · ×1
  • 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 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.
D2 · Cognitive Complexity · _RecentPhotoGalleryPicker.build (cognitive 37) · ×1
  • _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.
D2 · Cognitive Complexity · ChannelMemberInviteCard.ChannelMemberInviteCard (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · useCommunityJoinAlerts.useCommunityJoinAlerts (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectConversationPanel.ProjectConversationPanel (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectRepositoryPanel.RepositoryFilesPanel (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelTemplatesSettingsCard.TemplateFormDialog (cognitive 37) · ×1
  • 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). Of this number, 16 points are the body's own statements and 21 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.
D2 · Cognitive Complexity · MessageLinkPill.MessageLinkPillContents (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · GitStore · ×1
  • 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.
D2 · Cognitive Complexity · BuzzDevPushEnrollmentDriver.enroll (cognitive 36) · ×1
  • BuzzDevPushEnrollmentDriver.enroll (cognitive 36) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:406 — BuzzDevPushEnrollmentDriver.enroll has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 19, if/else 12 (15 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · managedAgentControlActions.deleteManagedAgentWithRules (cognitive 36) · ×1
  • managedAgentControlActions.deleteManagedAgentWithRules (cognitive 36) desktop/src/features/agents/lib/managedAgentControlActions.ts:142 — 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.
D2 · Cognitive Complexity · UserMessageBubble.UserMessageBubble (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · TeamDialog.TeamDialog (cognitive 36) · ×1
  • 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). Of this number, 21 points are the body's own statements and 15 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.
D2 · Cognitive Complexity · ChannelScreenHeader.ChannelScreenHeader (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · MembersSidebarMemberCard.MemberActionsMenu (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · MicControls.MicControls (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · SetupStep.RuntimeProvidersSection (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · MergePullRequestButton.MergePullRequestButton (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelContextMenu.ChannelContextMenuItems (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · SidebarProjectsSection.SidebarProjectsSectionContent (cognitive 36) · ×1
  • 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 literals inside it that branch (lines 226, 299, 211, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · buzz_pubsub · ×1
  • 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.
D2 · Cognitive Complexity · _InboxRow.build (cognitive 35) · ×1
  • _InboxRow.build (cognitive 35) mobile/lib/features/activity/activity_page/inbox_row.dart:68 — _InboxRow.build has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 8 (10 pts), boolean chains 8, loops 3 (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.
D2 · Cognitive Complexity · _HuddleCallAvatar.build (cognitive 35) · ×1
  • _HuddleCallAvatar.build (cognitive 35) mobile/lib/features/channels/channel_detail_page/huddle_call_avatar.dart:28 — _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.
D2 · Cognitive Complexity · _IOSInlinePhotoPicker.build (cognitive 35) · ×1
  • _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.
D2 · Cognitive Complexity · SetStatusDialog.SetStatusDialog (cognitive 35) · ×1
  • 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). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
D2 · Cognitive Complexity · ActivityNotifier._resurfaceHiddenDm (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · _InlineCameraPreview.build (cognitive 34) · ×1
  • _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.
D2 · Cognitive Complexity · ManageChannelSheet.build (cognitive 34) · ×1
  • ManageChannelSheet.build (cognitive 34) mobile/lib/features/channels/manage_channel_sheet.dart:22 — ManageChannelSheet.build has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 10 (15 pts), if/else 8 (10 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · ProfileAvatarCropPage.build (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · agentConfigControls.AgentModelField (cognitive 34) · ×1
  • 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 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.
D2 · Cognitive Complexity · InboxMessageRow.InboxMessageRow (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · AddAgentDialog.AddAgentDialog (cognitive 34) · ×1
  • AddAgentDialog.AddAgentDialog (cognitive 34) desktop/src/features/huddle/components/AddAgentDialog.tsx:31 — AddAgentDialog.AddAgentDialog has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 11 (12 pts), error handling 3 (6 pts), boolean chains 2 (nesting depth added 10). Of this number, 26 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · MessageActionBar.MoreActionsMenu (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · hooks.useAppOnboardingState (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectChannelHome.ProjectChannelHome (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · HarnessRow.HarnessRow (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · _ThreadMessage.build (cognitive 33) · ×1
  • _ThreadMessage.build (cognitive 33) mobile/lib/features/channels/thread_detail_page/thread_message.dart:35 — _ThreadMessage.build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 8 (10 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.
D2 · Cognitive Complexity · PairingNotifier._continueAfterSas (cognitive 33) · ×1
  • PairingNotifier._continueAfterSas (cognitive 33) mobile/lib/features/pairing/pairing_provider.dart:194 — 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.
D2 · Cognitive Complexity · useChannelUnreadState.useChannelUnreadState (cognitive 33) · ×1
  • useChannelUnreadState.useChannelUnreadState (cognitive 33) desktop/src/features/channels/ui/useChannelUnreadState.ts:62 — useChannelUnreadState.useChannelUnreadState has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (19 pts), loops 5 (6 pts), boolean chains 5, ternaries 3 (nesting depth added 3). Most of this is not in the body itself: 7 of the 33 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 454, 238, 275, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MembersSidebarMemberCard.MembersSidebarMemberCard (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · useMembersSidebarActions.useMembersSidebarActions (cognitive 33) · ×1
  • useMembersSidebarActions.useMembersSidebarActions (cognitive 33) desktop/src/features/channels/ui/useMembersSidebarActions.ts:55 — useMembersSidebarActions.useMembersSidebarActions has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 11 (13 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). Of this number, 30 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.
D2 · Cognitive Complexity · hooks.useChannelSubscription (cognitive 33) · ×1
  • hooks.useChannelSubscription (cognitive 33) desktop/src/features/messages/hooks.ts:318 — 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). Most of this is not in the body itself: 0 of the 33 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 327, 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.
D2 · Cognitive Complexity · SetupStep.RuntimeStatus (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · UserProfilePanelTabs.ProfileRuntimeTabContent (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · projectActivity.summarizeProjectActivityEvents (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · workflowFormTypes.actionFieldsForStep (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · CodeBlock.SyntaxHighlightedCode (cognitive 33) · ×1
  • 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 4 function literals inside it that branch (lines 150, 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.
D2 · Cognitive Complexity · buzz_admin · ×1
  • buzz_admin::reconcile_channels (cognitive 32) crates/buzz-admin/src/main.rs:623 — buzz_admin::reconcile_channels has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (6 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ClientMessage · ×1
  • ClientMessage::parse (cognitive 32) crates/buzz-relay/src/protocol.rs:43 — 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.
D2 · Cognitive Complexity · exhaustive.check_compaction_safety (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelMessagesNotifier._handleLiveEvent (cognitive 32) · ×1
  • ChannelMessagesNotifier._handleLiveEvent (cognitive 32) mobile/lib/features/channels/channel_messages_provider.dart:285 — 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.
D2 · Cognitive Complexity · agentSessionTranscriptGrouping.buildBlocksForRun (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · observedUnreadStorage.pruneEventsByChannel (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · InviteLinkSection.InviteLinkSection (cognitive 32) · ×1
  • 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, 21 points are the body's own statements and 11 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.
D2 · Cognitive Complexity · useHomeInboxReadState.useHomeInboxReadState (cognitive 32) · ×1
  • useHomeInboxReadState.useHomeInboxReadState (cognitive 32) desktop/src/features/home/useHomeInboxReadState.ts:147 — useHomeInboxReadState.useHomeInboxReadState has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, loops 3 (4 pts), ternaries 2 (nesting depth added 10). Most of this is not in the body itself: 0 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 211, 171, 276). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ParticipantList.HuddleParticipantsControl (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · ComposerAttachments.ComposerAttachments (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · useNewMessageRecipients.useNewMessageRecipients (cognitive 32) · ×1
  • useNewMessageRecipients.useNewMessageRecipients (cognitive 32) desktop/src/features/messages/ui/useNewMessageRecipients.ts:63 — useNewMessageRecipients.useNewMessageRecipients has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 16, if/else 7 (8 pts), ternaries 4 (5 pts), loops 3 (nesting depth added 2). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 122, 101, 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.
D2 · Cognitive Complexity · useProfileInteractionActions.useProfileInteractionActions (cognitive 32) · ×1
  • useProfileInteractionActions.useProfileInteractionActions (cognitive 32) desktop/src/features/profile/ui/useProfileInteractionActions.ts:71 — useProfileInteractionActions.useProfileInteractionActions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 10, ternaries 3 (8 pts), error handling 2 (nesting depth added 6). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 117, 195, 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.
D2 · Cognitive Complexity · ProjectsAgentPromptPage.ProjectsAgentPromptPage (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · _MessageBubble.build (cognitive 31) · ×1
  • _MessageBubble.build (cognitive 31) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:30 — _MessageBubble.build has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 6, loops 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.
D2 · Cognitive Complexity · _SystemMessageRow.build (cognitive 31) · ×1
  • _SystemMessageRow.build (cognitive 31) mobile/lib/features/channels/channel_detail_page/system_rows.dart:22 — _SystemMessageRow.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 10, if/else 5, 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.
D2 · Cognitive Complexity · MessageContent._buildLink (cognitive 31) · ×1
  • MessageContent._buildLink (cognitive 31) mobile/lib/features/channels/message_content.dart:400 — 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.
D2 · Cognitive Complexity · VoiceNoteAttachment.build (cognitive 31) · ×1
  • VoiceNoteAttachment.build (cognitive 31) mobile/lib/features/channels/voice_note_attachment.dart:43 — VoiceNoteAttachment.build has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 18, 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.
D2 · Cognitive Complexity · CommunityThemeSyncManager.flush (cognitive 31) · ×1
  • CommunityThemeSyncManager.flush (cognitive 31) mobile/lib/shared/theme/community_theme_sync.dart:232 — 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.
D2 · Cognitive Complexity · LifecycleActivity.LifecycleActivity (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · CanvasHistoryPanel.CanvasHistoryPanel (cognitive 31) · ×1
  • 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: 15 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 198, 89, 212, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · buildMentionCandidates.buildMentionCandidates (cognitive 31) · ×1
  • 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 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.
D2 · Cognitive Complexity · machineOnboarding.useMachineOnboardingState (cognitive 31) · ×1
  • machineOnboarding.useMachineOnboardingState (cognitive 31) desktop/src/features/onboarding/machineOnboarding.ts:99 — machineOnboarding.useMachineOnboardingState has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, if/else 14, ternaries 2. Of this number, 20 points are the body's own statements and 11 belong to 7 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UserProfilePanelFields.buildOwnerFields (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectAgentChatPanel.ProjectAgentChatPanel (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · PrivateKeyBackupRow.PrivateKeyBackupRow (cognitive 31) · ×1
  • 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowMessageTextConditionEditor.WorkflowMessageTextCondition (cognitive 31) · ×1
  • 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 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.
D2 · Cognitive Complexity · AppDelegate.handleMediaUploadMethodCall (cognitive 30) · ×1
  • AppDelegate.handleMediaUploadMethodCall (cognitive 30) mobile/ios/Runner/AppDelegate.swift:649 — 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.
D2 · Cognitive Complexity · MediaSanitizer.scrubJpeg (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · NativeEmojiPickerDataLoader.parse (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · ActivityNotifier._fetch (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · MediaUploadService.uploadVideo (cognitive 30) · ×1
  • MediaUploadService.uploadVideo (cognitive 30) mobile/lib/shared/relay/media_upload.dart:365 — 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.
D2 · Cognitive Complexity · ChannelRouteScreen.ChannelRouteScreen (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · providerApiKeyFieldState.getProviderApiKeyFieldState (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · CompactMessageSummary.CompactMessageSummary (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · useForumMentionPreparation.useForumMentionPreparation (cognitive 30) · ×1
  • useForumMentionPreparation.useForumMentionPreparation (cognitive 30) desktop/src/features/forum/ui/useForumMentionPreparation.ts:18 — useForumMentionPreparation.useForumMentionPreparation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, ternaries 3 (5 pts), error handling 2 (nesting depth added 6). Most of this is not in the body itself: 0 of the 30 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 121, 60, 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.
D2 · Cognitive Complexity · HuddleAttachment.HuddleAttachment (cognitive 30) · ×1
  • 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, 19 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.
D2 · Cognitive Complexity · useLinkEditor.useLinkEditor (cognitive 30) · ×1
  • useLinkEditor.useLinkEditor (cognitive 30) desktop/src/features/messages/lib/useLinkEditor.tsx:70 — useLinkEditor.useLinkEditor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (20 pts), ternaries 7, boolean chains 2, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 80, 179, 243, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DefaultConfigStep.AgentDefaultsSection (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · selfProfileStorage.trimSelfProfileCaches (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · projectDetailAgentContext.projectDetailAgentContextBlock (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · use-updater.useUpdater (cognitive 30) · ×1
  • use-updater.useUpdater (cognitive 30) desktop/src/features/settings/hooks/use-updater.ts:54 — use-updater.useUpdater has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 4, error handling 3 (nesting depth added 6). Most of this is not in the body itself: 0 of the 30 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 125, 68, 79, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · inviteHelpers.parseInviteInput (cognitive 30) · ×1
  • inviteHelpers.parseInviteInput (cognitive 30) desktop/src/shared/api/inviteHelpers.ts: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.
D2 · Cognitive Complexity · HarnessRelay · ×1
  • HarnessRelay::discover_channels (cognitive 29) crates/buzz-acp/src/relay.rs:818 — 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.
D2 · Cognitive Complexity · AndroidVoiceNotePackager.writeBlackVideoTrack (cognitive 29) · ×1
  • AndroidVoiceNotePackager.writeBlackVideoTrack (cognitive 29) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/AndroidVoiceNotePackager.kt:81 — AndroidVoiceNotePackager.writeBlackVideoTrack has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 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.
D2 · Cognitive Complexity · exhaustive.test_merge_algebra_a (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · exhaustive.test_tombstone_merge_monotonic (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · BuzzPushBootstrap.build (cognitive 29) · ×1
  • BuzzPushBootstrap.build (cognitive 29) mobile/lib/shared/push/push_bootstrap.dart:160 — BuzzPushBootstrap.build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 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.
D2 · Cognitive Complexity · PersonaModelCombobox.PersonaModelCombobox (cognitive 29) · ×1
  • PersonaModelCombobox.PersonaModelCombobox (cognitive 29) desktop/src/features/agents/ui/PersonaModelCombobox.tsx:21 — 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). Of this number, 15 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.
D2 · Cognitive Complexity · agentSessionTranscriptGrouping.splitIntoSessionRuns (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · useObserverEvents.useLoadArchivedObserverEvents (cognitive 29) · ×1
  • useObserverEvents.useLoadArchivedObserverEvents (cognitive 29) desktop/src/features/agents/ui/useObserverEvents.ts:115 — useObserverEvents.useLoadArchivedObserverEvents has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16, boolean chains 6, error handling 4 (6 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 272, 210, 159, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MeshComputeSettingsCard.StatusLine (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · FormattingToolbar.FormattingToolbar (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · desktop.listenForDesktopNotificationActions (cognitive 29) · ×1
  • desktop.listenForDesktopNotificationActions (cognitive 29) desktop/src/features/notifications/lib/desktop.ts:194 — 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 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.
D2 · Cognitive Complexity · SetupStep.SetupStepContent (cognitive 29) · ×1
  • 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, 20 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · hooks.usePresenceSession (cognitive 29) · ×1
  • hooks.usePresenceSession (cognitive 29) desktop/src/features/presence/hooks.ts:224 — hooks.usePresenceSession has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 10, boolean chains 2, error handling 1 (nesting depth added 7). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 362, 265, 298, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · projectIssues.assignmentStateForIssue (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectEntityListRow.ProjectEntityListRow (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · HarnessCatalogDialog.CatalogDetail (cognitive 29) · ×1
  • 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, 27 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.
D2 · Cognitive Complexity · BestieGlobalOverlay.BestieGlobalOverlay (cognitive 29) · ×1
  • 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 literals inside it that branch (lines 94, 140, 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.
D2 · Cognitive Complexity · RelayClient.sendRawWithReconnectRetry (cognitive 29) · ×1
  • 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 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.
D2 · Cognitive Complexity · useResolvedLinkPreviews.createMetadataLoader (cognitive 29) · ×1
  • useResolvedLinkPreviews.createMetadataLoader (cognitive 29) desktop/src/shared/lib/useResolvedLinkPreviews.ts:182 — useResolvedLinkPreviews.createMetadataLoader has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 8, loops 2 (nesting depth added 4). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 253, 198, 241, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · exhaustive.explore_b (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · PairingNotifier._handlePairingEvent (cognitive 28) · ×1
  • PairingNotifier._handlePairingEvent (cognitive 28) mobile/lib/features/pairing/pairing_provider.dart:513 — PairingNotifier._handlePairingEvent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, error handling 2 (3 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.
D2 · Cognitive Complexity · HuddleSessionNotifier._wireMediaAndTransport (cognitive 28) · ×1
  • HuddleSessionNotifier._wireMediaAndTransport (cognitive 28) mobile/lib/shared/huddle/huddle_session.dart:400 — 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.
D2 · Cognitive Complexity · RelaySessionNotifier._handleClosed (cognitive 28) · ×1
  • RelaySessionNotifier._handleClosed (cognitive 28) mobile/lib/shared/relay/relay_session.dart:710 — RelaySessionNotifier._handleClosed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · ChannelCanvas.ChannelCanvas (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · ForumView.ForumView (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · use-feed-desktop-notifications.useFeedDesktopNotifications (cognitive 28) · ×1
  • 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). Most of this is not in the body itself: 0 of the 28 points are its own statements 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.
D2 · Cognitive Complexity · useProjectSidebarMembership.useProjectSidebarMembership (cognitive 28) · ×1
  • 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. Most of this is not in the body itself: 0 of the 28 points are its own statements 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.
D2 · Cognitive Complexity · ProjectsActivityFeed.ActivityCard (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · NotificationSettingsCard.NotificationSettingsCard (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · relayClosedRecovery.handleRelayClosed (cognitive 28) · ×1
  • relayClosedRecovery.handleRelayClosed (cognitive 28) desktop/src/shared/api/relayClosedRecovery.ts:26 — 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 literals inside it that branch (lines 66, 85, 77). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · WorkflowDef · ×1
  • 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.
D2 · Cognitive Complexity · ActivityNotifier._subscribeChannelBatches (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · _DeepLinkDispatcherState._maybeDispatchInvite (cognitive 27) · ×1
  • _DeepLinkDispatcherState._maybeDispatchInvite (cognitive 27) mobile/lib/features/channels/deep_link_dispatcher.dart:160 — _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.
D2 · Cognitive Complexity · InviteJoinNotifier.confirmJoin (cognitive 27) · ×1
  • InviteJoinNotifier.confirmJoin (cognitive 27) mobile/lib/features/invites/invite_join_provider.dart:159 — 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.
D2 · Cognitive Complexity · UserProfileSheet.build (cognitive 27) · ×1
  • UserProfileSheet.build (cognitive 27) mobile/lib/features/profile/user_profile_sheet.dart:47 — UserProfileSheet.build has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 7 (11 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodChannelHuddleMedia._handleNativeCall (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · AdminConsoleStaffingTab.StaffingTab (cognitive 27) · ×1
  • AdminConsoleStaffingTab.StaffingTab (cognitive 27) desktop/src/features/admin-console/AdminConsoleStaffingTab.tsx:471 — AdminConsoleStaffingTab.StaffingTab has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 8, error handling 3, ternaries 2. Of this number, 16 points are the body's own statements and 11 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.
D2 · Cognitive Complexity · AddTeamToChannelDialog.AddTeamToChannelDialog (cognitive 27) · ×1
  • 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, 22 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.
D2 · Cognitive Complexity · PersonaShareRecipients.PersonaShareRecipients (cognitive 27) · ×1
  • 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). Of this number, 14 points are the body's own statements and 13 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · agentConfigControls.AgentDropdownSelect (cognitive 27) · ×1
  • 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, 17 points are the body's own statements and 10 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.
D2 · Cognitive Complexity · ToolDetailBlocks.ToolDetailBlocks (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · useApplyTemplate.useApplyTemplate (cognitive 27) · ×1
  • useApplyTemplate.useApplyTemplate (cognitive 27) desktop/src/features/channel-templates/useApplyTemplate.ts:29 — useApplyTemplate.useApplyTemplate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 3 (4 pts), error handling 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeedSection.FeedSection (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · hooks.useSendMessageMutation (cognitive 27) · ×1
  • 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). Most of this is not in the body itself: 0 of the 27 points are its own statements 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.
D2 · Cognitive Complexity · workflowActivationWarning.matchesEveryHour (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · BestiePopover.BestiePopover (cognitive 27) · ×1
  • 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 literals inside it that branch (lines 357, 262, 305, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · RelayClient.handleWsMessage (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · linkPreviewSnapshot.parseLinkPreviewSnapshots (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · use-repo-refs.parseRefs (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · desktop_release.validate (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · NativeEmojiCategoryTracker.selectedSectionID (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · BuzzPushNotificationResolver.refreshPresentation (cognitive 26) · ×1
  • BuzzPushNotificationResolver.refreshPresentation (cognitive 26) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:305 — BuzzPushNotificationResolver.refreshPresentation has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 17, if/else 6, ternaries 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.
D2 · Cognitive Complexity · _MorphingQuickActionsButton.build (cognitive 26) · ×1
  • _MorphingQuickActionsButton.build (cognitive 26) mobile/lib/features/channels/channels_page/quick_actions.dart:31 — _MorphingQuickActionsButton.build has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (18 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.
D2 · Cognitive Complexity · agentSessionToolCatalog.getBuzzToolInfo (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · usePersonaSync.startPersonaSync (cognitive 26) · ×1
  • 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). Most of this is not in the body itself: 0 of the 26 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 377, 343, 356, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AddAgentToChannelDialog.AddAgentToChannelDialog (cognitive 26) · ×1
  • 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, 20 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · usePersonaModelDiscovery.usePersonaModelDiscovery (cognitive 26) · ×1
  • usePersonaModelDiscovery.usePersonaModelDiscovery (cognitive 26) desktop/src/features/agents/ui/usePersonaModelDiscovery.ts:171 — usePersonaModelDiscovery.usePersonaModelDiscovery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 8, ternaries 5 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 248, 229, 304, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · observedUnreadStorage.pruneObservedUnreadByMarkers (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · BotActivityBar.BotActivityComposerAction (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · sendToChannelSemantics.getSendToChannelSemantics (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · AnimatedAvatarControls.AvatarFramingSlider (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectPullRequestFilesChangedPanel.DiffPreview (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectsChannelsList.ProjectsChannelsList (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · LaneReconciler.runAttempt (cognitive 26) · ×1
  • 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 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.
D2 · Cognitive Complexity · useChannelMutes.useChannelMutes (cognitive 26) · ×1
  • useChannelMutes.useChannelMutes (cognitive 26) desktop/src/features/sidebar/lib/useChannelMutes.ts:19 — useChannelMutes.useChannelMutes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 4. Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 77, 142, 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.
D2 · Cognitive Complexity · useChannelStars.useChannelStars (cognitive 26) · ×1
  • useChannelStars.useChannelStars (cognitive 26) desktop/src/features/sidebar/lib/useChannelStars.ts:19 — useChannelStars.useChannelStars has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 4. Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 77, 142, 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.
D2 · Cognitive Complexity · SidebarSection.SidebarSection (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cognitive 26) · ×1
  • useSidebarRelayConnectionCard.useSidebarRelayConnectionCard (cognitive 26) desktop/src/features/sidebar/ui/useSidebarRelayConnectionCard.ts:63 — useSidebarRelayConnectionCard.useSidebarRelayConnectionCard has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 11, ternaries 1 (nesting depth added 2). 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 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.
D2 · Cognitive Complexity · mediaUrl.fetchProxyPort (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ThemeProvider.ThemeProvider (cognitive 26) · ×1
  • ThemeProvider.ThemeProvider (cognitive 26) desktop/src/shared/theme/ThemeProvider.tsx:480 — 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 678, 537, 555, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CommunityThemeController.CommunityThemeController (cognitive 26) · ×1
  • 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. Most of this is not in the body itself: 0 of the 26 points are its own statements 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.
D2 · Cognitive Complexity · compact-link-preview-attachment.CompactLinkPreviewAttachment (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · entityLinks.EntityMetadataTooltip (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · buzz_push_gateway · ×1
  • buzz_push_gateway::app_attest::verify_attestation_environment (cognitive 25) crates/buzz-push-gateway/src/app_attest.rs:142 — buzz_push_gateway::app_attest::verify_attestation_environment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (9 pts), match/switch 3 (7 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.
D2 · Cognitive Complexity · exhaustive.enabled_transitions (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · BuzzPushPresentationCacheStore.updateProfiles (cognitive 25) · ×1
  • BuzzPushPresentationCacheStore.updateProfiles (cognitive 25) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:196 — BuzzPushPresentationCacheStore.updateProfiles has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 9, ternaries 2 (4 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.
D2 · Cognitive Complexity · HuddleSessionNotifier.join (cognitive 25) · ×1
  • HuddleSessionNotifier.join (cognitive 25) mobile/lib/shared/huddle/huddle_session.dart:214 — 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.
D2 · Cognitive Complexity · HuddleSessionNotifier._drainPlayback (cognitive 25) · ×1
  • HuddleSessionNotifier._drainPlayback (cognitive 25) mobile/lib/shared/huddle/huddle_session.dart:515 — 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.
D2 · Cognitive Complexity · UserCacheNotifier._flushPending (cognitive 25) · ×1
  • UserCacheNotifier._flushPending (cognitive 25) mobile/lib/shared/profile/user_cache_provider.dart:121 — UserCacheNotifier._flushPending has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, loops 1 (2 pts), error handling 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.
D2 · Cognitive Complexity · BuzzPushLeaseDescriptor.fromRelayInformation (cognitive 25) · ×1
  • BuzzPushLeaseDescriptor.fromRelayInformation (cognitive 25) mobile/lib/shared/push/dev_push_lease.dart:44 — BuzzPushLeaseDescriptor.fromRelayInformation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddChannelBotDialog.AddChannelBotDialog (cognitive 25) · ×1
  • 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, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · communityUnreadObserver.fetchCommunityUnread (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · CommunityMembersSettingsCard.RelayMemberRow (cognitive 25) · ×1
  • 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalArchiveSettingsCard.LocalArchiveSettingsCard (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · useEnsureAgentMentionsReady.useEnsureAgentMentionsReady (cognitive 25) · ×1
  • 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). Most of this is not in the body itself: 0 of the 25 points are its own statements 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.
D2 · Cognitive Complexity · useAutoPinMentionedAgents.useAutoPinMentionedAgents (cognitive 25) · ×1
  • useAutoPinMentionedAgents.useAutoPinMentionedAgents (cognitive 25) desktop/src/features/messages/ui/useAutoPinMentionedAgents.ts:35 — useAutoPinMentionedAgents.useAutoPinMentionedAgents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, boolean chains 6, ternaries 5 (6 pts), loops 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 138, 92, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · UserProfileAgentActions.UserProfileAgentSettingsMenu (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectRepositoryPanel.repositoryEntries (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectHomeWorkspaceSheet.ProjectHomeWorkspaceSheet (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · EncryptedBackupProvider.EncryptedBackupProvider (cognitive 25) · ×1
  • 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). Most of this is not in the body itself: 0 of the 25 points are its own statements 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.
D2 · Cognitive Complexity · SendFeedbackDialog.SendFeedbackDialog (cognitive 25) · ×1
  • 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). Of this number, 21 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.
D2 · Cognitive Complexity · workflowConditionExpression.parseConditionExpression (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · ComposeDraft.fromJson (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · ProfileTextEditSheet.build (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · UserStatusCacheNotifier._fetchStatuses (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · _ConnectionSection.build (cognitive 24) · ×1
  • _ConnectionSection.build (cognitive 24) mobile/lib/features/settings/settings_page/connection_section.dart:8 — _ConnectionSection.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 2 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FrostedAppBar.build (cognitive 24) · ×1
  • FrostedAppBar.build (cognitive 24) mobile/lib/shared/widgets/frosted_app_bar.dart:172 — FrostedAppBar.build has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 16, boolean chains 7, if/else 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · useChannelPaneHandlers.useChannelPaneHandlers (cognitive 24) · ×1
  • useChannelPaneHandlers.useChannelPaneHandlers (cognitive 24) desktop/src/features/channels/useChannelPaneHandlers.ts:24 — useChannelPaneHandlers.useChannelPaneHandlers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 4, loops 1 (2 pts), ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 346, 174, 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.
D2 · Cognitive Complexity · ComposerAddressControls.ComposerMentionButton (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · hooks.useNotificationSettings (cognitive 24) · ×1
  • hooks.useNotificationSettings (cognitive 24) desktop/src/features/notifications/hooks.ts:182 — hooks.useNotificationSettings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts), error handling 1 (nesting depth added 6). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 315, 245, 236, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NsecMaskedDisplay.NsecMaskedDisplay (cognitive 24) · ×1
  • 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, 23 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.
D2 · Cognitive Complexity · ProfileStep.ProfileStep (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · RepositoryCards.RepositoryHostIcon (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · AgentSnapshotCard.AgentSnapshotCard (cognitive 24) · ×1
  • 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AndroidMediaSanitizer.scrubJpeg (cognitive 23) · ×1
  • AndroidMediaSanitizer.scrubJpeg (cognitive 23) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/AndroidMediaSanitizer.kt:44 — AndroidMediaSanitizer.scrubJpeg has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 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.
D2 · Cognitive Complexity · desktop_release.previous_release (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · NativeAttachmentPopoverViewController.configureAndStartCamera (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelMessagesNotifier.cachedThreadReplyIds (cognitive 23) · ×1
  • ChannelMessagesNotifier.cachedThreadReplyIds (cognitive 23) mobile/lib/features/channels/channel_messages_provider.dart:536 — 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.
D2 · Cognitive Complexity · _IOSAttachmentPopoverCoordinator.present (cognitive 23) · ×1
  • _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.
D2 · Cognitive Complexity · _SetStatusSheet.build (cognitive 23) · ×1
  • _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.
D2 · Cognitive Complexity · useAppNavigation.useAppNavigation (cognitive 23) · ×1
  • useAppNavigation.useAppNavigation (cognitive 23) desktop/src/app/navigation/useAppNavigation.ts:24 — useAppNavigation.useAppNavigation has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 17, if/else 5, boolean chains 1. Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 131, 264, 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.
D2 · Cognitive Complexity · agentSessionToolClassifier.findBuzzCommand (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · observerRelayStore.processLiveObserverEvents (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · EnvVarsEditor.EnvVarsEditor (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · EditAgentAdvancedFields.EditAgentAdvancedFields (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · useCommunityUnread.useCommunityUnread (cognitive 23) · ×1
  • useCommunityUnread.useCommunityUnread (cognitive 23) desktop/src/features/communities/useCommunityUnread.ts:50 — useCommunityUnread.useCommunityUnread has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 8). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 113, 164, 73, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MessageActionBar.MessageActionBar (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · useNonMemberInvite.useNonMemberInvite (cognitive 23) · ×1
  • useNonMemberInvite.useNonMemberInvite (cognitive 23) desktop/src/features/messages/ui/useNonMemberInvite.ts:15 — useNonMemberInvite.useNonMemberInvite has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 1 (2 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 94, 60, 79, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MessageComposerToolbar.MessageComposerToolbar (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · agentReadiness.resolveAgentReadiness (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · AnimatedAvatarCameraControls.AnimatedAvatarCameraControls (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · UserProfilePanelPersonaSubmit.submitProfilePersonaDialog (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · useProjectChannelRequests.useProjectChannelRequests (cognitive 23) · ×1
  • useProjectChannelRequests.useProjectChannelRequests (cognitive 23) desktop/src/features/projects/useProjectChannelRequests.ts:21 — useProjectChannelRequests.useProjectChannelRequests has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 4 (5 pts), error handling 1, loops 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · terminalBannerColor.bannerStops (cognitive 23) · ×1
  • 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 literals inside it that branch (lines 265, 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.
D2 · Cognitive Complexity · workflowConditionExpression.splitTopLevel (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · WorkflowsView.WorkflowsView (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · RepoBlobViewer.RepoBlobPage (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · eventToProjectPullRequest (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · RefPattern · ×1
  • 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.
D2 · Cognitive Complexity · AprilPocketTts · ×1
  • 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.
D2 · Cognitive Complexity · _HuddleButton.build (cognitive 22) · ×1
  • _HuddleButton.build (cognitive 22) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:159 — _HuddleButton.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, ternaries 5 (6 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.
D2 · Cognitive Complexity · _MobileHuddleCallPage.build (cognitive 22) · ×1
  • _MobileHuddleCallPage.build (cognitive 22) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:539 — _MobileHuddleCallPage.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, ternaries 3, loops 2, 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.
D2 · Cognitive Complexity · ChannelMessagesNotifier._pruneOffWindowReplies (cognitive 22) · ×1
  • ChannelMessagesNotifier._pruneOffWindowReplies (cognitive 22) mobile/lib/features/channels/channel_messages_provider.dart:610 — 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.
D2 · Cognitive Complexity · MessageContent.build (cognitive 22) · ×1
  • MessageContent.build (cognitive 22) mobile/lib/features/channels/message_content.dart:159 — MessageContent.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 5 (7 pts), ternaries 6, boolean chains 1 (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.
D2 · Cognitive Complexity · PairingPage.build (cognitive 22) · ×1
  • PairingPage.build (cognitive 22) mobile/lib/features/pairing/pairing_page.dart:40 — PairingPage.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 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.
D2 · Cognitive Complexity · agentSessionToolClassifier.tokenizeShellCommand (cognitive 22) · ×1
  • 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 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.
D2 · Cognitive Complexity · AgentConfigPanel.AgentConfigSurfaceRows (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelMembersBar.ChannelMembersBar (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · useChannelIntro.useChannelIntro (cognitive 22) · ×1
  • 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). Most of this is not in the body itself: 0 of the 22 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · CommunityMembersCard.MemberRow (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · KlipyGifPicker.KlipyGifPicker (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · useHuddleParticipantRoster.compareLifecycleEvents (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · timelineItems.buildTimelineItems (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · useEmojiAutocomplete.useEmojiAutocomplete (cognitive 22) · ×1
  • useEmojiAutocomplete.useEmojiAutocomplete (cognitive 22) desktop/src/features/messages/lib/useEmojiAutocomplete.ts:50 — useEmojiAutocomplete.useEmojiAutocomplete has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, ternaries 4 (6 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 218, 156, 68, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · hooks.useUsersBatchQuery (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · AvatarCustomColorPanel.AvatarCustomColorPanel (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectPullRequestFilesChangedPanel.ProjectDiffFilesPanel (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · useAddProjectChannel.addProjectChannel (cognitive 22) · ×1
  • 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 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.
D2 · Cognitive Complexity · SignOutSection.SignOutSection (cognitive 22) · ×1
  • 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, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workflowDefinition.getActionCardClause (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · WorkflowTemplateTextarea.WorkflowTemplateTextarea (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · BloomMenu.Container (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · BloomMenu.Content (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · relayReconnectReplay.replayReconnectHistoryPages (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · useWebviewScrollBoundaryLock.useWebviewScrollBoundaryLock (cognitive 22) · ×1
  • 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). Most of this is not in the body itself: 0 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 85). 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.
D2 · Cognitive Complexity · AuxiliaryPanelHeader.AuxiliaryPanelHeader (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · CommunityThemeSyncManager.doPublish (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · markdown.ImageBlock (cognitive 22) · ×1
  • 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 literals inside it that branch (lines 1089, 1008, 1057, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · delivery.explore (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · prepare-inter.main (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ThemePaginationControl.updateDots (cognitive 21) · ×1
  • ThemePaginationControl.updateDots (cognitive 21) mobile/ios/Runner/ThemePaginationGlassControl.swift:164 — ThemePaginationControl.updateDots has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 3 (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.
D2 · Cognitive Complexity · VoiceNotePackager.makeVoiceNoteVideoTrack (cognitive 21) · ×1
  • 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuzzDevPushEnrollmentDriver.completeEnrollment (cognitive 21) · ×1
  • BuzzDevPushEnrollmentDriver.completeEnrollment (cognitive 21) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzDevPushEnrollmentDriver.swift:609 — BuzzDevPushEnrollmentDriver.completeEnrollment has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (10 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.
D2 · Cognitive Complexity · BuzzPushPresentationCacheStore.encodedBoundedSnapshot (cognitive 21) · ×1
  • BuzzPushPresentationCacheStore.encodedBoundedSnapshot (cognitive 21) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:455 — BuzzPushPresentationCacheStore.encodedBoundedSnapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 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.
D2 · Cognitive Complexity · _HuddleParticipantCluster.build (cognitive 21) · ×1
  • _HuddleParticipantCluster.build (cognitive 21) mobile/lib/features/channels/channel_detail_page/huddle_participant_cluster.dart:63 — _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.
D2 · Cognitive Complexity · _HuddleJoinSurface.build (cognitive 21) · ×1
  • _HuddleJoinSurface.build (cognitive 21) mobile/lib/features/channels/channel_detail_page/huddle_sheet.dart:258 — _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.
D2 · Cognitive Complexity · SendMessage._resolveMentions (cognitive 21) · ×1
  • SendMessage._resolveMentions (cognitive 21) mobile/lib/features/channels/send_message_provider.dart:157 — 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.
D2 · Cognitive Complexity · _ThreadStickyDateIndex.resolve (cognitive 21) · ×1
  • _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.
D2 · Cognitive Complexity · _PersonInviteSection.build (cognitive 21) · ×1
  • _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.
D2 · Cognitive Complexity · SearchPage.build (cognitive 21) · ×1
  • SearchPage.build (cognitive 21) mobile/lib/features/search/search_page.dart:105 — SearchPage.build has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13, if/else 5, boolean chains 2, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · IosGlassNavigationButton.build (cognitive 21) · ×1
  • IosGlassNavigationButton.build (cognitive 21) mobile/lib/shared/widgets/ios_glass_navigation_button.dart:106 — 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.
D2 · Cognitive Complexity · check-file-sizes-core.runFileSizeCheck (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · AdminConsoleFeedbackTab.AttachmentViewer (cognitive 21) · ×1
  • AdminConsoleFeedbackTab.AttachmentViewer (cognitive 21) desktop/src/features/admin-console/AdminConsoleFeedbackTab.tsx:170 — 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 216, 277, 206, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · agentAutocompleteEligibility.getMentionableAgentPubkeys (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · observerRelayStore.ingestArchivedObserverEvents (cognitive 21) · ×1
  • observerRelayStore.ingestArchivedObserverEvents (cognitive 21) desktop/src/features/agents/observerRelayStore.ts:847 — 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.
D2 · Cognitive Complexity · AgentCardViewerDialog.AgentCardViewerContent (cognitive 21) · ×1
  • 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, 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · agentSessionTranscriptPresentation.getActivityHeadline (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · TeamSnapshotImportDialog.ResultBody (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · imetaMediaMarkdown.findSpoileredImetaMediaUrls (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · mentionHighlightExtension.selectionAfterMentionTrailingSpace (cognitive 21) · ×1
  • mentionHighlightExtension.selectionAfterMentionTrailingSpace (cognitive 21) desktop/src/features/messages/lib/mentionHighlightExtension.ts: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.
D2 · Cognitive Complexity · selectionBlockFormatting.isolateCaretLineForBlockFormatting (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · DraftsPanel.DraftRow (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · SystemMessageAvatars.SystemMessageAvatar (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · useLoadMissingAncestors.useLoadMissingAncestors (cognitive 21) · ×1
  • 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). Most of this is not in the body itself: 0 of the 21 points are its own statements 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.
D2 · Cognitive Complexity · MembershipDenied.MembershipDenied (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · PresenceSubscriptionReconciler.reconcile (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · avatarProfileSync.createAvatarProfileSync (cognitive 21) · ×1
  • avatarProfileSync.createAvatarProfileSync (cognitive 21) desktop/src/features/profile/avatarProfileSync.ts:48 — avatarProfileSync.createAvatarProfileSync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 6, loops 1. Most of this is not in the body itself: 0 of the 21 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 76, 89, 101, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · projectModels.validateProjectEventEnvelope (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectRepositorySource.RepoSourceDropdown (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · EncryptedBackupCreator.EncryptedBackupCreator (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · SidebarSection.ChannelMenuButton (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · rehypeSearchHighlight.rehypeSearchHighlight (cognitive 21) · ×1
  • 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). Most of this is not in the body itself: 0 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 41). 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.
D2 · Cognitive Complexity · VideoPlayer.VideoScrubber (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · RepoDetailPage.RepoDetailPage (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · exhaustive.test_concurrent_stability (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · AppDelegate.didInitializeImplicitFlutterEngine (cognitive 20) · ×1
  • AppDelegate.didInitializeImplicitFlutterEngine (cognitive 20) mobile/ios/Runner/AppDelegate.swift:56 — AppDelegate.didInitializeImplicitFlutterEngine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 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.
D2 · Cognitive Complexity · ChannelsPage.build (cognitive 20) · ×1
  • ChannelsPage.build (cognitive 20) mobile/lib/features/channels/channels_page.dart:178 — ChannelsPage.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 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.
D2 · Cognitive Complexity · _ComposeBarLayout._buildBar (cognitive 20) · ×1
  • _ComposeBarLayout._buildBar (cognitive 20) mobile/lib/features/channels/compose_bar/layout.dart:84 — _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.
D2 · Cognitive Complexity · MobileHuddleController._start (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · MobileHuddleController.end (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · DeviceVoiceNotePlayerController._load (cognitive 20) · ×1
  • DeviceVoiceNotePlayerController._load (cognitive 20) mobile/lib/features/channels/voice_note_recording.dart:708 — 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.
D2 · Cognitive Complexity · _ThemePreviewExperience.build (cognitive 20) · ×1
  • _ThemePreviewExperience.build (cognitive 20) mobile/lib/features/settings/theme_picker_page/theme_preview_sheet.dart:11 — _ThemePreviewExperience.build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 6, boolean chains 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.
D2 · Cognitive Complexity · ReadStateManager._publish (cognitive 20) · ×1
  • ReadStateManager._publish (cognitive 20) mobile/lib/shared/read_state/read_state_manager.dart:381 — ReadStateManager._publish has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · RelaySessionNotifier._sendReplayBatches (cognitive 20) · ×1
  • RelaySessionNotifier._sendReplayBatches (cognitive 20) mobile/lib/shared/relay/relay_session.dart:592 — 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.
D2 · Cognitive Complexity · agentManagement.parseAgentManagementRequest (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · agentWorkingSignal.getWorkingChannels (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · agentConfigOptions.computeLocalModeGate (cognitive 20) · ×1
  • agentConfigOptions.computeLocalModeGate (cognitive 20) REDACTED:653 — 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.
D2 · Cognitive Complexity · AgentSessionTranscriptList.AgentSessionTranscriptList (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · HuddleAttachment.reconstructHuddleLifecycle (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · MessageReactions.ReactionPill (cognitive 20) · ×1
  • 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 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.
D2 · Cognitive Complexity · ProjectRepositoryPanel.fileIconVisual (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · RemindersPanel.ReminderRow (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · CreateChannelFormFields.CreateChannelFormFields (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · SidebarDnd.SidebarDndContext (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · workflowStepDescription.configuredStepDetail (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · detectPrefixQuery.detectPrefixQuery (cognitive 20) · ×1
  • detectPrefixQuery.detectPrefixQuery (cognitive 20) REDACTED: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.
D2 · Cognitive Complexity · exhaustive.test_merge_algebra_b (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · exhaustive._dead_register_points (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · exhaustive.test_escaped_context_slot_grouping (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · prepare-inter.verify (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · MP4Canonicalizer.neutralizeSampleDependencyBoxes (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · BuzzPushSnapshotBridge.syncCommunities (cognitive 19) · ×1
  • BuzzPushSnapshotBridge.syncCommunities (cognitive 19) mobile/ios/Runner/PushSnapshotBridge.swift:139 — 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.
D2 · Cognitive Complexity · ChannelQuickActionsLauncher.build (cognitive 19) · ×1
  • ChannelQuickActionsLauncher.build (cognitive 19) mobile/lib/features/channels/channels_page/quick_actions_launcher.dart:42 — ChannelQuickActionsLauncher.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5, boolean chains 4, 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.
D2 · Cognitive Complexity · _MentionSuggestionInfo.build (cognitive 19) · ×1
  • _MentionSuggestionInfo.build (cognitive 19) mobile/lib/features/channels/compose_bar/suggestions.dart:82 — _MentionSuggestionInfo.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · _MessageLongPressRegion.build (cognitive 19) · ×1
  • _MessageLongPressRegion.build (cognitive 19) mobile/lib/features/channels/message_long_press_region.dart:111 — _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.
D2 · Cognitive Complexity · PairingNotifier._pairNipAb (cognitive 19) · ×1
  • PairingNotifier._pairNipAb (cognitive 19) mobile/lib/features/pairing/pairing_provider.dart:361 — PairingNotifier._pairNipAb has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 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.
D2 · Cognitive Complexity · HuddleTransport._handleRoster (cognitive 19) · ×1
  • HuddleTransport._handleRoster (cognitive 19) mobile/lib/shared/huddle/huddle_transport.dart:628 — 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.
D2 · Cognitive Complexity · useAppShellDesktopNotifications.useAppShellDesktopNotifications (cognitive 19) · ×1
  • useAppShellDesktopNotifications.useAppShellDesktopNotifications (cognitive 19) desktop/src/app/useAppShellDesktopNotifications.ts:27 — useAppShellDesktopNotifications.useAppShellDesktopNotifications has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 4. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 71, 106, 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.
D2 · Cognitive Complexity · useAppShellKeyboardShortcuts.useAppShellKeyboardShortcuts (cognitive 19) · ×1
  • 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. Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 32). 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.
D2 · Cognitive Complexity · AdminConsoleReportsTab.ResolveReportForm (cognitive 19) · ×1
  • AdminConsoleReportsTab.ResolveReportForm (cognitive 19) desktop/src/features/admin-console/AdminConsoleReportsTab.tsx:362 — AdminConsoleReportsTab.ResolveReportForm has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 3 (4 pts), error handling 1, ternaries 1 (nesting depth added 1). 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 391, 444, 389, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useAutoRestartPolicy.useAutoRestartPolicy (cognitive 19) · ×1
  • useAutoRestartPolicy.useAutoRestartPolicy (cognitive 19) desktop/src/features/agents/lib/useAutoRestartPolicy.ts:38 — useAutoRestartPolicy.useAutoRestartPolicy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (2 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 58, 104, 48). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PersonaAdvancedFields.PersonaAdvancedFields (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · useManagedAgentRuntimeReconciliation.useManagedAgentRuntimeReconciliation (cognitive 19) · ×1
  • 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). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 75, 54, 118, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useRoutedMessageEdit.useRoutedMessageEdit (cognitive 19) · ×1
  • useRoutedMessageEdit.useRoutedMessageEdit (cognitive 19) desktop/src/features/channels/ui/useRoutedMessageEdit.ts:21 — useRoutedMessageEdit.useRoutedMessageEdit has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 4. 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 71, 58, 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.
D2 · Cognitive Complexity · EditCommunityDialog.EditCommunityDialog (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · useHuddleParticipantRoster.useHuddleParticipantRoster (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · resolveLinkAt.resolveLinkAt (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · useDrafts.readStore (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · useComposerVoiceNote.useComposerVoiceNote (cognitive 19) · ×1
  • useComposerVoiceNote.useComposerVoiceNote (cognitive 19) desktop/src/features/messages/ui/useComposerVoiceNote.tsx:13 — useComposerVoiceNote.useComposerVoiceNote has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 7, ternaries 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 110, 71, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useDraftPersistSnapshot.useDraftPersistLifecycle (cognitive 19) · ×1
  • useDraftPersistSnapshot.useDraftPersistLifecycle (cognitive 19) desktop/src/features/messages/ui/useDraftPersistSnapshot.ts:107 — useDraftPersistSnapshot.useDraftPersistLifecycle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 5 (8 pts), boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 184, 229, 257, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · submitMessageEdit.submitMessageEdit (cognitive 19) · ×1
  • submitMessageEdit.submitMessageEdit (cognitive 19) desktop/src/features/messages/ui/submitMessageEdit.ts:70 — submitMessageEdit.submitMessageEdit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), ternaries 3 (4 pts), boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 187, 146, 139, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MessageThreadSummaryRow.MessageThreadSummaryRow (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · useComposerHeightPadding.useComposerHeightPadding (cognitive 19) · ×1
  • 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). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · useChannelTyping.useChannelTyping (cognitive 19) · ×1
  • 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. Most of this is not in the body itself: 0 of the 19 points are its own statements 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.
D2 · Cognitive Complexity · notificationFormat.formatMessageNotification (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · hooks.useFirstRunOnboardingGate (cognitive 19) · ×1
  • hooks.useFirstRunOnboardingGate (cognitive 19) desktop/src/features/onboarding/hooks.ts:282 — hooks.useFirstRunOnboardingGate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 5 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.
D2 · Cognitive Complexity · UserProfilePanelTabs.ProfileLiveActivityEmbed (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · UserProfilePanelUtils.personaManagedAgentUpdate (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · UserProfilePrimaryActions.ProfilePrimaryActions (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectHomeContextPanel.ProjectHomeContextPanel (cognitive 19) · ×1
  • 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 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.
D2 · Cognitive Complexity · ProjectPullRequestFilesChangedPanel.changedFileIconVisual (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectDetailFeedPanels.ContributorsPanel (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectDetailFeedPanels.ActivityPanel (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectsSectionSearch.ProjectsSectionSearch (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · WorkflowScheduleFields.WorkflowScheduleFields (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · DesktopMeshRuntime · ×1
  • 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.
D2 · Cognitive Complexity · MobileInviteJoinRecovery.ensureStarterChannels (cognitive 18) · ×1
  • MobileInviteJoinRecovery.ensureStarterChannels (cognitive 18) mobile/lib/app.dart:114 — 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.
D2 · Cognitive Complexity · ObserverRelayNotifier._subscribe (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · _ToolItemWidget.build (cognitive 18) · ×1
  • _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.
D2 · Cognitive Complexity · _AttachmentSurfacePanel.build (cognitive 18) · ×1
  • _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.
D2 · Cognitive Complexity · _MarkdownEditingController._buildMarkdownSpans (cognitive 18) · ×1
  • _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.
D2 · Cognitive Complexity · _InviteLinkSection.build (cognitive 18) · ×1
  • _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.
D2 · Cognitive Complexity · SettingsProfileHeader.build (cognitive 18) · ×1
  • SettingsProfileHeader.build (cognitive 18) mobile/lib/features/profile/settings_profile_header.dart:31 — SettingsProfileHeader.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 4, if/else 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.
D2 · Cognitive Complexity · buildMemoryGraph.buildMemoryGraph (cognitive 18) · ×1
  • buildMemoryGraph.buildMemoryGraph (cognitive 18) desktop/src/features/agent-memory/lib/buildMemoryGraph.ts:56 — buildMemoryGraph.buildMemoryGraph has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 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.
D2 · Cognitive Complexity · MemorySection.MemoryGraphView (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · observerRelayStore.appendAgentEvents (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · usePersonaSync.fetchOwnerHistoryToExhaustion (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · CompactToolSummaryRow.CompactToolSummaryRow (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · observedUnreadStorage.readObservedUnreadFromStorage (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · huddlePresence.fetchHuddleLifecycleHistory (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · mentionPasteBinding.useMentionPasteBinding (cognitive 18) · ×1
  • 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). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · normalizeMentionClipboard.normalizeMentionClipboardContent (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · threadPanel.buildDescendantStatsByMessageId (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · useChannelLinks.useChannelLinks (cognitive 18) · ×1
  • useChannelLinks.useChannelLinks (cognitive 18) desktop/src/features/messages/lib/useChannelLinks.ts:47 — useChannelLinks.useChannelLinks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 2 (4 pts) (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 9 function literals inside it that branch (lines 157, 80, 87, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MessageReactions.MessageReactions (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · AvatarStep.AvatarStepActions (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · AnimatedAvatarBackdropPanel.AnimatedAvatarBackdropPanel (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · AnimatedAvatarControls.AvatarFilmstripPicker (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectRepositorySource.RepositoryBranchDropdown (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · reminderFilters.groupReminders (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · HarnessRow.RuntimeActions (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · useCreateChannelForm.useCreateChannelForm (cognitive 18) · ×1
  • useCreateChannelForm.useCreateChannelForm (cognitive 18) desktop/src/features/sidebar/lib/useCreateChannelForm.ts:60 — useCreateChannelForm.useCreateChannelForm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (4 pts), boolean chains 3, error handling 1 (nesting depth added 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 156, 128, 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.
D2 · Cognitive Complexity · SidebarRelayConnectionCard.SidebarRelayConnectionCompactCard (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · ReadOnlyRelayClient.handleWsMessage (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · RelayReconnectController.start (cognitive 18) · ×1
  • 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 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.
D2 · Cognitive Complexity · useInlineTooltipPosition.useInlineTooltipPosition (cognitive 18) · ×1
  • useInlineTooltipPosition.useInlineTooltipPosition (cognitive 18) desktop/src/shared/ui/markdown/useInlineTooltipPosition.ts:12 — useInlineTooltipPosition.useInlineTooltipPosition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, ternaries 1. Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 19, 41, 95, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sidebar-action-card.SidebarCompactActionCard (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · MediaConfig · ×1
  • 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.
D2 · Cognitive Complexity · buzz_relay_mesh · ×1
  • buzz_relay_mesh::runtime::control_stream_exchange (cognitive 17) crates/buzz-relay-mesh/src/runtime.rs:500 — 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.
D2 · Cognitive Complexity · AppDelegate.generateVideoPoster (cognitive 17) · ×1
  • AppDelegate.generateVideoPoster (cognitive 17) mobile/ios/Runner/AppDelegate.swift:963 — 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.
D2 · Cognitive Complexity · ActivityNotifier._subscribeLive (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelMessagesNotifier._init (cognitive 17) · ×1
  • ChannelMessagesNotifier._init (cognitive 17) mobile/lib/features/channels/channel_messages_provider.dart:162 — ChannelMessagesNotifier._init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 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.
D2 · Cognitive Complexity · ChannelSectionsManager._publish (cognitive 17) · ×1
  • ChannelSectionsManager._publish (cognitive 17) mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:461 — ChannelSectionsManager._publish has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · ChannelSectionStore.fromJson (cognitive 17) · ×1
  • ChannelSectionStore.fromJson (cognitive 17) mobile/lib/features/channels/channel_sections/channel_sections_storage.dart:52 — 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.
D2 · Cognitive Complexity · _BrowseChannelsSheet.build (cognitive 17) · ×1
  • _BrowseChannelsSheet.build (cognitive 17) mobile/lib/features/channels/channels_page/browse_channels_sheet.dart:6 — _BrowseChannelsSheet.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · MembersSheet.build (cognitive 17) · ×1
  • MembersSheet.build (cognitive 17) mobile/lib/features/channels/members_sheet.dart:29 — MembersSheet.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (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.
D2 · Cognitive Complexity · PairingNotifier._processPayload (cognitive 17) · ×1
  • PairingNotifier._processPayload (cognitive 17) mobile/lib/features/pairing/pairing_provider.dart:712 — PairingNotifier._processPayload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · _SearchBody.build (cognitive 17) · ×1
  • _SearchBody.build (cognitive 17) mobile/lib/features/search/search_page.dart:439 — _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.
D2 · Cognitive Complexity · ReadStateManager._mergeEvents (cognitive 17) · ×1
  • ReadStateManager._mergeEvents (cognitive 17) mobile/lib/shared/read_state/read_state_manager.dart:224 — ReadStateManager._mergeEvents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 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.
D2 · Cognitive Complexity · RelaySessionNotifier.queryRelay (cognitive 17) · ×1
  • RelaySessionNotifier.queryRelay (cognitive 17) mobile/lib/shared/relay/relay_session.dart:156 — RelaySessionNotifier.queryRelay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · agentSessionTranscript.upsertTool (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · AgentCardViewerDialog.AgentCardGalleryContent (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus (cognitive 17) · ×1
  • personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus (cognitive 17) desktop/src/features/agents/ui/personaModelDiscoveryStatus.ts:44 — personaModelDiscoveryStatus.formatModelDiscoveryErrorStatus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 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.
D2 · Cognitive Complexity · agentDefinitionSubmitPayload.buildRuntimeModelProviderPayload (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · agentSessionTranscriptGrouping.flattenDisplayBlocks (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · imetaMediaMarkdown.imetaMediaFromTags (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · extractMentionPubkeys.extractMentionPubkeys (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · mentionTokenSpans.findMentionTokenSpans (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · threadPanel.buildThreadSummaryFromVisibleEntries (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · DiffViewer.DiffViewer (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · useComposerLinkPreviews.ComposerLinkPreviewCard (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · UserProfilePanelSections.ProfileHero (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · useNoteActions.usePulseNoteActions (cognitive 17) · ×1
  • useNoteActions.usePulseNoteActions (cognitive 17) desktop/src/features/pulse/lib/useNoteActions.ts:38 — useNoteActions.usePulseNoteActions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), error handling 4 (nesting depth added 6). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 57, 119, 156, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NoteCard.NoteCard (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · parseSearchOperators.parseSearchOperators (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · CustomHarnessForm.CustomHarnessForm (cognitive 17) · ×1
  • 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, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · channelSectionsStorage.parseChannelSectionPayload (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · terminalRenderer.resolvePackedColor (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · CronExpressionInput.CronExpressionInput (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · RelayClient.resetConnection (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · deep-link.listenForEntityDeepLinks (cognitive 17) · ×1
  • 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). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 293, 319, 289). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useResolvedLinkPreviews.fetchBuzzEntityMetadata (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · remarkSpoilers.groupSpoilers (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · segmented-control.SegmentedControl (cognitive 17) · ×1
  • 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 literals inside it that branch (lines 121, 83, 105, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ObserverPublishQueue · ×1
  • ObserverPublishQueue::next_frame (cognitive 16) crates/buzz-acp/src/lib.rs:1038 — 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.
D2 · Cognitive Complexity · EffectiveRules · ×1
  • 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.
D2 · Cognitive Complexity · Db · ×1
  • Db::route_read (cognitive 16) crates/buzz-db/src/runtime/mod.rs:1273 — 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.
D2 · Cognitive Complexity · buzz_search · ×1
  • buzz_search::query::search (cognitive 16) crates/buzz-search/src/query.rs:219 — buzz_search::query::search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 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.
D2 · Cognitive Complexity · NostrWsConnection · ×1
  • NostrWsConnection::wait_for_auth_challenge (cognitive 16) crates/buzz-ws-client/src/connection.rs:157 — 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.
D2 · Cognitive Complexity · VadEndpoint · ×1
  • 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.
D2 · Cognitive Complexity · MainActivity.handleTranscodeVideoToMp4 (cognitive 16) · ×1
  • MainActivity.handleTranscodeVideoToMp4 (cognitive 16) mobile/android/app/src/main/kotlin/xyz/block/buzz/mobile/MainActivity.kt:309 — 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.
D2 · Cognitive Complexity · exhaustive.check_convergence (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · BuzzPushPresentationCacheStore.normalizedAvatarURL (cognitive 16) · ×1
  • BuzzPushPresentationCacheStore.normalizedAvatarURL (cognitive 16) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushPresentationCache.swift:563 — BuzzPushPresentationCacheStore.normalizedAvatarURL has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 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.
D2 · Cognitive Complexity · ActivityNotifier._drainRefreshQueue (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · _MobileHuddleDrawer.build (cognitive 16) · ×1
  • _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.
D2 · Cognitive Complexity · MobileHuddleController._finishLeaveLifecycle (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · _DynamicIslandQrScannerPortal.build (cognitive 16) · ×1
  • _DynamicIslandQrScannerPortal.build (cognitive 16) mobile/lib/features/pairing/pairing_qr_scanner/dynamic_island_portal.dart:10 — _DynamicIslandQrScannerPortal.build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _FigmaHomeScreen.build (cognitive 16) · ×1
  • _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.
D2 · Cognitive Complexity · check-px-text-core.runPxTextCheck (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · useBackForwardControls.useBackForwardControls (cognitive 16) · ×1
  • useBackForwardControls.useBackForwardControls (cognitive 16) desktop/src/app/navigation/useBackForwardControls.ts:21 — useBackForwardControls.useBackForwardControls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 33, 47, 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.
D2 · Cognitive Complexity · AdminConsolePanelHelpers.parseImetaAttachments (cognitive 16) · ×1
  • AdminConsolePanelHelpers.parseImetaAttachments (cognitive 16) desktop/src/features/admin-console/AdminConsolePanelHelpers.tsx:243 — 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.
D2 · Cognitive Complexity · MemorySection.MemoryEntryAccordion (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · agentSessionToolClassifier.classifyDeveloperHarnessTool (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · observerRelayStore.handleRelayObserverEvent (cognitive 16) · ×1
  • observerRelayStore.handleRelayObserverEvent (cognitive 16) desktop/src/features/agents/observerRelayStore.ts:545 — 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.
D2 · Cognitive Complexity · ManagedAgentRow.AgentSummary (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · teamSnapshotImport.lib.deriveImportToast (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ManagedAgentSessionPanel.SessionBody (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · useHuddleReadMarker.useHuddleReadMarker (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · AddCommunityDialog.AddCommunityDialog (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · useCommunities.resolveCommunityUpdateResult (cognitive 16) · ×1
  • useCommunities.resolveCommunityUpdateResult (cognitive 16) desktop/src/features/communities/useCommunities.tsx:42 — 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.
D2 · Cognitive Complexity · inbox.buildInboxItems (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · rowHeightEstimate.estimateRowHeight (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ChannelIntroBlock.ChannelIntroBlock (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · NonMemberMentionDialog.NonMemberMentionDialog (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · SelectionFormattingTray.SelectionFormattingTray (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · SystemMessageRow.describeGroupedArrivals (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · TimelineMessageRow.MessageRowItem (cognitive 16) · ×1
  • TimelineMessageRow.MessageRowItem (cognitive 16) desktop/src/features/messages/ui/TimelineMessageRow.tsx:94 — TimelineMessageRow.MessageRowItem has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 5, if/else 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.
D2 · Cognitive Complexity · UserProfilePanelFocusedViews.ChannelsFocusedView (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · CreateProjectFormSettings.CreateProjectFormSettings (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ProjectBrowserDialog.ProjectBrowserDialog (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · SettingsPanels.useThemeCategories (cognitive 16) · ×1
  • 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). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · SettingsView.SettingsView (cognitive 16) · ×1
  • 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, 187, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useStaleReaderRecovery.useStaleReaderRecovery (cognitive 16) · ×1
  • 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). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs 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.
D2 · Cognitive Complexity · CustomChannelSection.SectionActionsMenu (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · deep-link.drainPendingNavigationDeepLinks (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · resolveMentionNames.resolveMentionProps (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · adaptive-theme.findColorWithLuminance (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · EmojiBurstProvider.EmojiBurstProvider (cognitive 16) · ×1
  • 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). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 567, 671, 686, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SpoilerParticles.mountSpoilerParticleCanvas (cognitive 16) · ×1
  • 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 literals inside it that branch (lines 91, 138, 116, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · rich-link-preview-attachment.RichLinkPreviewAttachment (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · styled-qr-code.StyledQrCode (cognitive 16) · ×1
  • 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.
D22 · Internal API Consistency · Ambiguous distinction between 'bearer' and 'bearer_no_browser'. It is unclear if 'bearer' implies a browser-based flow by default or if it is a generic alias. If 'bearer' is the standard method, 'bearer_no_browser' suggests a variant that should perhaps be the default or named more explicitly (e.g., 'fetch_silent'). · ×1
  • Ambiguous distinction between 'bearer' and 'bearer_no_browser'. It is unclear if 'bearer' implies a browser-based flow by default or if it is a generic alias. If 'bearer' is the standard method, 'bearer_no_browser' suggests a variant that should perhaps be the default or named more explicitly (e.g., 'fetch_silent'). — Rename 'bearer' to 'fetch_with_browser' (or similar) if it triggers UI, or rename 'bearer_no_browser' to 'fetch_silent' and make 'bearer' the generic entry point that delegates based on context. (signatures: buzz_agent.auth.TokenSource.bearer(): Result | buzz_agent.auth.TokenSource.bearer_no_browser(): Result)
D22 · Internal API Consistency · Inconsistent constructor naming and parameter explosion. 'new' takes minimal args, 'new_with' adds an opener, and a third constructor adds timeout. This violates the 'new' convention for primary construction and forces users to guess which constructor to use based on optional-like behavior. · ×1
  • Inconsistent constructor naming and parameter explosion. 'new' takes minimal args, 'new_with' adds an opener, and a third constructor adds timeout. This violates the 'new' convention for primary construction and forces users to guess which constructor to use based on optional-like behavior. — Use a single 'new' constructor with a builder pattern or a single 'new' that accepts a 'PkceOAuthTokenSourceConfig' struct containing optional fields for opener and timeout. (signatures: buzz_agent.auth.PkceOAuthTokenSource.new(cfg: PkceOAuthConfig): Result | buzz_agent.auth.PkceOAuthTokenSource.new_with(cfg: PkceOAuthConfig, opener: AtomicU32): Result | buzz_agent.auth.PkceOAuthTokenSource.new_with_http_timeout(cfg: PkceOAuthConfig, opener: AtomicU32, http_timeout: Duration): Result)
D22 · Internal API Consistency · Inconsistent return types for construction. 'from_env' returns 'Result', implying it can fail, while 'for_discovery' returns 'Self' directly, implying it cannot fail. This inconsistency makes error handling patterns unpredictable when constructing Config instances. · ×1
  • Inconsistent return types for construction. 'from_env' returns 'Result', implying it can fail, while 'for_discovery' returns 'Self' directly, implying it cannot fail. This inconsistency makes error handling patterns unpredictable when constructing Config instances. — Ensure both constructors return 'Result<Self, ConfigError>' or both return 'Self' (panicking on invalid input if necessary, though Result is preferred). (signatures: buzz_agent.config.Config.from_env(): Result | buzz_agent.config.Config.for_discovery(provider: Provider, api_key: String, base_url: String, databricks_model_filter: DatabricksModelFilter): Self)
D22 · Internal API Consistency · Inconsistent naming for version/type identifiers. 'code' is used for error types, 'hash_version' for audit entries, and 'schema_version' for traces. While domains differ, the pattern of using 'version' for numeric identifiers is inconsistent with 'code' for string identifiers in errors. More critically, 'AuthError.code()' returns a string, which is unusual for a 'code' (often numeric), whereas 'hash_version' is numeric. This suggests a lack of unified error/code type. · ×1
  • Inconsistent naming for version/type identifiers. 'code' is used for error types, 'hash_version' for audit entries, and 'schema_version' for traces. While domains differ, the pattern of using 'version' for numeric identifiers is inconsistent with 'code' for string identifiers in errors. More critically, 'AuthError.code()' returns a string, which is unusual for a 'code' (often numeric), whereas 'hash_version' is numeric. This suggests a lack of unified error/code type. — Define a unified 'ErrorCode' or 'ErrorKind' enum/type across the API surface instead of using raw strings or mixed numeric/string representations for error identification. (signatures: buzz_agent.auth.AuthError.code(): str | buzz_audit.entry.AuditEntry.hash_version: i16 | buzz_conformance.TraceStep.schema_version: u32)
D22 · Internal API Consistency · Duplicate method name 'estimated_bytes' on distinct types that likely serve similar purposes (memory estimation). While not strictly an inconsistency in signature, it suggests a missing trait (e.g., 'EstimatableSize') that could unify these behaviors and allow for generic handling of memory pressure. · ×1
  • Duplicate method name 'estimated_bytes' on distinct types that likely serve similar purposes (memory estimation). While not strictly an inconsistency in signature, it suggests a missing trait (e.g., 'EstimatableSize') that could unify these behaviors and allow for generic handling of memory pressure. — Introduce a trait 'EstimatableSize' with 'estimated_bytes()' and implement it for both 'ToolResultContent' and 'HistoryItem'. (signatures: buzz_agent.types.ToolResultContent.estimated_bytes(): usize | buzz_agent.types.HistoryItem.estimated_bytes(): usize)
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 45 shared lines) · ×1
  • Near-duplicate member family (3 members, 45 shared lines) mobile/lib/features/profile/profile_edit_page.dart:649 — mobile/lib/features/profile/profile_edit_page.dart:649-719 | mobile/lib/features/profile/profile_text_edit_sheet.dart:39-164 | mobile/lib/features/profile/profile_text_editor.dart:162-232 — These 3 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · 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.
D4 · Code Duplication · Near-duplicate member pair (180 shared lines) · ×1
  • Near-duplicate member pair (180 shared lines) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:30 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:30-319 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:35-316 — 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.
D4 · Code Duplication · Near-duplicate member pair (108 shared lines) · ×1
  • Near-duplicate member pair (108 shared lines) crates/buzz-db/src/store/event.rs:477 — crates/buzz-db/src/store/event.rs:477-722 | crates/buzz-db/src/store/event.rs:782-927 — These two members are variants of one another: 108 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 · Near-duplicate member pair (78 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (48 shared lines) · ×1
  • Near-duplicate member pair (48 shared lines) crates/buzz-agent/src/llm.rs:1871 — crates/buzz-agent/src/llm.rs:1871-2067 | crates/buzz-agent/src/llm.rs:2264-2497 — 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.
D4 · Code Duplication · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) crates/buzz-acp/src/relay.rs:3715 — crates/buzz-acp/src/relay.rs:3715-3804 | 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.
D4 · Code Duplication · Near-duplicate member pair (38 shared lines) · ×1
  • 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 · Near-duplicate member pair (27 shared lines) · ×1
  • Near-duplicate member pair (27 shared lines) crates/buzz-relay/src/handlers/ingest.rs:1215 — crates/buzz-relay/src/handlers/ingest.rs:1215-1289 | crates/buzz-relay/src/handlers/ingest.rs:1296-1341 — These two members are variants of one another: 27 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) crates/buzz-sdk/src/builders.rs:749 — crates/buzz-sdk/src/builders.rs:749-768 | 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 (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) crates/buzz-db/src/store/event.rs:1851 — crates/buzz-db/src/store/event.rs:1851-1890 | crates/buzz-db/src/store/event.rs:1905-1941 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · 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:302 — crates/buzz-relay/src/handlers/command_executor.rs:302-429 | crates/buzz-relay/src/handlers/command_executor.rs:436-566 | crates/buzz-relay/src/handlers/command_executor.rs:573-639 | crates/buzz-relay/src/handlers/command_executor.rs:646-813 | crates/buzz-relay/src/handlers/command_executor.rs:1025-1130 | crates/buzz-relay/src/handlers/command_executor.rs:1137-1270 — 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.
D4 · Code Duplication · Duplicated block (87–100 lines × 2) · ×1
  • Duplicated block (87–100 lines × 2) crates/buzz-db/src/store/event.rs:530 — crates/buzz-db/src/store/event.rs:530-629 | crates/buzz-db/src/store/event.rs:812-898 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (64 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (60–61 lines × 2) · ×1
  • Duplicated block (60–61 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:1026 — crates/buzz-relay/src/handlers/command_executor.rs:1026-1086 | crates/buzz-relay/src/handlers/command_executor.rs:1138-1197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (35–36 lines × 2) · ×1
  • Duplicated block (35–36 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:337 — crates/buzz-relay/src/handlers/command_executor.rs:337-372 | crates/buzz-relay/src/handlers/command_executor.rs:499-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.
D4 · Code Duplication · Duplicated block (32–34 lines × 2) · ×1
  • Duplicated block (32–34 lines × 2) crates/buzz-db/src/store/event.rs:1857 — crates/buzz-db/src/store/event.rs:1857-1890 | crates/buzz-db/src/store/event.rs:1910-1941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) crates/buzz-relay/src/api/bridge.rs:2067 — crates/buzz-relay/src/api/bridge.rs:2067-2099 | crates/buzz-relay/src/api/bridge.rs:2137-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.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (32–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) crates/buzz-relay/src/handlers/count.rs:208 — crates/buzz-relay/src/handlers/count.rs:208-239 | crates/buzz-relay/src/handlers/count.rs:281-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.
D4 · Code Duplication · Duplicated block (29–31 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (29–30 lines × 3) · ×1
  • Duplicated block (29–30 lines × 3) crates/buzz-acp/src/relay.rs:2033 — crates/buzz-acp/src/relay.rs:2033-2062 | crates/buzz-acp/src/relay.rs:2072-2100 | crates/buzz-acp/src/relay.rs:2105-2133 — 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.
D4 · Code Duplication · Duplicated block (26–29 lines × 3) · ×1
  • Duplicated block (26–29 lines × 3) crates/buzz-db/src/store/relay_admin_actions.rs:462 — crates/buzz-db/src/store/relay_admin_actions.rs:462-490 | crates/buzz-db/src/store/relay_admin_actions.rs:550-575 | crates/buzz-db/src/store/relay_admin_actions.rs:740-765 — 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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (23–27 lines × 2) · ×1
  • Duplicated block (23–27 lines × 2) crates/buzz-relay/src/api/media.rs:785 — crates/buzz-relay/src/api/media.rs:785-811 | crates/buzz-relay/src/api/media.rs:1078-1100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (24–26 lines × 3) · ×1
  • Duplicated block (24–26 lines × 3) crates/buzz-db/src/store/relay_admin_actions.rs:506 — crates/buzz-db/src/store/relay_admin_actions.rs:506-531 | crates/buzz-db/src/store/relay_admin_actions.rs:594-617 | crates/buzz-db/src/store/relay_admin_actions.rs:776-800 — 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.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) crates/buzz-acp/src/acp.rs:1268 — crates/buzz-acp/src/acp.rs:1268-1293 | crates/buzz-acp/src/acp.rs:1592-1616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) crates/buzz-relay/src/api/bridge.rs:1338 — crates/buzz-relay/src/api/bridge.rs:1338-1362 | crates/buzz-relay/src/api/bridge.rs:1955-1978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–24 lines × 3) · ×1
  • Duplicated block (22–24 lines × 3) crates/buzz-relay/src/api/bridge.rs:915 — crates/buzz-relay/src/api/bridge.rs:915-938 | crates/buzz-relay/src/api/bridge.rs:1241-1262 | crates/buzz-relay/src/api/bridge.rs:1868-1889 — 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.
D4 · Code Duplication · Duplicated block (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) crates/buzz-acp/src/config.rs:873 — crates/buzz-acp/src/config.rs:873-896 | desktop/src-tauri/src/managed_agents/discovery.rs:333-353 — 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.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) crates/buzz-acp/src/pool.rs:3356 — crates/buzz-acp/src/pool.rs:3356-3375 | crates/buzz-acp/src/pool.rs:3414-3435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–22 lines × 2) · ×1
  • Duplicated block (14–22 lines × 2) desktop/src-tauri/src/commands/agents.rs:93 — desktop/src-tauri/src/commands/agents.rs:93-106 | desktop/src-tauri/src/commands/agents.rs:181-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) crates/buzz-relay/src/api/admin/mod.rs:1008 — crates/buzz-relay/src/api/admin/mod.rs:1008-1028 | crates/buzz-relay/src/api/admin/mod.rs:1086-1103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) crates/buzz-db/src/store/relay_admin_actions.rs:458 — crates/buzz-db/src/store/relay_admin_actions.rs:458-479 | crates/buzz-db/src/store/relay_admin_actions.rs:548-567 | crates/buzz-db/src/store/relay_admin_actions.rs:648-667 | crates/buzz-db/src/store/relay_admin_actions.rs:738-757 — 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) crates/buzz-acp/src/queue.rs:592 — crates/buzz-acp/src/queue.rs:592-611 | crates/buzz-acp/src/queue.rs:656-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) crates/buzz-relay/src/audio/wire.rs:70 — crates/buzz-relay/src/audio/wire.rs:70-86 | desktop/src-tauri/src/huddle/wire.rs:103-122 — 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.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 5) · ×1
  • 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:381-397 | desktop/src-tauri/src/commands/agents.rs:452-468 | desktop/src-tauri/src/commands/agents.rs:875-891 — 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.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) crates/buzz-admin/src/main.rs:712 — crates/buzz-admin/src/main.rs:712-724 | crates/buzz-relay/src/handlers/side_effects.rs:1202-1218 — 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) crates/buzz-agent/src/llm.rs:2000 — crates/buzz-agent/src/llm.rs:2000-2016 | crates/buzz-agent/src/llm.rs:2438-2452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–16 lines × 4) · ×1
  • Duplicated block (13–16 lines × 4) crates/buzz-db/src/store/relay_admin_actions.rs:518 — crates/buzz-db/src/store/relay_admin_actions.rs:518-533 | crates/buzz-db/src/store/relay_admin_actions.rs:606-619 | crates/buzz-db/src/store/relay_admin_actions.rs:789-802 | crates/buzz-db/src/store/relay_admin_actions.rs:1081-1093 — 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) crates/buzz-acp/src/acp.rs:1423 — crates/buzz-acp/src/acp.rs:1423-1438 | crates/buzz-acp/src/acp.rs:1548-1559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) crates/buzz-db/src/store/feed.rs:370 — crates/buzz-db/src/store/feed.rs:370-384 | crates/buzz-db/src/store/feed.rs:455-469 | crates/buzz-db/src/store/feed.rs:531-544 — 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) crates/buzz-relay/src/handlers/side_effects.rs:1473 — crates/buzz-relay/src/handlers/side_effects.rs:1473-1487 | crates/buzz-relay/src/handlers/side_effects.rs:1543-1557 | crates/buzz-relay/src/handlers/side_effects.rs:2196-2210 — 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 4) · ×1
  • Duplicated block (10–12 lines × 4) crates/buzz-relay/src/api/bridge.rs:2041 — crates/buzz-relay/src/api/bridge.rs:2041-2052 | crates/buzz-relay/src/api/bridge.rs:2113-2122 | crates/buzz-relay/src/handlers/count.rs:181-192 | crates/buzz-relay/src/handlers/count.rs:256-265 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/handlers/count.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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.
D4 · Code Duplication · Duplicated block (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) crates/buzz-relay/src/handlers/command_executor.rs:494 — crates/buzz-relay/src/handlers/command_executor.rs:494-505 | crates/buzz-relay/src/handlers/command_executor.rs:604-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) crates/buzz-acp/src/relay.rs:1788 — crates/buzz-acp/src/relay.rs:1788-1808 | crates/buzz-acp/src/relay.rs:2047-2057 | crates/buzz-acp/src/relay.rs:2086-2096 | crates/buzz-acp/src/relay.rs:2119-2129 — 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) crates/buzz-relay/src/handlers/count.rs:84 — crates/buzz-relay/src/handlers/count.rs:84-92 | crates/buzz-relay/src/handlers/req.rs:114-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7–11 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • 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:150-158 | desktop/src-tauri/src/commands/agents.rs:380-388 | desktop/src-tauri/src/commands/agents.rs:451-459 | desktop/src-tauri/src/commands/agents.rs:874-882 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) crates/buzz-relay/src/handlers/command_executor.rs:337 — crates/buzz-relay/src/handlers/command_executor.rs:337-345 | crates/buzz-relay/src/handlers/command_executor.rs:499-507 | crates/buzz-relay/src/handlers/command_executor.rs:742-750 | crates/buzz-relay/src/handlers/command_executor.rs:1065-1073 | crates/buzz-relay/src/handlers/command_executor.rs:1176-1184 — 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) crates/buzz-relay/src/api/bridge.rs:2663 — crates/buzz-relay/src/api/bridge.rs:2663-2671 | crates/buzz-relay/src/api/gifs.rs:130-138 | crates/buzz-relay/src/api/invites.rs:239-247 | crates/buzz-relay/src/api/workflows.rs:56-64 — before extracting anything, compare `crates/buzz-relay/src/api/bridge.rs` and `crates/buzz-relay/src/api/workflows.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (3–8 lines × 4) · ×1
  • Duplicated block (3–8 lines × 4) crates/buzz-acp/src/relay.rs:1841 — crates/buzz-acp/src/relay.rs:1841-1844 | crates/buzz-acp/src/relay.rs:2444-2451 | crates/buzz-acp/src/relay.rs:2747-2753 | 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) crates/buzz-agent/src/llm.rs:2227 — crates/buzz-agent/src/llm.rs:2227-2231 | crates/buzz-agent/src/llm.rs:2386-2391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (3–5 lines × 3) · ×1
  • Duplicated block (3–5 lines × 3) crates/buzz-db/src/store/api_token.rs:184 — crates/buzz-db/src/store/api_token.rs:184-188 | crates/buzz-db/src/store/api_token.rs:246-248 | crates/buzz-db/src/store/api_token.rs:387-391 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) crates/buzz-db/src/store/feed.rs:136 — crates/buzz-db/src/store/feed.rs:136-151 | crates/buzz-db/src/store/feed.rs:224-239 | crates/buzz-db/src/store/thread.rs:286-301 | crates/buzz-db/src/store/thread.rs:560-575 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) crates/buzz-db/src/store/archived_identities.rs:68 — crates/buzz-db/src/store/archived_identities.rs:68-82 | crates/buzz-db/src/store/event.rs:969-982 | crates/buzz-db/src/store/reaction.rs:250-270 | crates/buzz-db/src/store/reaction.rs:317-338 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 20) · ×1
  • Duplicated block (5 lines × 20) crates/buzz-cli/src/commands/channels.rs:1630 — crates/buzz-cli/src/commands/channels.rs:1630-1635 | crates/buzz-cli/src/commands/channels.rs:1646-1651 | crates/buzz-cli/src/commands/channels.rs:1662-1667 | crates/buzz-cli/src/commands/channels.rs:1674-1679 | crates/buzz-cli/src/commands/channels.rs:1686-1691 | crates/buzz-cli/src/commands/channels.rs:1698-1703 | crates/buzz-cli/src/commands/channels.rs:1710-1715 | crates/buzz-cli/src/commands/channels.rs:1722-1727 | crates/buzz-cli/src/commands/channels.rs:1753-1758 | crates/buzz-cli/src/commands/channels.rs:1770-1775 | crates/buzz-cli/src/commands/channels.rs:1855-1860 | crates/buzz-cli/src/commands/emoji.rs:149-153 | crates/buzz-cli/src/commands/messages.rs:839-845 | crates/buzz-cli/src/commands/messages.rs:870-876 | crates/buzz-cli/src/commands/messages.rs:893-899 | crates/buzz-cli/src/commands/messages.rs:924-930 | 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:416-422 — 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.
D4 · Code Duplication · Duplicated block (14–27 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (17–22 lines × 2) · ×1
  • Duplicated block (17–22 lines × 2) mobile/ios/Runner/AppDelegate.swift:887 — mobile/ios/Runner/AppDelegate.swift:887-908 | 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:887` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–19 lines × 2) · ×1
  • Duplicated block (12–19 lines × 2) mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:135 — mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:135-146 | mobile/ios/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:346-364 — both copies are in the same file, so extract the 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/BuzzPushKit/Sources/BuzzPushKit/BuzzPushNotificationResolver.swift:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) mobile/ios/Runner/JumpToLatestGlassButton.swift:16 — mobile/ios/Runner/JumpToLatestGlassButton.swift:16-27 | mobile/ios/Runner/JumpToLatestGlassButton.swift:157-168 | mobile/ios/Runner/JumpToLatestGlassButton.swift:520-531 | 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.
D4 · Code Duplication · Duplicated block (87 lines × 2) · ×1
  • Duplicated block (87 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:167 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:167-253 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:162-248 — 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 7 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.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) mobile/lib/features/channels/channel_detail_page/system_rows.dart:595 — mobile/lib/features/channels/channel_detail_page/system_rows.dart:595-650 | mobile/lib/features/channels/thread_detail_page/nested_thread_summary_row.dart:58-113 — 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.
D4 · Code Duplication · Duplicated block (34–36 lines × 2) · ×1
  • Duplicated block (34–36 lines × 2) mobile/lib/features/channels/channel_actions_sheet.dart:404 — mobile/lib/features/channels/channel_actions_sheet.dart:404-437 | mobile/lib/features/channels/message_actions.dart:653-688 — 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.
D4 · Code Duplication · Duplicated block (22–28 lines × 2) · ×1
  • Duplicated block (22–28 lines × 2) mobile/lib/features/channels/channel_detail_page/app_bar.dart:213 — mobile/lib/features/channels/channel_detail_page/app_bar.dart:213-234 | mobile/lib/features/channels/channels_page/channel_tile.dart:172-199 — 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.
D4 · Code Duplication · Duplicated block (27 lines × 4) · ×1
  • Duplicated block (27 lines × 4) mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:63 — mobile/lib/features/channels/channel_mutes/channel_mutes_provider.dart:63-89 | mobile/lib/features/channels/channel_sections/channel_sections_provider.dart:63-89 | mobile/lib/features/channels/channel_sort/channel_sort_provider.dart:71-97 | mobile/lib/features/channels/channel_stars/channel_stars_provider.dart:63-89 — `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 45 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.
D4 · Code Duplication · Duplicated block (21–27 lines × 3) · ×1
  • Duplicated block (21–27 lines × 3) mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:137 — mobile/lib/features/channels/channel_mutes/channel_mutes_manager.dart:137-157 | mobile/lib/features/channels/channel_sections/channel_sections_manager.dart:157-183 | mobile/lib/features/channels/channel_stars/channel_stars_manager.dart:137-157 — `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.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) mobile/lib/features/profile/profile_edit_page.dart:676 — mobile/lib/features/profile/profile_edit_page.dart:676-701 | mobile/lib/features/profile/profile_text_edit_sheet.dart:114-139 | mobile/lib/features/profile/profile_text_editor.dart:189-214 — 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 3 separate duplicated blocks between them, totalling at least 45 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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) mobile/lib/features/channels/channel_detail_page/message_bubble.dart:297 — mobile/lib/features/channels/channel_detail_page/message_bubble.dart:297-317 | mobile/lib/features/channels/thread_detail_page/thread_message.dart:292-313 — 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 7 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.
D4 · Code Duplication · Duplicated block (9–14 lines × 2) · ×1
  • Duplicated block (9–14 lines × 2) mobile/lib/features/activity/activity_page/inbox_row.dart:295 — mobile/lib/features/activity/activity_page/inbox_row.dart:295-308 | mobile/lib/features/search/search_page.dart:897-905 — 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) mobile/lib/features/settings/theme_picker_page/theme_preview_sheet.dart:179 — mobile/lib/features/settings/theme_picker_page/theme_preview_sheet.dart:179-190 | mobile/lib/features/settings/theme_picker_page/theme_preview_sheet.dart:597-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.95 — rust-toolchain.toml declares Rust 1.95 as this project's toolchain file, and Rust 1.95, superseded by 1.96 on 2026-05-28 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-05-28 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — admin-web/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×1
  • Outbound HTTP without resilience desktop/src-tauri/src/app_state.rs:182 — `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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking desktop/test-loader-hooks.mjs:143 — `load` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication · Duplication concentrated across 28 sibling directories (281 clone groups) · ×1
  • Duplication concentrated across 28 sibling directories (281 clone groups) desktop/src/features/onboarding/ui/EncryptedBackupCreator.tsx:49 — 281 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) — 140 of them are reported below, and 141 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 281 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 281 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 281 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 · Duplication concentrated across 5 sibling directories (109 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (109 clone groups) desktop/src/features/messages/ui/MessageReactions.tsx:371 — 109 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 54 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 109 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 109 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 109 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 · Duplication concentrated across 3 sibling directories (20 clone groups) · ×1
  • 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.
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (7 clone groups) · ×1
  • 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.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (6 clone groups) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (189 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (161 lines × 2 locations) · ×1
  • 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.
R10 · Code Duplication · Wholesale file copy (152 identical lines × 2 files) · ×1
  • 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.
R10 · Code Duplication · Duplicated block (121 lines × 2 locations) · ×1
  • 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:69 — desktop/src/features/agents/ui/usePersonaActions.ts:69 · 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:550 — 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 (111 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (111 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:115 — desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:115 · desktop/src/features/settings/ui/HostedCommunitiesSettingsCard.tsx:127 — the two spans are one implementation copied and then locally edited — 528 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 (104 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (104 matched lines × 2 locations) desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:150 — desktop/src/features/communities/ui/HostedCommunityCreateFlow.tsx:150 · desktop/src/features/communities/ui/HostedCommunityOnboarding.tsx:198 — the two spans are one implementation copied and then locally edited — 511 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.
R10 · Code Duplication · Wholesale file copy (94 identical lines × 2 files) · ×1
  • 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 (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 (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:24 — 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.
R10 · Code Duplication · Duplicated block with local edits (56 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (56 matched lines × 2 locations) desktop/src/features/projects/ui/AddProjectRepositoryDialog.tsx:148 — desktop/src/features/projects/ui/AddProjectRepositoryDialog.tsx:148 · desktop/src/features/projects/ui/CreateProjectWorkItemDialog.tsx:156 — the two spans are one implementation copied and then locally edited — 236 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 (54 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (54 matched lines × 2 locations) desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs:120 — desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs:120 · desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs:307 — the two spans are one implementation copied and then locally edited — 325 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 651, cognitive 547) · ×1
  • Complex function (anonymous) (cyclomatic 651, cognitive 547) desktop/src/testing/e2eBridge.ts:12010 — (anonymous) has cyclomatic complexity 651 and cognitive complexity 547; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AgentConfigFields (cyclomatic 122, cognitive 112) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function sendToMockSocket (cyclomatic 118, cognitive 237) · ×1
  • Complex function sendToMockSocket (cyclomatic 118, cognitive 237) desktop/src/testing/e2eBridge.ts:10879 — 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.
R2 · Cyclomatic Complexity · Complex function UserProfilePanel (cyclomatic 112, cognitive 90) · ×1
  • Complex function UserProfilePanel (cyclomatic 112, cognitive 90) desktop/src/features/profile/ui/UserProfilePanel.tsx:104 — 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.
R2 · Cyclomatic Complexity · Complex function ChannelPane (cyclomatic 108, cognitive 92) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function AnimatedAvatarCapture (cyclomatic 98, cognitive 91) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function processTranscriptEvent (cyclomatic 97, cognitive 166) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function ProjectDetailScreen (cyclomatic 95, cognitive 81) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 91, cognitive 49) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function AgentCreationPreview (cyclomatic 87, cognitive 92) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function ProfileAvatarEditor (cyclomatic 85, cognitive 76) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function MessageTimeline (cyclomatic 81, cognitive 71) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function ProfileSummaryView (cyclomatic 70, cognitive 55) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function AgentDefinitionDialog (cyclomatic 69, cognitive 62) · ×1
  • Complex function AgentDefinitionDialog (cyclomatic 69, cognitive 62) desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:124 — 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.
R2 · Cyclomatic Complexity · Complex function NostrKeyImportForm (cyclomatic 68, cognitive 64) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function ProjectRepositoryActionsPanel (cyclomatic 68, cognitive 59) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function UserProfilePopoverBody (cyclomatic 68, cognitive 55) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function MessageRow (cyclomatic 67, cognitive 63) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function apply (cyclomatic 64, cognitive 86) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function InboxMessageDetailPane (cyclomatic 61, cognitive 58) · ×1
  • 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 · Large Files · ×1
  • Large Files — 215 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: desktop/src/testing/e2eBridge.ts (14643), desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs (2539), desktop/src/shared/ui/VideoPlayer.tsx (2094), desktop/src/shared/ui/markdown.tsx (1751), desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs (1512), desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs (1434) (+209 more).
R7 · Dead Code · Dead file (~2784 LoC) · ×1
  • Dead file (~2784 LoC) desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~1659 LoC) · ×1
  • Dead file (~1659 LoC) desktop/src/features/admin-console/adminConsolePanelStaffing.jsdom-test.mjs — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~1616 LoC) · ×1
  • Dead file (~1616 LoC) desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~891 LoC) · ×1
  • Dead file (~891 LoC) desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~429 LoC) · ×1
  • Dead file (~429 LoC) desktop/src/features/agents/ui/ManagedAgentRow.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~380 LoC) · ×1
  • Dead file (~380 LoC) desktop/src/features/channels/ui/ChannelMemberInviteCard.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~338 LoC) · ×1
  • Dead file (~338 LoC) desktop/src/features/admin-console/adminConsolePanelTestHelpers.jsdom.mjs — no import path from any entry point (87 application, 32 tooling, 911 test roots considered), but 4 in-repo import(s) from 4 other file(s) do name it (desktop/src/features/admin-console/adminConsolePanelFeedback.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelReports.jsdom-test.mjs, desktop/src/features/admin-console/adminConsolePanelSession.jsdom-test.mjs and 1 more) — 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
R7 · Dead Code · Dead file (~320 LoC) · ×1
  • Dead file (~320 LoC) desktop/src/features/agents/ui/ModelPicker.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~289 LoC) · ×1
  • Dead file (~289 LoC) desktop/src/features/community-members/ui/CommunityMembersCard.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~288 LoC) · ×1
  • Dead file (~288 LoC) desktop/src/features/settings/ui/settingsNavModeration.jsdom-test.mjs — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~272 LoC) · ×1
  • Dead file (~272 LoC) desktop/src/features/home/ui/FeedSection.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~211 LoC) · ×1
  • Dead file (~211 LoC) desktop/src/features/profile/ui/AvatarUpload.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~170 LoC) · ×1
  • Dead file (~170 LoC) desktop/src/features/moderation/lib/timeoutStore.jsdom-test.mjs — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~106 LoC) · ×1
  • Dead file (~106 LoC) desktop/src/features/messages/useLoadMissingAncestors.ts — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~92 LoC) · ×1
  • Dead file (~92 LoC) desktop/src/features/community-members/ui/ConfirmRemoveDialog.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~83 LoC) · ×1
  • Dead file (~83 LoC) web/src/shared/ui/card.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~78 LoC) · ×1
  • Dead file (~78 LoC) desktop/src/features/channels/ui/MembersSidebarAgentControls.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~75 LoC) · ×1
  • Dead file (~75 LoC) desktop/src/features/agents/lib/pickBotName.ts — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~74 LoC) · ×1
  • Dead file (~74 LoC) desktop/src/features/agents/ui/useWindowFileDragOver.ts — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~71 LoC) · ×1
  • Dead file (~71 LoC) desktop/src/features/channels/ui/useQuickBotDrop.ts — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~66 LoC) · ×1
  • Dead file (~66 LoC) desktop/src/features/channels/ui/useReusableAgentDetection.ts — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~64 LoC) · ×1
  • Dead file (~64 LoC) desktop/src/features/channels/ui/AddChannelBotGenericSection.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~60 LoC) · ×1
  • Dead file (~60 LoC) desktop/src/shared/hooks/useFileImportZone.ts — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~58 LoC) · ×1
  • Dead file (~58 LoC) desktop/src/features/moderation/ui/TimeoutDurationSubmenu.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~57 LoC) · ×1
  • Dead file (~57 LoC) desktop/src/features/agents/ui/AgentGroupRows.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~52 LoC) · ×1
  • Dead file (~52 LoC) desktop/src/features/projects/ui/ProjectsListScopeDropdown.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~51 LoC) · ×1
  • Dead file (~51 LoC) desktop/src/features/channels/ui/useEffectiveRuntimes.ts — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~37 LoC) · ×1
  • Dead file (~37 LoC) desktop/src/features/projects/ui/ProjectsOverviewChatToggle.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~33 LoC) · ×1
  • Dead file (~33 LoC) desktop/src/features/agents/ui/CreateNewButton.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~32 LoC) · ×1
  • Dead file (~32 LoC) web/src/shared/theme/ThemeToggle.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~29 LoC) · ×1
  • Dead file (~29 LoC) desktop/src/shared/ui/import-status-icon.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R7 · Dead Code · Dead file (~28 LoC) · ×1
  • Dead file (~28 LoC) desktop/src/shared/ui/TopChromeBackdrop.tsx — no import path from any entry point (87 application, 32 tooling, 911 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
R8 · Dependency Hygiene · Unused dependency 'qrcode.react' · ×1
  • 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.
Minor — 38 finding(s)
D16 · Bus Factor · Off-boarding risk · ×9
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 79 significant file(s) lose their only recent owner: mobile/lib/features/profile/animated_avatar_capture.dart, mobile/ios/Runner/NativeAttachmentPopover.swift, mobile/lib/shared/huddle/huddle_transport.dart, mobile/lib/features/channels/channel_detail_page/huddle_sheet.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 (+71 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 45 significant file(s) lose their only recent owner: crates/buzz-auth/src/nip_fi/verifier/tests.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-agent/src/permission.rs, crates/buzz-relay/src/handlers/report_resolution.rs, crates/buzz-auth/src/nip_fi/verifier.rs, desktop/src-tauri/src/commands/agent_discovery/install_exec.rs (+37 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 43 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 (+35 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 21 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, REDACTED, desktop/src/features/channels/channelSnapshot.ts, desktop/src/features/onboarding/ui/LandingBees.tsx, mobile/lib/features/search/search_provider.dart, desktop/src-tauri/src/prevent_sleep.rs (+13 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 18 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 (+10 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 17 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, desktop/src-tauri/src/huddle/latency_bench.rs, crates/buzz-voice/src/pocket.rs, crates/buzz-pubsub/src/cache_invalidation.rs (+9 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 8 significant file(s) lose their only recent owner: crates/buzz-sdk/src/broker/tests.rs, 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 #8 — If anonymized user #8 becomes unavailable, 6 significant file(s) lose their only recent owner: crates/buzz-push-gateway/src/config.rs, mobile/ios/Runner/PushSnapshotBridge.swift, mobile/lib/shared/push/push_bridge.dart, mobile/lib/shared/push/push_presentation_cache.dart, mobile/ios/NotificationService/NotificationService.swift, mobile/lib/features/channels/channels_page/browse_channels_sheet.dart. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/buzz-db/src/store/replaceable.rs, crates/buzz-db/src/store/community.rs, crates/buzz-db/src/store/reminder.rs, desktop/src/features/profile/lib/userLabelStorage.ts. Pair on, review, or document these before any departure.
X9 · Subsumed condition operand · Subsumed condition operand · ×9
  • Subsumed condition operand crates/buzz-test-client/tests/e2e_relay.rs:1721 — `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 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/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 crates/buzz-db/src/runtime/migration.rs:667 — `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.
  • 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 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/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.
D31 · IaC & Container Security · Low IaC · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D19 · Documentation Quality · Documentation · ×2
  • Documentation: no licence statement crates/buzz-feature-flags/README.md — No licence statement appears in the document despite being a library crate. Add a LICENSE file and a one-line licence header to the README.
  • Documentation: written for insiders docs/admin/README.md — The NIP-98 authentication section references `BUZZ_ADMIN_AUTH=nip98` without explaining what it means for an operator, leaving only the auth-mode configuration present. Add a one-line description of how NIP-98 signing works (event kind, principal model) so new readers can decode it.
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift — README omits the admin-web project (buzz-admin-web) — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
  • README/code drift — omits the hosted relay deployment guide — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
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 (252 single-owned of 2091 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 2091 of the 3018 production source files in this repository met that bar). They are anonymized user #10 (2 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (1 file(s)), anonymized user #13 (1 file(s)), anonymized user #14 (1 file(s)), anonymized user #15 (1 file(s)) (+3 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D20 · ADR Quality · No ADRs found · ×1
  • 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 · Split crates/buzz-relay · ×1
  • Split crates/buzz-relay — Large at 99k LoC and spread across nine unrelated namespaces (git API, audio, admin bridge, conformance), meeting the size-and-sprawl threshold. Suggested: split into api/git, api/admin, api/bridge, and a dedicated audio namespace
D26 · Project Cohesion · Split desktop/src-tauri · ×1
  • Split desktop/src-tauri — A sprawling Tauri desktop project whose namespaces are all UI components (commands, managed_agents, templates) and one split-on-namespace. Suggested: split into commands/personas, commands/teams, commands/discovery, and a dedicated migration namespace
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D41 · Kernel & Syscall Confinement · No AppArmor/SELinux confinement · ×1
  • No AppArmor/SELinux confinement — Workloads declare no AppArmor or SELinux profile. A mandatory-access-control profile confines what a compromised container can touch on the host, complementing seccomp's syscall filter.
M2 · Architecture documentation · No ADRs · ×1
  • 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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 19/27 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.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected deploy/compose/Caddyfile:4 — No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — 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.)
Minor — 4 finding(s)
D10 · Test Quality · Skipped (documented) · ×4
  • Skipped (documented): (unnamed test) desktop/tests/e2e/relay-restart.live.spec.ts:135 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
  • Skipped (documented): (unnamed test) desktop/tests/e2e/composer-link-shortcut.spec.ts:112 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
  • Skipped (documented): (unnamed test) desktop/tests/e2e/composer-link-shortcut.spec.ts:133 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
  • Skipped (documented): (unnamed test) desktop/tests/e2e/agents-everywhere.live.spec.ts:87 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip

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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-ed0157b9962a44dc941648cc208c2dde/history.json --exit-code 0 --source .13artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-ed0157b9962a44dc941648cc208c2dde/tree.json --exit-code 0 --source .13artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .56artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update32artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .25artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—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 29 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`, … (+24 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a0e9c4-8896-7a82-8d69-075eb225793a · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md